As a complement to the list of tables and the database schema, let's see our tables in action! We will enter sample values into the tables, and then build some SQL queries in order to pull the needed data.
We use the sample values described in the above list of tables. Please refer to this book's support site (http://www.packtpub.com/support) for the code download which contains the tables' definition and sample values.
A passenger can print his or her boarding pass while at home by using the website's quick reference for his or her reservation, which is KARTYU
in our example. Here is the generated query to retrieve the boarding pass information:
select passenger.last_name, passenger.first_name, flight.number, airline.description, flight.departure_moment, flight.departure_gate, flight.boarding_moment, reservation.seat, plane_section.description from reservation inner join passenger on reservation.passenger_id = passenger.id inner join flight...