Question: Using SQL, count how many classes each customer has signed up for. Show the customers last name, first name, and number of classes. Use an

Using SQL, count how many classes each customer has signed up for. Show the customer’s last name, first name, and number of classes. Use an appropriate JOIN.

a. SELECT LastName, FirstName, Count(ReservationID) AS [Number of Classes]

FROM Customers INNER JOIN Reservations ON CustomerID = CustomerID GROUP BY LastName, FirstName;

b. SELECT LastName, FirstName, Count(ReservationID) AS [Number of Classes]

FROM Customers INNER JOIN Reservations ON Customers.CustomerID = Reservations.

CustomerID GROUP BY LastName, FirstName;

c. SELECT LastName, FirstName, Count(ReservationID) AS [Number of Classes]

FROM Customers INNER JOIN Reservations ON Customers.CustomerID = Reservations.

CustomerID;

d. SELECT LastName, FirstName, Count(ReservationID) AS [Number of Classes]

FROM Customers OUTER JOIN Reservations ON Customers.CustomerID = Reservations.

CustomerID GROUP BY LastName, FirstName;InstructoriD InstructorLastName InstructorFirstName InstructorStreetAddress Instructor City InstructorState

InstructoriD InstructorLastName InstructorFirstName InstructorStreetAddress Instructor City InstructorState InstructorZipCode InstructorEmail Address Pittsburgh Pittsburgh Pittsburgh Pittsburgh Pittsburgh Pittsburgh Pittsburgh Pittsburgh Pittsburgh Pittsburgh JV01 LL01 MA01 MD01 MK01 MS01 NT01 RS01 RS02 VP01 Varlano Lane Nguyen D'Angelo Kobinski Said Tahan Stein Sisto Pegues Juan Luke Michael Maria Megan Memo Neda Raymond Robert Vicki 15A Penn Ave 2661 Butler St 2367 Barn Way 245D Wylle Ave 9087 Monanca Pl 45 Webster Ave 4588 Penn Ave 3254 Forward Ave 2836 Maryland Ave 3700 Murray Ave PA PA PA PA PA PA PA PA PA PA 15219 15201 15219 15219 15219 15219 15219 15217 15232 15217 InstructorPhoneNumber Juan Varlano@cengage.com 412-998-6534 561-868-5257 MichaelNguyen@cengage.com | 951-790-6275 LukeCLane@cengage.com MariaDAngelo@cengage.com 724-887-2835 MeganKobinski@cengage.com 878-653-7364 412-764-9834 417-359-2241 RaymondStein@cengage.com 269-345-0803 RobertJSisto@cengage.com 646-373-8125 VickiJPegues@cengage.com 678-597-0247 MemoSaid@cengage.com NedaTahan@cengage.com

Step by Step Solution

3.40 Rating (150 Votes )

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 Concepts Of Database Management Questions!