The Queries in this page solved at the library database. It is a sample database generated by randomly records. You can download it from the link. You will see more than 500 examples in the future. You can filter from the search panel above by selecting sql statements. I hope you will like it

# SQL Delete Examples

##### 1-) Delete the student whose number 5.

Solution 1)

Delete from students
where studentId = 5

ETİKETLER

- -
##### 2-) Delete all books

Solution 1)

Delete from books

ETİKETLER

-
##### 3-) Delete all borrows

Solution 1)

Delete from borrows

ETİKETLER

-
##### 4-) Delete the books, number of pages between 50 and 100 pages.

Solution 1)

Delete from books
where pageCount between 50 and 100

Solution 2)

Delete from books
where pagecount<=100 and pagecount>=50

ETİKETLER

- -
##### 5-) Delete students who do not read books.

Solution 1)

Delete from students
where studentId not in
(Select studentId from borrows)

ETİKETLER

- - -
##### 6-) Delete the students whose name is Gray

Solution 1)

Delete from students
where name = 'Gray'

ETİKETLER

- -
##### 7-) Delete students whose name is Gray and surname is King

Solution 1)

Delete from students
where name = 'Gray' and surname = 'King'

ETİKETLER

- - -
##### 8-) Delete students who have read less than 5 books.

Solution 1)

Delete from students
where studentId in (Select studentId from borrows
group by studentId
having count(*)<5)

ETİKETLER

- - - - -
Library Database