Lesson2 Relational Model Data Types Normalization
Lesson2 Relational Model Data Types Normalization
Information Management
LESSON2
Relational Model,
Data Types & Normalization
Learning Outcomes:
1. Demonstrate a thorough understanding of
a relational data model
2. Explain the different relational keys
3. Explain the use and importance of integrity
constraints
4. Enumerate the different data types used in
Microsoft Access
5. Apply the concept of normalization and its
importance in database design
6. Create fully normalized relations
Relational Data Model
Data Model – a collection of concepts that can be used
to describe a set of data, the operations to manipulate
the data, and a set of integrity rules for the data
Represent data in the form of tables
A named, two-dimensional table is called a
relation
Each relation consists of named columns and
an arbitrary number of unnamed rows
A named column is called an attribute
Each row of a relation corresponds to a record
that contains data
Properties of a Relation
Ithas a unique name
No multivalued attributes are allowed
in a relation
Each row is unique
Each attribute has a unique name
The sequence of columns as well as of
rows is insignificant
Classification of Attributes
Required vs. Optional Attributes
Required – must have a value
Optional – may not have a value
Simple vs. Composite Attributes
expressions.
Whether the field can be indexed.
A field's data type can be predefined or you will
select a data type depending on how you create
the new field. For example, if you create a field
from the Datasheet view and:
Use an existing field from another table, the data
Number, Large Number Numeric values, such as distances. Note that there
is a separate data type for currency.
Percentage Percentages.
Scientific Calculations.
Date and Time
Format Use to display
Short Date Display the date in a short format. Depends on your
regional date and time settings. For example,
3/14/2001 for USA.
Medium Date Display the date in medium format. For example, 3-
Apr-09 for USA.
Long Date Display the date in a long format. Depends on you're
the regional date and time settings. For example,
Wednesday, March 14, 2001 for USA.
Time am/pm Display the time only using a 12 hour format that will
respond to changes in the regional date and time
settings.
Medium Time Display the time followed by AM/PM.
Time 24hour Display the time only using a 24 hour format that will
respond to changes in the regional date and time
settings
Yes/No
After you create a field and set its data type, you can
set additional field properties. The field's data type
determines which other properties that you can set. For
example, you can control the size of a Text field by
setting its Field Size property.
Identical rows
Solution- Add an order ID as a primary key
Multiple Values
Solution: Create a separate table
with order items
OrderId Customer Name OrderId Item
1 Coke
3 Christian Jay
Sarmiento 2 Nuggets
2 Lemonade
2 Fries
3 Burger
3 Fries
3 Coke
Problem 3- All data must be atomic
(non divisible) – can’t be split down
further)
Orde Customer Name OrderId Item
rId
1 Burger
1 Marygin Sarmiento
1 Fries
2 Sammy Sarmiento
1 Coke
3 Christian Jay Sarmiento
2 Nuggets
2 Lemonade
2 Fries
3 Burger
3 Fries
3 Coke
Solution:
2 Fries
3 Burger
3 Fries
3 Coke
2ND NORMAL FORM
2 3 750
3 5 1000
3 3 750
Example – No Partial Dependency
Student Courses Course Fees
1 2 1 500
2 1 2 1000
2 3 4 200
3 5 3 750
3 3 5 1000
3 750
3rd NORMAL FORM
Composite Key
Tournament Year Winner Winner Date of Birth
Name
Indiana 199 Al Al Fredrickson 21 July 1975
Invitational 8 Fredrickson
Cleveland 199 Bob Bob Abertson 28 September