Normalization Process: Exercise 1: Step 1 IST2101 Step 1. Identify all the candidate keys of the relation. StudentNumber.

Slides:



Advertisements
Similar presentations
A Normalisation Example
Advertisements

Normalization Process: Exercise 2: Step 1 IST2101 Step 1. Identify all the candidate keys of the relation. (Attorney, ClientNumber, MeetingDate)
Lab Exercise This Week PHP Basics See last Friday’s slides for requirements Make sure you show the final results to TA to get credit 1IST210.
The Relational Model Chapter Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 6 th Edition.
The Relational Model Chapter Two Functional Dependency.
Normalization Queries (contd)
Chapter 3. 2 Chapter 3 - Objectives Terminology of relational model. Terminology of relational model. How tables are used to represent data. How tables.
SQL Keys and Constraints Justin Maksim. Key Declaration Key constraint defined within the CREATE TABLE command Key can be declared using either the PRIMARY.
The Relational Model Chapter Two (Excerpts) DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
The Relational Model Chapter Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 5 th Edition.
Chapter 2. The Relational Model (cont.) IST2101. Review: Functional Dependency A relationship between attributes: some attribute(s) determine the value.
REVIEW Excel Excel Absolute vs. Relative Address.
Database Architecture The Relational Database Model.
Amity School of Engineering & Technology E-R Diagram for a University Enterprise.
COURSE REGISTRATION SYSTEM Case study IST2101. Case Study: Course Registration (1) IST2102 You are helping Penn State create a course registration system.
Relational Model Session 6 Course Name: Database System Year : 2012.
DATABASE DESIGN I IST 210: Organization of Data IST210 1.
Database Design II (Case Studies: Step 2) IST 210: Organization of Data IST2101.
Relational Database Management Systems. A set of programs to manage one or more databases Provides means for: Accessing the data Inserting, updating and.
R ELATIONAL D ATA M ODEL Joe Meehean 1. R ELATIONAL D ATA M ODEL Data stored as a set of relations really just tables Tables related to one another through.
IE 423 – Design of Decision Support Systems Database development – Relationships and Queries.
IST 210: ORGANIZATION OF DATA Chapter 1. Getting Started IST210 1.
The Relational Model Chapter Two DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
The Relational Model Chapter Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.
Chapter 2. The Relational Model IST2101. Chapter 1 Review Potential problems with Lists – Deletion – Update – Insertion Avoid these problems using a relational.
IE 423 – Design of Decision Support Systems Data modeling and database development.
Chapter 2. The Relational Model (cont.)
THE RELATIONAL MODEL II IST 210: Organization of Data IST210 1.
3. Relational Model Lingma Acheson Department of Computer and Information Science IUPUI CSCI N207 Data Analysis with Spreadsheets 1.
Chapter 2. The Relational Model (cont.) IST2101. Review: Determinant vs. Candidate Key IST2102 DeterminantsCandidate Key (StudentID, CourseID) StudentID.
Assignment 1 Uploaded to course website Due next Tuesday, Sep 1, at 11:59pm.
Database Design I (In-Class Exercise Answer) IST 210: Organization of Data IST2101.
THE RELATIONAL MODEL I IST 210: Organization of Data IST210 1.
© 2002 by Prentice Hall 1 The Relational Model David M. Kroenke Database Concepts 1e Chapter 2 2.
The Relational Model Chapter Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 4 th Edition.
The Relational Model. 2 Relational Model Terminology u A relation is a table with columns and rows. –Only applies to logical structure of the database,
Understand Primary, Foreign, and Composite Keys Database Administration Fundamentals LESSON 4.2.
IE 423 – Design of Decision Support Systems Data modeling and database development.
Chapter 3 The Relational Model. Objectives u Terminology of relational model. u How tables are used to represent data. u Connection between mathematical.
Data Modeling and Entity-Relationship Model I
Chapter 4 The Relational Model Pearson Education © 2009.
Database Design I IST 210: Organization of Data IST2101.
Database Planning Database Design Normalization.
Chapter 1. Getting Started IST 210: Organization of Data IST2101.
DATA MODELING AND ENTITY-RELATIONSHIP MODEL II IST 210: Organization of Data IST210 1.
DATABASE DESIGN II IST 210: Organization of Data IST210 1.
Database Design I (In-Class Exercise Answer) IST 210: Organization of Data IST2101.
Translating ER into Relations; Normalization
CSIS 115 Database Design and Applications for Business
The Relational Model and Database Normalization
The Relational Model Chapter Two DATABASE CONCEPTS, 3rd Edition
ISQS 6339, Business Intelligence Database vs. Data Warehouse
IST 210: Organization of Data
COMP 430 Intro. to Database Systems
Tables and Their Characteristics
CIS 155 Table Relationship
Index Structure.
COMP 430 Intro. to Database Systems
5 × 7 = × 7 = 70 9 × 7 = CONNECTIONS IN 7 × TABLE
Lingma Acheson Department of Computer and Information Science IUPUI
5 × 8 = 40 4 × 8 = 32 9 × 8 = CONNECTIONS IN 8 × TABLE
4 × 6 = 24 8 × 6 = 48 7 × 6 = CONNECTIONS IN 6 × TABLE
5 × 6 = 30 2 × 6 = 12 7 × 6 = CONNECTIONS IN 6 × TABLE
Copyright © 2018, 2015, 20 Pearson Education, Inc. All Rights Reserved Database Concepts Eighth Edition Chapter # 2 The Relational Model.
A Very Brief Introduction to Relational Databases
10 × 8 = 80 5 × 8 = 40 6 × 8 = CONNECTIONS IN 8 × TABLE MULTIPLICATION.
3 × 12 = 36 6 × 12 = 72 7 × 12 = CONNECTIONS IN 12 × TABLE
5 × 12 = × 12 = × 12 = CONNECTIONS IN 12 × TABLE MULTIPLICATION.
5 × 9 = 45 6 × 9 = 54 7 × 9 = CONNECTIONS IN 9 × TABLE
3 × 7 = 21 6 × 7 = 42 7 × 7 = CONNECTIONS IN 7 × TABLE
Presentation transcript:

