Question: write queries for the following: 8. Do some date arithmetic: For each entry in CHECKOUT, calculate the number of days ago (from today) that the

write queries for the following:

write queries for the following: 8. Do some date

write queries for the following: 8. Do some date

write queries for the following: 8. Do some date

8. Do some date arithmetic: For each entry in CHECKOUT, calculate the number of days ago (from today) that the book was checked out. MySQL . has a builtin variable CURRENT_DATE and a function DATEDIFF that returns the difference of two dates, in days. 11. For each patron who has any not-yet- returned books, list the patron's name and the total late fee for all their not-yet-returned books. One row per naughty patron, please, and sorted with the naughtiest patrons first. You will need to do a join, as well as a group-by with sum. 12. Repeat, except that you want a report for all patrons (listed in order of their last names), including those who don't have any late fees for not-yet-returned books. Some can be listed as having a late fee of 0 or null. You will need to modify your query to use an outer join. Chapter 7 Introduction to Structured Ouery Language IGURE P7.56 THE CHO7 FACTERD CHECKOUT PK Check Num PATRON FK1 Book Num FK2 Pat_ID PK Pat ID ---- Pat FName Pat_LName Pat_Type Check_Out Date Check Due Date Check_in_Date BOOK AUTHOR PK Book Num PK Au ID Book Title Book_Year Book_Cost Book_Subject FK1 Pat_ID Au_FName u Nana Au_Birth Year WRITES PK,FK1 Book Num PK,FK2 AU ID every

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 General Management Questions!