In the last two chapters you learned how to create a basic database and connect it to a PHP program. PHP and MySQL are wonderful for working with basic databases. However, most real-world problems involve data that is too complex to fit in one table. Database designers have developed some standard techniques for handling complex data that reduce redundancy, improve efficiency, and provide flexibility. In this chapter you will learn how to use the relational model to build complex databases involving multiple entities. Specifically, you will learn:
How the relational model works.
How to build use-case models for predicting data usage.
How to construct entity-relationship diagrams to model your data.
How to build multi-table databases.
How joins are used to connect tables.
How to build a link table to model many-to-many relationships.
How to optimize your table design for later programming.