Using SQL, list the classes that do not have a reservation. Show the class name, location, and
Question:
Using SQL, list the classes that do not have a reservation. Show the class name, location, and reservation ID (which will be blank).
a. SELECT Classes.ClassName, Classes.Location, Reservations.ReservationID FROM Classes RIGHT JOIN Reservations ON Classes.ClassID = Reservations.ClassID WHERE Reservations.ReservationID Is Null;
b. SELECT Classes.ClassName, Classes.Location, Reservations.ReservationID FROM Classes OUTER JOIN Reservations ON Classes.ClassID = Reservations.ClassID WHERE Reservations.ReservationID Is Null;
c. SELECT Classes.ClassName, Classes.Location, Reservations.ReservationID FROM Classes LEFT JOIN Reservations ON Classes.ClassID = Reservations.ClassID WHERE Reservations.ReservationID Is Null;
d. SELECT Classes.ClassName, Classes.Location, Reservations.ReservationID FROM Classes LEFT JOIN Reservations ON Classes.ClassID = Reservations.ClassID WHERE Reservations.ReservationID;
Step by Step Answer:
Concepts Of Database Management
ISBN: 9780357422083
10th Edition
Authors: Lisa Friedrichsen, Lisa Ruffolo, Ellen Monk, Joy L. Starks, Philip J. Pratt