Académique Documents
Professionnel Documents
Culture Documents
TABLE NAME
A relational database organizes data
FIELD 1
in tables.
FIELD 2
FIELD 3 A table is made up of rows and
TABLE NAME 2
FIELD 1
columns.
FIELD 2
FIELD 3
DATABASE DESIGN objectives
PERSON
Name
Lastname
Phone
Email
system analysis
conversion of ERD to relational db
simple entity-attribute
Identify the primary/other keys.
Primary Keys = PK or *
Foreign Key = FK
PERSON PERSON
Name Person Number *
Lastname Name
Phone Lastname
Email Phone
Email
system analysis
conversion of ERD to relational db
multi-valued attributes
Ifyou have a multi-valued attribute, take the
attribute and turn it into a new entity or
table of its own.
Then make a 1:N relationship between the
new entity and the existing one.
system analysis
conversion of ERD to relational db
multi-valued attributes
1. Create a table for the attribute. Country Code
Area Code
PERSON PHONE
Name Country Code
Area Code
system analysis
conversion of ERD to relational db
multi-valued attributes
1. Create a table for the attribute.
PERSON PHONE
Person Number* Phone ID*
Name Country Code
Area Code
system analysis
conversion of ERD to relational db
multi-valued attributes
2. Add the primary (id) column of the parent
entity as a foreign key within the new table
PERSON PHONE
Person Number* Phone ID*
Name Person Number FK
Country Code
Area Code
system analysis
conversion of ERD to relational db
1:1 relationship
Make tables for each entities and set the
foreign key to the table where the other table
is depending/connecting to.
system analysis
conversion of ERD to relational db
1:1 relationship
PERSON WIFE
Name Name
Lastname
Phone
Email
system analysis
conversion of ERD to relational db
1:1 relationship
PERSON WIFE
Person Number * Wife Number *
Name Name
Lastname
Phone
Email
Wife Number FK
PERSON HOUSE
Name House Number
Lastname Address
Phone
Email
system analysis
conversion of ERD to relational db
1:N relationshipsPERSON HOUSE
Person Number* House Number*
Name Address
Lastname Person NumberFK
Phone
Email
PERSON COUNTRY
Name Country Num
Lastname Address
Phone
Email
system analysis
conversion of ERD to relational db
N:N relationships
PERSON COUNTRY
Person Number* Country Number*
Name Address
Lastname
Person-Country
Person-CountryID*
Person NumberFK
Country NumberFK
1. Gather the data that are needed to be
stored in the database.
2. Divide the data into subject-based tables.
3. Choose one column (or a few columns) as
the so-called primary key, which
uniquely identify the each of the rows.
* PK
FK
The column teacherID in the child table Classes is known as the foreign
key. A foreign key of a child table is a primary key of a parent table, used
to reference the parent table.
STUDENT SUBJECT
Name Name
Age Subject