Week 3 Flashcards
(16 cards)
What is an association?
It’s a relationship between tables or classes that are related to each other
How do you represent a relationship between tables
You must use PKEY and Foreign Keys in the tables
What is a foreign key
They are used to provide association between tables
On what side does the Foreign Key go on
It goes on the many side.
What is normalization?
A set of guidelines for breaking tables apart in Sub-Tables while building relationships that relate the data correctly
Why use normalization
It’s used to eliminate/reduce redundant data and reduce potential errors
What is denormalization? And why do it
It’s when you rebuild your tables into a concentrated table.
This will increase performance or make the data more readable
What is the 1st normal form?
- Each table should have a primary key
- No repeating groups of
information/values within a single table - Each attribute has a single value
What is the 3rd normal form?
- Must be in 1st and 2nd normal forms
- Remove any columns that are not dependent on the primary key
What do we usually not normalize?
- Names and address information
- Numbers
- Dates
What is multiplicity
We use the name to describe the type of relationships between tables
What are the three types of relationships in a table
- One to Many
- Many to Many
- One to One
What does a many to many relationship require
A join/junction table
What does a junction table typically contain?
- One primary key
- Two foreign Keys
When would you use a one to one relationship
Let’s say you’re a frequent flyer. You get a frequent flyer number associated to you. This number is unique and you may only have one
What is referential integrity?
It only allows existing data in the foreign key values to be presented in a table.