Database Reference
In-Depth Information
Appendix B
The Example Tables
Writing SQL statements requires a good understanding of the underlying data-
base design. Without knowing what information is stored in what table, how
tables are related to each other, and the actual breakup of data within a row, it
is impossible to write effective SQL.
You are strongly advised to actually try every example in every chapter in this
book. All the chapters use a common set of data files. To assist you in better
understanding the examples and to enable you to follow along with the chap-
ters, this appendix describes the tables used, their relationships, and how to
obtain them.
Understanding the Sample Tables
The tables used throughout this topic are part of an order entry system used by
an imaginary distributor of paraphernalia that might be needed by your favorite
cartoon characters (yes, cartoon characters; no one said that learning MariaDB
needed to be boring). The tables are used to perform several tasks:
Manage vendors
Manage product catalogs
Manage customer lists
Enter customer orders
Making this all work requires six tables that are closely interconnected as part
of a relational database design. A description of each of the tables appears in the
following sections.
Note
Simplified Examples The tables used here are by no means complete. A real-world
order entry system would have to keep track of a lot of other data that has not been
included here (for example, payment and accounting information, shipment tracking, and
more). However, these tables do demonstrate the kinds of data organization and rela-
tionships you will encounter in most real installations. You can apply these techniques
and technologies to your own databases.
 
 
 
Search WWH ::




Custom Search