Designing Databases
Relationships between tables are the key to a well-designed database. In a one-to-many relationship:
- The primary table includes a field that contains unique data for each record in that table. This is the primary or key field.
- The secondary table (the "many" part of the relationship) has a field that contains the same information, but in the secondary table, many records can have the same information in this field.
In a relational database, tables are related to one another through links defined by common fields between tables. One-to-many relationships are the most common. In a one-to-many relationship, the primary table contains a key field that is included as a field (the foreign key) in the secondary table. Thus, one record in the first table can relate to many records in the second table. Defining the relationships between the tables is the key to designing a useful database.