You are on page 1of 23

First CA

1. Explain the following terms


a. Conceptual data model
b. Logical data model
c. Physical data model
2. Below is a data model example of school organization)
What type of data model is this
Director

Head of senior Head of junior Head of


secondary secondary primary

Head math Head of English


Head of Teachers
department language
sciences
department
The table below show selected fields
and data types in Microsoft Access

FIELD DATA TYPES  What are the appropriate data


FULL_NAME I types for I,II III, IV and V
MATH_NO II
DATE_OF_Birth III
FEES IV
ADDRESS V
3. use MS-Access to perform the task.
 The table below contains five products sold in a supermarket/provision store.
S/N Products Quantity Unit Amount
Supplied Selling
Price

1 13
2 18
3 20
4 17
5 16

Instructions
i. Start the MS-Access, set the appropriate field width/field size and create the table.
ii. Key/type five goods/products of your choice that can be found in a supermarket/provision store in
your area in the Product column.
iii. Supply the Unit Selling Price within the range N100 to N1000 and calculate the Amount where
Amount = Quantity supplied x Unit Selling Price.
NORMALIZATION
NORMALIZATION
 Normalization can be defined as :-
A process of organizing the data in
database to avoid data redundancy,
insertion anomaly, update anomaly &
deletion anomaly.
Types of normal Forms

1. First Normal Form (1NF)


2.Second Normal Form (2NF)
3.Third Normal Form (3NF)
4.Boyce-Codd Normal Form (BCNF)
5.Fourth Normal Form (4NF)
6.Fifth Normal Form (5NF)
First Normal Form(1NF)
A table is considered to be in 1NF if all the fields contain
only scalar values i.e. contain only atomic values at each row and
column and does not contain a list of values.
Example:
This table is not in first normal
form because the “Colour”
column contains multiple
Values.
After decomposing it into first normal
form it looks like:
PRIMARY KEY,CANDIDATE KEY,FUNCTIONAL
DEPENDENCY, TRANSITIVE DEPENDENCY,

 CANDIDATE KEY
A column or set of columns is called a Candidate Key when its values can
uniquely identify the row in the relation. If the candidate key is just one it is
called the Primary key.
 FUNCTIONAL DEPENDENCY

If one set of attributes in a table determines another set of attributes in the


table, then the second set of attributes is said to be functionally dependent
on the first set of attributes.
 TRANSITIVE DEPENDENCY
 A transitive dependency exist when any attribute in a table is dependent
of any other non-key attribute in that table
EXAMPLES OF FUNCTIONAL DEPENDENCY
 Social Security Number determines employee name
SSN  ENAME
 Project Number determines project name and location
PNUMBER  {PNAME, PLOCATION}
 Employee SSN and project number determines the
hours per week that the employee works on the project
{SSN, PNUMBER}  HOURS
SECOND NORMAL FORM(2NF)
A table is said to be in 2NF if both the following
conditions hold:
1. Table is in 1NF (First normal form).
2. All non-key attributes in the table must be functionally
dependent on the entire primary key

An attribute that is not part of any candidate key is known


as non-key attribute.
EXAMPLE OF TABLE NOT IN 2NF

This table has a composite primary


key i.e. customer id, store id. The
non key attribute is location. In
this case location depends on store
id, which is part of the primary
key.
After decomposing it into second normal
form it looks like:
Third Normal Form (3NF)
A table design is said to be in 3NF if both the following conditions hold:
1. Table must be in 2NF:
2. No attribute is transitively dependent on the primary key

An attribute that is not part of any candidate key is known as non-prime


attribute.

In other words 3NF can be explained like this: A table is in 3NF if it is in 2NF
and for each functional dependency X-> Y at least one of the following
conditions hold:
1. X is a super key of table
2. Y is a prime attribute of table
An attribute that is a part of one of the candidate keys is known as prime
attribute.
THIRD NORMAL FORM
After decomposing it into third normal
form it looks like:
Example: First Normal Form
(1NF)
A table is considered to be in 1NF if all the fields contain
only scalar values (as opposed to list of values).
Example (Not 1NF)
ISBN Title AuName AuPhone PubName PubPhone Price

0-321-32132-1 Balloon Sleepy, 321-321-1111, Small House 714-000-0000 $34.00


Snoopy, 232-234-1234,
Grumpy 665-235-6532

0-55-123456-9 Main Street Jones, 123-333-3333, Small House 714-000-0000 $22.95


Smith 654-223-3455
0-123-45678-0 Ulysses Joyce 666-666-6666 Alpha Press 999-999-9999 $34.00

1-22-233700-0 Visual Roman 444-444-4444 Big House 123-456-7890 $25.00


Basic

Author and AuPhone columns are not scalar


1NF - Decomposition
1. Place all items that appear in the repeating group in a new table
2. Designate a primary key for each new table produced.
3. Duplicate in the new table the primary key of the table from which the repeating group was
extracted or vice versa.
Example (1NF)

ISBN AuName AuPhone

0-321-32132-1 Sleepy 321-321-1111

ISBN Title PubName PubPhone Price 0-321-32132-1 Snoopy 232-234-1234

0-321-32132-1 Balloon Small House 714-000-0000 $34.00 0-321-32132-1 Grumpy 665-235-6532

0-55-123456-9 Main Street Small House 714-000-0000 $22.95 0-55-123456-9 Jones 123-333-3333

0-123-45678-0 Ulysses Alpha Press 999-999-9999 $34.00 0-55-123456-9 Smith 654-223-3455

1-22-233700-0 Visual Big House 123-456-7890 $25.00 0-123-45678-0 Joyce 666-666-6666


Basic
1-22-233700-0 Roman 444-444-4444
CLASSWORK

This is an unnormalized table. Convert the table to FIRST NORMAL,

STUDENTS ADVISOR ADVISOR ROOM CLASS


1022 JONES 101-107 ICT, TD, FOOD
AND NUT
1024 BILL 102-108 BIOLOGY LAB,
CHEMISTRY LAB

You might also like