Lecture

List Passengers with No Reservations

Your supervisor wants to reach out to customers who haven't booked a flight yet, possibly to send a promotion or reminder.

To help with this, you need to find passengers in the database who don't have any reservations on record.

This is a classic use case for LEFT JOIN combined with IS NULL, allowing you to find rows in one table that lack a match in another.


What to Show

From the flight_reservations.sqlite database, return:

  • name (from the passengers table)

Use a LEFT JOIN between passengers and reservations, and filter for rows where the reservation_id is NULL.


Instructions

Write a SQL query that joins passengers to reservations using LEFT JOIN.

Then filter for passengers who have no reservations by checking for NULL in the reservation_id column.

sqlQuiz
?

Lecture

AI Tutor

Design

Upload

Notes

Favorites

Help

Code Editor

Run
Generate

Tables

Execution Result