Chapter 7. Multiple Tables and Relationships
Up until now, you’ve been working with the simplest kind of database imaginable—it has just one table. In the real world, one table is almost never enough. In your private investigator business, for example, you probably need to keep track of more than just people. You need to record the time you spend working for your customers, the invoices you send them, and the payments you receive.
You can certainly create a separate database for each of these needs. But that’s far from ideal, since you don’t use each kind of information in isolation. You need all these different kinds of information to work in harmony, like a well-rehearsed orchestra. In database terms, what you need is a single, integrated file that keeps all your various lists, files, and records in one place, so you can arrange and rearrange them according to your needs—a relational database.
Relational Databases Explained
Before you dive head first into relational databases, it will be helpful to review some vocabulary. First, a database is a collection of tables, layouts, and other things that forms an organized system. A table holds information about one kind of thing, like people, orders, products, or suppliers. A field holds one attribute of something: the person’s first name, the order date, the color of a product, or the supplier’s address. (An attribute simply means an individual characteristic. For example, a bicycle might have several attributes: Color, Height, Style, ...