Microsoft Access Database

profilearilem
data_model.docx

1

Logical data model

Is used to describe a data in a detailed way. It contains all entities and relationships among them, specify all attributes for each entity and specify both primary and foreign keys for each entity.

It is where normalization of data is done and help to analyses database.

Key

· Solid red underline is for primary keys

· Dotted blue underline is for foreign keys

First Normal Form (1NF) - Is where a group of information can’t be allowed to repeat itself in two or more rows in a table. Each row must have a unique value. Primary is placed on one column but at times can have many columns. For example:-

Item_id

Customer_name

1

Liz, Caro

2

Ruth

3

Sam

And thus its INF for the above table will be:-

Item_id

Customer_name

1

Liz

1

Caro

2

Ruth

3

Sam

Any row must not have a column with more than one value for example separated by a comma. Then you must separate that data and put them in multiple rows.

This help to increase data redundancy because many columns with same data in multiple rows are created but each row will be unique.

Second Normal Form (2NF)

If is in INF and all of its non-key attributes are fully functional dependent on the primary key.

For example:-

Item_id

Customer_name

Order_total_price

1

Liz

500

2

Caro

800

3

James

75

2NF for the above will be:-

Item_id

Customer_name

1

Liz

2

Caro

3

James

Item_id

Order_total_price

1

500

2

800

3

75

From the 2NF tables above, Order_total_price is fully dependent on the primary key Item_id.

Third Normal Form (3NF) is where a table must be in 2NF and for every non-prime attribute should be dependent on the primary key.

For example:-

Customer_id

Customer_name

Customer_address

Customer_city

Customer_state

Customer_zip

1

Liz

12,

Oslo

Oslo

00100

2

Caro

456,

California

California

00213

3

James

89,

Michigan

Michigan

00457

3NF for the above will be:-

Customer_id

Customer_name

Customer_zip

1

Liz

00100

2

Caro

00213

3

James

00457

Customer_zip

Customer_address

Customer_city

Customer_state

00100

12,

Oslo

Oslo

00213

456,

California

California

00457

89,

Michigan

Michigan

Customer_zip is a transitive dependency but Customer_id is the primary key for the above tables. To apply 3NF Customer_zip becomes the new primary key because it is depended by the address, city and state of a customer and a new table is created for such.

The importance of removing transitive dependency is that data duplication is reduced in a table and data integrity is attained.