Question

Given the following relations about students borrow books from a university library. Student (StudentID: integer, Name:...

Given the following relations about students borrow books from a university library.

Student (StudentID: integer, Name: string, EnrollDate: date)

Book(Title: string, Author: string, Quantity: integer)

BorrowRecord(StudentID: integer, BookTitle: string, BookAuthor: string, BorrowDate: date, DueDate: date, Returned: integer)

Note that there are no duplicate records in the three relations, and there can be duplicates of book titles. For Returned, 0 means not returned and 1 indicates the books have been returned.

Write the following queries in SQL.

(a) Find the StudentIDs of students who don’t return the books on time (Assume today is “23-OCT-20”). (4 points)

(b) Find the Names of students who have borrowed the book "SQL theory" written by “Paul”.  (4 points)

(c) Find the Titles and corresponding Authors of books which have never been borrowed. (4 points)

(d) Find the Names of students who have borrowed every book written by ‘Paul’. (4 points)

Homework Answers

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
You have to create a Library Borrowing System based on the following requirements: When new books...
You have to create a Library Borrowing System based on the following requirements: When new books arrive, these books must be cataloged into the system by a librarian (i.e., entered in the system). Information on a book should include book ID, title, author ID, ISBN, and edition. The system should capture author names so that users can search for an author. The library may carry multiple books by the same author, and an author can have multiple books in the...
Scenario: University Library System Requirements The library contains books and journals as library material. It may...
Scenario: University Library System Requirements The library contains books and journals as library material. It may have several copies of a given book or journal. All library material has an id #, a title and one or more authors. Further the library categorizes all library material as reference-only items or regular items. Referenceonly items can be loaned for 2hrs and can’t be removed from the library. Regular items may be borrowed by any library member for three weeks. Only members...
Aggregation 1. List the following about history books: number of history books, the minimum price, maximum...
Aggregation 1. List the following about history books: number of history books, the minimum price, maximum price, and average sales. The format of output is: "Number" "Min Price" "Max Price" "Average Sale" 2. List the number of books and the average number of pages published by pub_id 01. 3. For each book type, list the the number of books and the average price. Sort the results by the number of books Functions 4. List the name(s) of the publisher(s) that...
Please read the article and answear about questions. Determining the Value of the Business After you...
Please read the article and answear about questions. Determining the Value of the Business After you have completed a thorough and exacting investigation, you need to analyze all the infor- mation you have gathered. This is the time to consult with your business, financial, and legal advis- ers to arrive at an estimate of the value of the business. Outside advisers are impartial and are more likely to see the bad things about the business than are you. You should...