by wild_egg · 2y ago · 0 comments
SELECT
t.passenger_name,
t.ticket_no,
bp.seat_no
FROM Flights f
JOIN Ticket_flights tf USING (flight_id),
JOIN Tickets t USING (ticket_no),
JOIN Boarding_pass bp USING (ticket_no, flight_id)
WHERE f.arrival_airport = 'OVB';That's why it's not a bad idea to include the table name in the id column name: `flight.flight_id` instead of `flight.id`.
But yes, `USING` is convenient and pleasant to the eyes.
Works great in MySQL, PostgreSQL, and SQLite though.