Mapping and Normalization
Mapping and Normalization
Mapping and Normalization
systems
Mapping from logical to physical
Table Diagram
Relatioship mapping
One- many
Recursive one-many
Many-many
One-one
Barred
Arcs
Supertype and suptypes
One- many
The foreign key is place on the many side of the relatioship
SUPLLIER PRODUCT
#Sup_ID #Product_ID
*Sup_name *Product_name
SUPPLLIER PRODUCTS
S
Key type Optionality Column name Key type Optionality Column name
PK * SUP_ID PK * Product_ID
* SUP_NAME * Product_name
FK * SUP_ID
Recursive one-many
EMLOYEE
#emp_ID
*EMP_name
EMPLOYEE
SKey type Optionality Column name
PK * Emp_ID
* EMP_name
FK * MNG_ID
Many-to-many
CRITICS MOVIES
#critic_ID #MOVIE_ID
*MOVIE_name
Intersection entity
CRITICS MOVIES
#critic_ID #MOVIE_ID
*MOVIE_name
STUDENT BAG
#Bag_ID
#S_ID
STUDENTS BAGS
Key type Optionality Column Key type Optionality Column
name name
PK * S_ID PK * BAG_ID
FK o B_ID
barred
ACCOUNT BANK
#account_ID #bank_ID
*bank_name
BANKS
Key type Optionality Column Key type Optionality Column
name name
PK * Account_ID PK * Bank_ID
PK,FK * Bank_ID * Bank_name
ARCS Key type Optionality Column
name
PK * id
* name
* Contact
name
MAPPING
single table
two table
Single table
Key type Optionality Column
name
PK * id
* First name
* Last name
o salary
o Hourly rate
* type
FK1 o Agn_id
FK2 o Dep_id
FK3 o Mng_id
Two table
SHIRTS
SHOES
Key type Optionality Column name Key type Optionality Column name
* Sleeve length * size
* Neck size * Buckle style
o Collar style o Heel height
PK * id PK * id
* material * material
Fk1 o Taylor_id FK1 o Cob_id
FK2 o Manu_id FK2 o Manu_ID
Normalization
1 st 2nd 3 rd
No partial No transitive
No multi-value dependency dependency
In the following table the primary key is composed of vihcle_ID and manufacturer_ID, Vihcle_model depends on
vihcle_ID, is the table in the second normal form, if not bring it to the second nomal form
ANSWER: No, there is a partial dependecy(functional dependency) therefore the table is not in the second form
Vihcle_ID Manufacturer_ID
Person_ID BMI
BMI Is_overweight
In the following table the primary key is book_id, the attributr nationality depends on the
book_author, is the table in the second normal form?
ANSWER: yes, it is in the second normal form, because there’s no partial
dependency(functional dependency)