0
4.9kviews
Consider the following relation for book club

Members (Member_Id,Name,Designation,Age) - Books (Book_Id,BookAuthor,BookTitle,BookPublisher,BookPrice) - Reserves (Member_Id,Book_Id,Date) - Write the sql queries for the following statements: - i. List the names of members who are professors older than 50 years - ii. List the titles of book reserved by professors - iii. Find the Id’s of members who have reserved books which cost more than Rs.200 - iv. Find the authors and titles of book reserved on ’20-9-2012’ -

1 Answer
1
343views

i) SELECT Name FROM Members

WHERE Designation=’Professor’

AND Age>50

ii) SELECT BookTitle

FROM Members M, Books B, Reserves R

WHERE M.Member_Id = R.Member_Id &&

M.Designation = 'Professor'&&

B.Book_Id = R.Book_Id

iii) SELECT Member_Id

FROM Books B, Reserves R

WHERE B.Book_Id = R.Book_Id &&

BookPrice > 200

iv) SELECT BookAuthor, BookTitle

FROM Books B, Reserves R

WHERE B.Book_Id = R.Book_Id &&

R.Date = ‘20-9-2012’

Please log in to add an answer.