Sample Queries

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.

Inserting Sample Values

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.

Boarding Pass

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, ...

Get Creating your MySQL Database: Practical Design Tips and Techniques now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.