Professional Documents
Culture Documents
373 – Data Processing
Luis Guzman, University of Michigan 1
IOE 373 – Data Processing
One-to-Many Example 1
A one-to-many relationship between two Cars and Manufacturers
tables A and B means that Every car model is made by one manufacturer:
one record in table A can be related to many Civic—Honda
records in table B, but Focus—Ford
Each record in table B can only be related to one Sonata—Hyundai
record in table A. However, most manufacturers make more than
one car model:
Honda: Civic, Accord, Fit, etc.
Ford: Focus, Fiesta, Mustang, Fusion, etc.
Luis Guzman, University of Michigan 2
IOE 373 – Data Processing
Partial Tables
Linking the tables; one-to-many
Design Views We add a ManufacturerID field to the Models table:
Luis Guzman, University of Michigan 3
IOE 373 – Data Processing
Luis Guzman, University of Michigan 4
IOE 373 – Data Processing
Representing One-to-Many
One-to-Many Relationships - Recap
Luis Guzman, University of Michigan 5
IOE 373 – Data Processing
Luis Guzman, University of Michigan 6
IOE 373 – Data Processing
Luis Guzman, University of Michigan 7
IOE 373 – Data Processing
Luis Guzman, University of Michigan 8
IOE 373 – Data Processing
Luis Guzman, University of Michigan 9
IOE 373 – Data Processing
Things to know:
Things to know:
Occurs when you can make a statement like this: “Each Occurs when you can make a statement like this: “Each Product
Department can have more than one employee, but each may be available from more than one supplier, and a supplier
employee can be in at most one department.” may provide more than one product.”
Requires intersection table (like ProductSuppliers above)
Requires a foreign key field to be added to the table on Primary key of intersection table is always compound and always
the “many” side. includes the full primary keys of the two entity tables (Products,
The foreign key field links to the primary key of the table Suppliers)
The intersection table may also contain data that applies
on the “one” side.
specifically to the intersection, such as Price above (different
suppliers may have different prices for products).
Luis Guzman, University of Michigan 10
IOE 373 – Data Processing
Appendix
21 22
Luis Guzman, University of Michigan 11
IOE 373 – Data Processing
23
Luis Guzman, University of Michigan 12