Professional Documents
Culture Documents
Database Concepts
Lecture 03
Agenda
Functional Dependency
Normalization
Class Exercise
Recap HW2
Project Discussion
Database Processing
Business Intelligence Systems
Datawarehouses and Datamarts
Dimensional Databases
Class Exercise
Test Discussion
Quiz
Agenda
Functional Dependency
Normalization
Class Exercise
Recap HW2
Project Discussion
Database Processing
Business Intelligence Systems
Datawarehouses and Datamarts
Dimensional Databases
Class Exercise
Test Discussion
Quiz
Functional Dependencies
EMPLOYEE relation
Functional Dependencies
EMPLOYEE relation
Functional Dependencies
EMPLOYEE relation
Functional Dependencies
EMPLOYEE relation
Agenda
Functional Dependency
Normalization
Class Exercise
Recap HW2
Project Discussion
Database Processing
Business Intelligence Systems
Datawarehouses and Datamarts
Dimensional Databases
Class Exercise
Test Discussion
Quiz
Normalization
Normalization is Process of breaking table with more than one
theme into single themed tables based on functional dependencies
Follow two principles to call a table well-formed
For a well-formed relation, every Determinant must be a Candidate key
If not well-formed, break relation into two or more well-formed relations
Normalization Process
1. Identify all Candidate keys in the relation
2. Identify all functional dependencies in the relation
3. Examine determinants , if it is not a candidate then
a. Place columns of functional dependency in a new relation
b. Make determinant PRIMARY key of new relation
c. Leave a copy of determinant as foreign key in original relation
d. Write referential integrity constraint between original & new
relation
4. Draw the Normalized tables
Normalization Process
1.
PRESCRIPTION (PrescriptionNumber, Date, Drug, Dosage, CustomerName,
CustomerPhone, CustomerEmail)
3.
a. CUSTOMER (CustomerName, CustomerPhone, CustomerEmail)
3.
a. CUSTOMER (CustomerName, CustomerPhone, CustomerEmail)
b. CUSTOMER (CustomerName, CustomerPhone, CustomerEmail)
3.
a. CUSTOMER (CustomerName, CustomerPhone, CustomerEmail)
b. CUSTOMER (CustomerName, CustomerPhone, CustomerEmail)
c. PRESCRIPTION (PrescriptionNumber, Date, Drug, Dosage, CustomerEmail)
3.
a. CUSTOMER (CustomerName, CustomerPhone, CustomerEmail)
b. CUSTOMER (CustomerName, CustomerPhone, CustomerEmail)
c. PRESCRIPTION (PrescriptionNumber , Date, Drug, Dosage, CustomerEmail)
d. CustomerEmail in PRESCRIPTION must exist in CustomerEmail in CUSTOMER
3.
a. CUSTOMER (CustomerName, CustomerPhone, CustomerEmail)
b. CUSTOMER (CustomerName, CustomerPhone, CustomerEmail)
c. PRESCRIPTION (PrescriptionNumber , Date, Drug, Dosage, CustomerEmail)
d. CustomerEmail in PRESCRIPTION must exist in CustomerEmail in CUSTOMER
Normalization Example 2
Normalization Example 3
Agenda
Functional Dependency
Normalization
Class Exercise
Recap HW2
Project Discussion
Database Processing
Business Intelligence Systems
Datawarehouses and Datamarts
Dimensional Databases
Class Exercise
Test Discussion
Quiz
Class Exercise
Explain the meaning of the following expression.
A (B, C)
Given this expression, tell if it is also true that:
A B and A C
Explain the meaning of the following expression:
(D, E) F
Given this expression, tell if it is also true that:
D F and E F
Agenda
Functional Dependency
Normalization
Class Exercise
Recap HW2
Project Discussion
Database Processing
Business Intelligence Systems
Datawarehouses and Datamarts
Dimensional Databases
Class Exercise
Test Discussion
Quiz
HW 2
1. Explain the difference between a primary key and a candidate key. (2pts)
2. What is a surrogate key and why would you use one? (2pt)
3. Explain the term foreign key. (2pt)
4. Define the term referential integrity constraint. (2pts)
5. Define the terms functional dependency and determinant. (2pts)
6. Define the term primary key in terms of functional dependencies. (2pts)
7. Draw Relations Equivalent set of terms for Table, Row, and Column. (2pts)
8. In your own words, describe the purpose of the normalization process. (2pts)
Agenda
Functional Dependency
Normalization
Class Exercise
Recap HW2
Project Discussion
Database Processing
Business Intelligence Systems
Datawarehouses and Datamarts
Dimensional Databases
Class Exercise
Test Discussion
Quiz
Agenda
Functional Dependency
Normalization
Class Exercise
Recap HW2
Project Discussion
Database Processing
Business Intelligence Systems
Datawarehouses and Datamarts
Dimensional Databases
Class Exercise
Test Discussion
Quiz
Database Processing
Database Processing
Stored Procedures
Stored Procedure is like a computer program stored
within the database
Any SQL code to make changes to the database can be
executed from a stored procedure
Application programs, web applications and query users can
invoke stored procedures
Parameters can be passed to stored procedure to perform
action or receive results
Database Processing
Triggers
Trigger is program stored within database that is
executed when specific event occurs
The events are typically INSERTS, UPDATES, or DELETES
The events are handled BEFORE, AFTER, or INSTEAD OF trigger
logic
Action code can be written or Stored Procedures can be called
as a trigger response
Agenda
Functional Dependency
Normalization
Class Exercise
Recap HW2
Project Discussion
Database Processing
Business Intelligence Systems
Datawarehouses and Datamarts
Dimensional Databases
Class Exercise
Test Discussion
Quiz
Agenda
Functional Dependency
Normalization
Class Exercise
Recap HW2
Project Discussion
Database Processing
Business Intelligence Systems
Datawarehouses and Datamarts
Dimensional Databases
Class Exercise
Test Discussion
Quiz
Data Warehouses
Data Marts
Data Mart is a collection of data that is smaller than
data warehouse and addresses a particular component
of business
Users of data mart are knowledgeable analysts of that
business function
Data Marts
Agenda
Functional Dependency
Normalization
Class Exercise
Recap HW2
Project Discussion
Database Processing
Business Intelligence Systems
Datawarehouses and Datamarts
Dimensional Databases
Class Exercise
Test Discussion
Quiz
Dimensional Databases
Databases in data warehouse or data mart are built to different
database design (not normalized relational design) called
dimensional database.
Dimensional Databases are designed for efficient data queries
and analysis
Dimensional Databases
Star Schema is a data warehouse modeling technique used to
represent the multi-dimensional data in fact and dimension tables
Agenda
Functional Dependency
Normalization
Class Exercise
Recap HW2
Project Discussion
Database Processing
Business Intelligence Systems
Datawarehouses and Datamarts
Dimensional Databases
Class Exercise
Test Discussion
Quiz
Class Exercise
Business Intelligence (BI) systems do which of the following?
A) Analyze current and past activities
B) Predict future events for strategic advantage
C) Record and process transactions
D) Both A and B
E) All of the above
Business Intelligence (BI) systems fall into which of the following categories?
A) Processing
B) Reporting
C) Decision Support
D) Both A and B
E) Both B and C
Class Exercise
Star Schema is used to graphically represent what kind of data?
A) Operational
B) Missing
C) Multi-dimensional
D) Both A and B
E) None of the above
Class Exercise
Data Dictionary is a reference repository containing
A) User data
B) Metadata
C) SQL code
D) Both A and B
E) None of the above
Agenda
Functional Dependency
Normalization
Class Exercise
Recap HW2
Project Discussion
Database Processing
Business Intelligence Systems
Datawarehouses and Datamarts
Dimensional Databases
Class Exercise
Test Discussion
Quiz
Test Discussion
Test 1 Lecture 01, Lecture 02 & Lecture 03 (150pts)
10 multiple choice questions from Relational Databases
(3pts each = 30pts)
Agenda
Functional Dependency
Normalization
Class Exercise
Recap HW2
Project Discussion
Database Processing
Business Intelligence Systems
Datawarehouses and Datamarts
Dimensional Databases
Class Exercise
Test Discussion
Quiz