Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Loans ID Animal ID Zoo ID Date Borrowed 1 48 6 3/12/2011 2 71 6 2/11/2011 3 45 7

ID: 3908653 • Letter: L

Question

Loans ID Animal ID Zoo ID Date Borrowed 1 48 6 3/12/2011 2 71 6 2/11/2011 3 45 7 2/4/2010 4 32 6 3/24/2011 5 71 2 3/10/2011 6 16 9 5/18/2011 7 18 2 3/13/2010 8 64 8 8/26/2011 9 63 2 7/7/2010 10 25 3 1/29/2011 11 27 1 2/12/2010 12 21 4 4/13/2010 13 18 3 12/1/2010 14 55 4 3/3/2010 15 34 9 12/19/2010 16 31 10 6/27/2010 17 61 5 10/8/2011 18 23 1 4/16/2011 19 3 7 6/5/2011 20 54 5 5/30/2010 21 16 7 12/9/2010 22 5 9 10/1/2011 23 59 4 9/10/2011 24 70 5 1/9/2011 25 38 4 1/28/2010 26 15 8 2/10/2010 27 52 9 6/22/2010 28 70 8 3/30/2010 29 56 6 9/30/2010 30 11 5 8/18/2010 31 14 3 5/31/2011 32 49 9 12/30/2010 33 70 1 1/10/2010 34 57 6 5/12/2011 35 63 2 6/29/2010 36 56 2 12/18/2010 37 36 2 10/22/2011 38 51 8 7/26/2011 39 24 9 1/31/2010 40 62 3 8/4/2010 41 65 8 3/27/2011 42 55 1 1/27/2011 43 55 4 11/19/2010 44 43 1 1/22/2011 45 63 4 10/28/2011 46 53 5 12/6/2010 47 54 8 4/2/2010 48 47 6 6/8/2011 49 62 3 3/31/2011 50 56 1 5/11/2010 51 45 3 1/3/2011 52 41 4 11/4/2010 53 55 5 8/2/2011 54 63 10 4/17/2010 55 9 2 4/21/2011 56 19 2 12/6/2009 57 24 8 2/19/2011 58 15 10 1/26/2010 59 59 6 3/17/2010 60 1 4 6/17/2010 61 57 2 12/26/2010 62 40 9 2/2/2010 63 67 1 10/12/2010 64 19 10 5/23/2010 65 40 5 10/29/2011 66 35 10 4/5/2010 67 4 7 2/2/2010 68 27 2 9/16/2010 69 55 7 11/20/2010 70 1 6 12/18/2010 71 60 1 2/20/2010 72 20 7 4/7/2010 73 71 2 5/25/2010 74 3 10 2/28/2010 75 16 7 4/17/2011 76 69 8 9/22/2011 77 13 2 2/28/2010 78 24 6 4/30/2011 79 33 8 3/11/2011 80 38 5 7/23/2010 81 52 9 3/21/2010 82 43 7 9/5/2010 83 27 4 5/20/2010 84 43 2 2/12/2011 85 61 3 2/16/2011 86 41 9 12/29/2010 87 56 3 1/9/2011 88 50 8 10/15/2010 89 31 8 10/16/2011 90 28 9 9/26/2011 91 24 4 6/6/2011 92 17 3 5/3/2010 93 69 8 8/27/2010 94 16 7 5/14/2011 95 52 3 1/10/2011 96 64 2 12/4/2009 97 11 5 8/31/2010 98 11 7 8/8/2010 99 11 9 2/5/2010 100 24 6 3/3/2011 Query 6 Create a query called Zoo with Most Loans. Display headings for Zoo Name and Number of Animals on Loan. Sort the output to show the zoo with the most animals on loan first. Your data will differ, but the output should resemble that in Figure 5-8. Zoo with Most Loans Number of Animals on Loan Zoo Name San Diego Zoo Great Plains Zoo Detroit Zoo Topeka Zoo Pittsburgh Zoo National Zoo Bronx Zoo Seneca Park Zoo Hogle Zoo Zoo New Englan 14 12 10 10 10 10 6 FIGURE 5-8 Zoo with Most Loans query

Explanation / Answer

Query called Zoo with Most Loans

Answer)

ZooName table is missing.

Let that table be Zoo (ZooID, ZooName);

select zoo.ZooName as 'Zoo Name', count(Loans.ZooID) as 'Number of Animals on Loan'

from zoo inner join Loans on

zoo.ZooID=Loans.ZooID

group by Loans.ZooID

order by count(Loans.ZooID) desc;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote