Question: ASSIGNMENT: Develop a SQL query that will select all of the books that are currently checked out and are past due to be returned, which

ASSIGNMENT:

Develop a SQL query that will select all of the books that are currently checked out and are past due to be returned, which have a value greater than $10.00. Your query must return the name, address, postal code, and phone number of the borrower, the name and phone number of the librarian responsible for the transaction, the date the book was due to be returned, and the name, cost, and ISBN number of the book. You query should sort the list by the return date in descending order.

WHAT I HAVE TRIED SO FAR:

SELECT br.First_name, br.Last_name, br.Address, br.Postal_code, br.Phone_number, l.First_name, l.Last_name, l.phone_number, bl.Return_date, b.Title, b.ISBN_number, b.Cost

FROM Booklended bl, BookCopy bc, Book b, Borrower br, Librarian l

WHERE bl.Library_card_ID = l.Library_card_ID AND bl.Copy_ID = bc. Copy_ID AND Librarian_ID = l.Librarian_ID AND bc.Book_ID = b.Book_ID AND bl.Return_date < (select CURRENT_DATE()) AND b.cost > 10

AND

SELECT br.First_name, br.Last_name, br.Address, br.Postal_code, br.Phone_number, l.First_name, l.Last_name, l.phone_number, bl.Return_date, b.Title, b.ISBN_number, b.Cost FROM Booklended bl, BookCopy bc, Book b, Borrower br, Librarian l WHERE bl.Library_card_ID = l.Library_card_ID AND bl.Copy_ID = bc. Copy_ID AND Librarian_ID = l.Librarian_ID AND bc.Book_ID = b.Book_ID AND bl.Return_date < (select GETDATE()) AND b.cost > 10

THIS IS THE ERROR I RECEIVE WHEN I TRY EITHER OF THE ABOVE OPTIONS:

1: Access is denied: CURRENT_DATE in statement [SELECT br.First_name, br.Last_name, br.Address, br.Postal_code, br.Phone_number, l.First_name, l.Last_name, l.phone_number, bl.Return_date, b.Title, b.ISBN_number, b.Cost

FROM Booklended bl, BookCopy bc, Book b, Borrower br, Librarian l

WHERE bl.Library_card_ID = l.Library_card_ID AND bl.Copy_ID = bc. Copy_ID AND Librarian_ID = l.Librarian_ID AND bc.Book_ID = b.Book_ID AND bl.Return_date < (select CURRENT_DATE(]

AND

2: Access is denied: GETDATE in statement [SELECT br.First_name, br.Last_name, br.Address, br.Postal_code, br.Phone_number, l.First_name, l.Last_name, l.phone_number, bl.Return_date, b.Title, b.ISBN_number, b.Cost FROM Booklended bl, BookCopy bc, Book b, Borrower br, Librarian l WHERE bl.Library_card_ID = l.Library_card_ID AND bl.Copy_ID = bc. Copy_ID AND Librarian_ID = l.Librarian_ID AND bc.Book_ID = b.Book_ID AND bl.Return_date < (select GETDATE(]

Please help! Thanks. Why am i getting access denied?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!