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 Select Where Examples

1-) List the student whose name Bill

Solution 1)

Select * from students 
       where name = 'Bill'


ETİKETLER

Select - Where -
2-) List the books with book numbers 3,4,8,9,11 and 23 in the books table

Solution 1)

Select * from books 
       where bookId in(3,4,8,9,11,23)

Solution 2)

Select * from books 
    where bookId = 3 or
	      bookId = 4 or 
		  bookId = 8 or 
		  bookId = 9 or 
		  bookId =11 or 
		  bookId = 23


ETİKETLER

Select - Where -
3-) List the books that's page count is even

Solution 1)

Select * from books 
       where bookId % 2 = 0


ETİKETLER

Select - Where -
4-) List the students with student numbers 1,7,11 and 17 in the student table

Solution 1)

select * from students 
	where studentId=1 or studentId=7 or 
		  studentId=11 or studentId=17

Solution 2)

select * from student 
     where studentId in (1,7,11,17)


ETİKETLER

Select - Where -
5-) List the students whose school number is odd

Solution 1)

Select * from students 
        where studentId % 2 = 1


ETİKETLER

Select - Where -
Library Database
Database