You are on page 1of 39

unique number, identifier, used to have a specific record

specific id’s to identify subject


Foreign Key

Relationships: Primary Key (Master Table)


- Use primary key (unique) as an
identifier for multiple foreign
keys
- Foreign Key references a
Primary Key on another table
- Primary key (single-use);
foreign key (multiple-use)
- Foreign key edits must match
the primary key

Foreign Key
Primary Key (Unique):
- StudentNumber
- AdviserName
- DeptName
Entities:
- Students
- Adviser
- Email
- Department
- Office_Visit
(Parking Spot Reservation, Car Owner)

(1 Customer -> Many Orders)

(Students -> Class)


Restrictions = Meta Data

- 9 Digits
- Digits only
- no characters

10 digits
@sfu.ca
Relationship:
Customer:
- Customer -> Sale Transaction (1 to many - vertical)
- Customer ID
- Sale Transaction -> Customer (many to 1 - circle)
- First name
- Employee -> Sale Transaction (1 to many - vertical)
- Last name
- Sale Transaction -> Employee (many to 1 - circle)
- Phone number
- Product -> Sale Transaction (many to many - horizontal)
- Email address
- Sale Transaction -> Product (many to many - circle)
- Department -> Product (1 to many - vertical)
- Department -> Employee (1 to many - horizontal)
Come up with a way to create ecquiries

You might also like