Question: There are 6 tables created with data 1 . Book 2 . Borrower 3 . Cat 4 . Copies 5 . Loan 6 . Publisher
There are tables created with data
Book
Borrower
Cat
Copies
Loan
Publisher
Task Questions:
Some books have not been borrowedloaned at all. Write a query to list such books with details such as book id ISBN, title, number of copies. Sort them by title. rows of output
Write a query to retrieve the name and the total number of loans per borrower. The output should be sorted by the borrower's name. rows of output
Write a query to find out which books have the greatest number of copies. The output should display books titles and ittheir number of copies. row of output
Write a query to retrieve book's titles, number of copies and publisher's names. The result should be sorted by the publishers name, then by number of copies and then by books title. rows of output
Write a query to retrieve the name, phone, and postcode of borrowers who are students and live in a suburb with postcode less than sort by postcode. rows of output
Write a query to find out what books have SQL in their titles. The query should output book's titles, book's isbn, publishers ids and publisher's names. Sort the results by title. rows of output
For copies that were loaned, write a query using RIGHT JOIN to list the number of times that each copy was loaned out. Sort them in order of copyid rows of output
Write a query to create a new table NEW and with columns COPYID BOOKID BOOKTITLE The new table should contain a list of the all the copies with the book details such as bookid and booktitle. So copy the required data from COPIES and BOOK tables. rows
Write a SQL statement to insert one new loan record as follows:
Loanid:
Borrowerid:
Copyid:
Borrowed date: Current date
Due date: days later
Returned date: Null
Write a SQL statement to delete loanid from the loan table.
Write an update statement to extend the due date of all overdue loans for more days from today. Use curdate function. Indicate how many rows were updated by the query.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
