Beruflich Dokumente
Kultur Dokumente
KEY TERMS
A Database = a collection of information that you
organize and access according to the logical structure of that information. A relational database = a database that uses a series of logically related two-dimensional tables or files to store information in the form of a database. A relation = often used to refer to a file while designing a DB A Entity class = A concept typically people, places, or things about which you wish to store information and that you can identify with an unique key (called a primary key) A primary key = A field (or group of fields in some cases) that uniquely describes each record/ an instance. An instance = An occurrence of an entity class that can be uniquely described with a primary key.
A relationship
Zero or optional relationship
RAW MATERIAL
ID
B C A
SUPPLIER
ID
412 444 999
Name
Home
Name
Cement paste Sand Water Total
Unit QOH
1 2 1.5 4.5 1 2 1 Total 4 400 1200 9999 400 1200 9999
Name
Wesley Enterprises Juniper Sand & Gravel N/A
Comm
B C A
BUSINESS RULES
1. A given concrete type will have many raw materials in it. 2. A given raw material may appear in many types of concrete. 3. Each raw material has one and only one supplier. 4. A supplier may provide many raw materials. Solomon may have a supplier in its database that doesnt currently provide any raw materials.
Dr Tran Thi Song Minh National Economics University
To define the various entity classes and the primary keys that uniquely define each record or instance within each entity class.
Entity classes
Concrete Type Raw Material Supplier
Primary Key
Concrete Type (ID) Raw Material ID Suppler ID
RAW MATERIAL
provides a SUPPLIER
Dr Tran Thi Song Minh National Economics University
provides a SUPPLIER
Dr Tran Thi Song Minh National Economics University
From left to right: A Concrete Type can have multiple listings of Raw Material in Bill of Material and must have a listing of Raw Material in Bill of Material. From right to left : A Concrete Type found in Bill of Material must be found and can be found only one time in Concrete Type.
From left to right: A Raw Material can be found in many Bill of Material listings but may not be found in any Bill of Material listing. From right to left : A Raw Material found in Bill of Material must be found and can be found only one time in Raw Material. From left to right: A Supplier may not provide any Raw Material (denoted with the 0) but may provide more than one Material. From right to left: A Raw Material must be provided by one Supplier (denoted with the first |) and can only be provided by one Supplier (denoted with the second |).
Supplier-Raw Material
Technique
Three rules of normalization
A FIRST LOOK AT THE RELATIONS FOR THE SUPPLY CHAIN MANAGEMENT SIDE OF SOLOMONS DATABASE
CONCRETE TYPES RELATION (Concrete type, Type name, Raw
Material Total)
Raw Material
SUPPLIER RELATION (Supplier ID, Supplier Name) BILL OF MATERIAL RELATION (Concrete Type,
ID, Unit)
Raw Material
The correct structure of the Supply Chain management Side of Solomons Database
CONCRETE TYPES RELATION (Concrete type, Type Description,
Raw Material Total)
Raw Material
SUPPLIER RELATION (Supplier ID, Supplier Name) BILL OF MATERIAL RELATION (Concrete Type,
ID, Unit)
Raw Material
Qualified Teacher
Enrolls in
Student
YOUR TASK
Create the numerical relationships by adding the symbols of |, O, and crows foot in the appropriate places Provide a narrative description of each numerical relationship:
Relationship
Seminar-Seminar Section Seminar-Seminar Section
Narrative Description
EXAMPLES OF NORMALIZATION
Normalization An important technique to design databases The process of creating small, stable, yet flexible and adaptive data structures from complex groups of data.
Normalization process
First Normal Form (1.NF) No repeating sections in the table. Second Normal Form 2.NF Each nonkey column depends on the whole key/ entire key. Third Normal Form 3.NF Each nonkey column depends nothing but the key.
Normalization process
Problem: (Raw Material Total, Raw Material ID, Raw Material Name, QOH, Unit, Supplier Name, Supplier ID) is repeated in the unnormalized relation/ table.
The old key included in the new table to connect the tables back together
Bill of material (Concrete type Id, Raw Material ID, Raw Material Name, QOH, Unit, Supplier Name, Supplier ID)
Normalization process
Problem: Every time we enter the Raw Material Id, we have to reenter Raw Material Name, QOH, Supplier Id, Supplier Name) Second Normal Form: To split the table so that all nonkey columns depend on the whole key (not just part of it)
Bill of material (Concrete type Id, Raw Material ID, Raw Material Name, QOH, Unit, Supplier Name, Supplier ID)
Raw Material (Raw Material ID, Raw Material Name, QOH, Supplier ID, Supplier Name)
Normalization process
Problem: Supplier_Name and Supplier_Address depend on the nonkey column Supplier_Number Third Normal Form: To split the table so that every nonkey column depends nothing but the key
Raw Material (Raw Material ID, Raw Material Name, QOH, Supplier ID, Supplier Name) Raw Material (Raw Material ID, Raw Material Name, QOH, Supplier ID)
The old key included in the new table to connect the tables back together
SUPPLIER
Supplier Id (PK) Supplier Name CONCRETE TYPES Concrete Type Id (PK) Type name Total Raw material