You are on page 1of 12

Designing Database Tables

Outline
• Choosing Foreign Key • Design Code
or Relationship Entity • Table
• Physical Database • Database design
Design Model activities
• Symbols in Database
design Model
• Example of Physical
Database Design
Model
Choosing Foreign Key or
Relationship Entity
• Based on Relationship Type
One to One Both side Obligatory Combine the entity
Relationship Foreign Key
One side Obligatory
No side Obligatory Relationship Entity
Many side Foreign Key
One to Many Obligatory
Relationship Many side is not Relationship
Obligatory Entity

Many to Many
Relationship Always use Relationship Entity
Physical Database Design Model

Represent all tables and indexes


needed

Table = data
Index = the sequence of data in the table to be
retrieved or used
Symbols for physical database
design model
= Entity/table

= Connective line

= Foreign Key

= Index
The Next Physical Model is based on the following
A Conceptual E-R Model

O1
Customer 1O Customer Accts
Have
1

For

M
O
M M Inventory
Invoice Contain

E-R Model : Sales and Inventory Control System


An Example of physical database
design model
Customer

Invoice Invoice details Inventory

E-R Model : Sales and Inventory Control System


Code Designing
Code Designing Principles

• Is needed if there is not an unique attribute


to be assigned as identifier
• As sort as possible
• Not use to save the data but as identifier
Tables Designing
To keep all table in normal form
• Make sure that there is not repeating group
and in full determinancy condition
• And there is no virtual field
To keep tables in normal form
• Based on physical database model
• Do not duplicate other data (field) available
on other table
• Do not store any data that can be calculated
or retrieve from other field
Database design activities
• study the system to get facts and rules
• Identify the entity
• Identify the relationship
• Draw the E-R Model
• Convert the E-R Model to Physical database
design model
• Design tables

You might also like