Normalization Process: Exercise 1: Step 1 IST2101 Step 1. Identify all the candidate keys of the relation. StudentNumber

Normalization Process: Exercise 1: Step 2 IST2102 Step 2. Identify all the functional dependencies in the relation. DormName  DormCost Trivial dependency: StudentNumber  (LastName, FirstName, DormName, DormCost)

Normalization Process: Exercise 1: Step 3 IST2103 Step 3. If any determinant is not a candidate key, the relation is not well formed. StudentNumberStudentNumber  (LastName, FirstName, DormName, DormCost) DormName  DormCost

Normalization Process: Exercise 1: Step 3 IST2104 Step 3. Examine the determinants of the functional dependencies. If any determinant is not a candidate key, the relation is not well formed. In this case: a.Place the columns of the functional dependency in a new relation of their own. DORM(DormName, DormCost) b.Make the determinant of the functional dependency the primary key of the new relation. DORM(DormName, DormCost) c.Leave a copy of the determinant as a foreign key in the original relation. STU_DORM(StudentNumber, LastName, FirstName, DormName) d.Create a referential integrity constraint between the original relation and the new relation. DormName in STU_DORM must exist in DormName in DORM

Normalization Process: Exercise 1: Step 4 IST2105 Step 4. Repeat step 3 as many times as necessary until every determinant of every relation is a candidate key. STU_DORM(StudentNumber, LastName, FirstName, DormName) DORM(DormName, DormCost) DormName in STU_DORM must exist in DormName in DORM Well-formed relational model design

How to place the foreign key? Q: In Step 3, why don’t we connect these two tables by placing StudentNumber into DORM table instead? A: Each dorm may correspond to multiple students, resulting multiple values in single cell. STU_DORM(StudentNumber, LastName, FirstName, DormName) DORM(DormName, DormCost)

How to place the foreign key? IST2107 STUDENT(StudentID, StudentName, Student’sDepartment, ) COURSE(CourseID, Instructor, CourseName, Location) REGISTRATION(StudentID, CourseID) StudentID in REGISTRATION must exist in StudentID in STUDENT COURSEID in REGISTRATION must exist in CourseID in COURSE Sometimes it is inappropriate to place the primary key from either table to another. In such cases, we need to create a new table to connect them together: