Write a query to display the patron ID, first and last name of all patrons that have never checked out any book. Sort the result by patron last name and then first name. (See the figure below for the...



  1. Write a query to display the patron ID, first and last name of all patrons that have never checked out any book. Sort the result by patron last name and then first name. (See the figure below for the output)

  2. Write a query to display the patron ID and the average number of days that patron keeps books during a checkout. Limit the results to only patrons who have at least three checkouts.  Sort the results in descending order by the average days the book is kept. (See the figure below for the output)


PAT ID Average Days Kept<br>1160<br>7<br>1185<br>6.67<br>1165<br>5.67<br>1207<br>5.5<br>1209<br>5.33<br>1172<br>4.5<br>1183<br>4.33<br>1181<br>3.67<br>1171<br>3.67<br>1161<br>3.33<br>1210<br>2.33<br>1229<br>2<br>

Extracted text: PAT ID Average Days Kept 1160 7 1185 6.67 1165 5.67 1207 5.5 1209 5.33 1172 4.5 1183 4.33 1181 3.67 1171 3.67 1161 3.33 1210 2.33 1229 2
PAT ID PAT_FNAME PAT LNAME<br>1166 Vera<br>Alvarado<br>1180 Nadine<br>Blair<br>1238 Erika<br>Bowen<br>1208 Ollie<br>Cantrell<br>1227 Alicia<br>Dickson<br>1205 Claire<br>Gomez<br>1239 Elton<br>Irwin<br>1240 Jan<br>Joyce<br>Kennedy<br>King<br>1243 Roberto<br>1242 Mario<br>1237 Brandi<br>Larson<br>1167 Alan<br>Martin<br>1182 Jamal<br>Melendez<br>1201 Shelby<br>Noble<br>1244 Leon<br>Richmond<br>1200 Lorenzo<br>Torres<br>1241 Irene<br>West<br>

Extracted text: PAT ID PAT_FNAME PAT LNAME 1166 Vera Alvarado 1180 Nadine Blair 1238 Erika Bowen 1208 Ollie Cantrell 1227 Alicia Dickson 1205 Claire Gomez 1239 Elton Irwin 1240 Jan Joyce Kennedy King 1243 Roberto 1242 Mario 1237 Brandi Larson 1167 Alan Martin 1182 Jamal Melendez 1201 Shelby Noble 1244 Leon Richmond 1200 Lorenzo Torres 1241 Irene West

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here