Intro - To-Database - Chapter No 4
Intro - To-Database - Chapter No 4
Introduction To Database
By: Hadeesullah Sahak
Department of Computer Science
What is Normalization
Normalization is a database design technique which organizes tables in a
It divides larger tables to smaller tables and link them using relationships.
The inventor of the relational model Edgar Codd proposed the theory of
illustrated below.
Problem With An Normalized Database
For instance if the office number changes, then there are multiple
updates that need to be made. If these updates are not successfully
completed across all rows, then an inconsistency occurs.
Problem With An Normalized Database
Deletion Anomaly: Deletion of a row can cause more than one set of
shown below.
We have divided our 1NF table into two tables . Table 1 and Table2.
movies rented.
using membership id
Normalization Summary
Designing A Database From the Scratch
Steps:
Requirements specification
Analysis
Conceptual design
Implementation Design
summary of what data items will be stored in the database, and how
give meaning to the data items, e.g. define the more detailed
‘data models’. Data models are diagrams or schemas, which are used
requirements document.
Database Design 1st Step: Requirement Document
The business is a sweet factory called ‘Candy Land’. The business buys raw
ingredients from several suppliers and keep a monthly record of the purchases.
‘Candy Land’ has several employees who prepare the ingredients or make sweets
retail stores, and the sales are recorded in an inventory on a monthly basis.
Database Design 1st Step: Requirement Document
The company would like to keep track of purchases of raw ingredients and their
suppliers, as well as employees and their wages. There are 20 employees in the
The employees are specialized in different areas of the sweet manufacturing process
The company sells their product to a number of different remailers in various cities.
company would like to keep track of the value and date of sales and
purchases as well who bought or sold what to them.
The company is loosing a lot of money and they would like to be able
They would also like to keep track of where employees live with the
they can reduce costs by having one single deliver system to each
SUPPLIER(supplier_name, supplier_city)
DEPARTMENT(department_id, company_name)
The previous Data Set is the Result of analyzing the Information from
implemented
Database Design 4rd Step: Implementation Design
In the implementation design phase, the conceptual data model is translated into a
The logical data model conveys the “logical functioning and structure” of the database
and describes ‘how the data is stored’ (e.g. what tables are used, what constraints are
a physical design.
Database Design 4rd Step: Implementation Design
Database Design 4rd Step: Implementation Design
The final step is to physically implement the logical design which was
illustrated Before.
Dictionary.
The following blocks of code each represent a row in the data dictionary
The blocks of “create table” code contain the details of all the data
database system.
Create Database Tables – Continue
COMPANY TABLE
Create Database Tables – Continue
EMPLOYEE TABLE
Create Database Tables – Continue
SUPPLIER TABLE
Create Database Tables – Continue
PURCHASE TABLE
Create Database Tables – Continue
RETAILER TABLE
Create Database Tables – Continue
PORODUCT TABLE
Create Database Tables – Continue
DEPARTMENT TABLE
Create Database Tables – Continue
WORKS TABLE
Create Database Tables – Continue
SALES TABLE