Question: Write a query to display the patron ID, book number, and days kept for each checkout. Days Kept is the difference from the date on

Write a query to display the patron ID, book number, and days kept for each checkout. “Days Kept” is the difference from the date on which the book is returned to the date it was checked out. Sort the results by days kept in descending order, then by patron ID, and then by book number (Figure P7.87). 

Figure P7.87 Days Kept PATRON BOOK Days Kept 1160 5240 1160 5240 1165 5235 1183 5236 1184 5240 1185 5240 1202

Figure P7.87 Days Kept PATRON BOOK Days Kept 1160 5240 1160 5240 1165 5235 1183 5236 1184 5240 1185 5240 1202 5236 1203 5235 1204 5236 1207 5242 1209 5235 9 9 9 8 8 8 8 8 8 8 8

Step by Step Solution

3.42 Rating (152 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here is an SQL query to display the patron ID book number and days kept for e... View full answer

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 Database Systems Design Implementation Questions!