Database Technologies. Madalina CROITORU IUT Montpellier

Similar documents
Chapter 3. The Relational database design

Normalization. { Ronak Panchal }

Database Normalization

Chapter 14. Chapter 14 - Objectives. Purpose of Normalization. Purpose of Normalization

DBMS Chapter Three IS304. Database Normalization-Comp.

Database Technologies. Madalina CROITORU IUT Montpellier

Transforming ER to Relational Schema

Normalisation. Normalisation. Normalisation

Database Technologies. Madalina CROITORU IUT Montpellier

Lecture 03. Spring 2018 Borough of Manhattan Community College

Lecture 03. Fall 2017 Borough of Manhattan Community College

Discovery-based Edit Assistance for Spreadsheets

From Spreadsheets to Relational Databases and Back

Unit I. Introduction to Database. Prepared By: Prof.Sushila Aghav. Ref.Database Concepts by Korth

Steps in normalisation. Steps in normalisation 7/15/2014

DB Creation with SQL DDL

CS317 File and Database Systems

STRUCTURED QUERY LANGUAGE (SQL)

Relational Data Model ( 관계형데이터모델 )

Logical Database Design. ICT285 Databases: Topic 06

Lecture 07. Spring 2018 Borough of Manhattan Community College

CS317 File and Database Systems

CS317 File and Database Systems

Lecture 6 Structured Query Language (SQL)

IS 263 Database Concepts

Entity Relationship Modeling

3ISY402 DATABASE SYSTEMS

Lecture 5 Data Definition Language (DDL)

Example 1 - Create Horizontal View. Example 2 - Create Vertical View. Views. Views

Schema Normalization. 30 th August Submitted By: Saurabh Singla Rahul Bhatnagar

Lecture5 Functional Dependencies and Normalization for Relational Databases

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 9 Normalizing Database Designs

Multiple-Choice. 1. Which of the following is equivalent to a table? (3 pts.) a. record b. relation c. relationship d. constraint e.

Standard Query Language. SQL: Data Definition Transparencies

Normalization. Murali Mani. What and Why Normalization? To remove potential redundancy in design

Chapter 6. SQL: SubQueries

Learning outcomes. On successful completion of this unit you will: 1. Understand data models and database technologies.

Lecture 09. Spring 2018 Borough of Manhattan Community College

Normalization Rule. First Normal Form (1NF) Normalization rule are divided into following normal form. 1. First Normal Form. 2. Second Normal Form

NORMALISATION (Relational Database Schema Design Revisited)

Two hours. Please note that an OMR Sheet is attached for use with Section A: full instructions for their use are given in Section A

CS317 File and Database Systems

A Deeper Look at Data Modeling. Shan-Hung Wu & DataLab CS, NTHU

SAMPLE FINAL EXAM SPRING/2H SESSION 2017

SOLUTIONS TO REVIEW QUESTIONS AND EXERCISES FOR PART 3 - DATABASE ANALYSIS AND DESIGN (CHAPTERS 10 15)

Redundancy:Dependencies between attributes within a relation cause redundancy.

MIDTERM EXAMINATION Spring 2010 CS403- Database Management Systems (Session - 4) Ref No: Time: 60 min Marks: 38

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Winter 2009 Lecture 4 - Schema Normalization

Distributed Database Systems By Syed Bakhtawar Shah Abid Lecturer in Computer Science

Normalization in DBMS

Relational Model. Rab Nawaz Jadoon DCS. Assistant Professor. Department of Computer Science. COMSATS IIT, Abbottabad Pakistan

Normalisation Chapter2 Contents

Database Normalization

Conceptual Database Design

Database Foundations. 3-9 Validating Data Using Normalization. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

Lecture 10. Spring 2018 Borough of Manhattan Community College

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 6 Normalization of Database Tables

Normalisation. Connolly, Ch. 13

Chapter 6. SQL Data Manipulation

BSc (Hons) Web Technologies, BSc (Hons) Business Information System. Examinations for / Semester 2. Resit Examinations for BIS/15B/FT

RELATIONAL DATA MODEL

Relational Algebra and Relational Calculus. Pearson Education Limited 1995,

CS403- Database Management Systems Solved MCQS From Midterm Papers. CS403- Database Management Systems MIDTERM EXAMINATION - Spring 2010

Database Systems. A Practical Approach to Design, Implementation, and Management. Database Systems. Thomas Connolly Carolyn Begg

Lectures 12: Design Theory I. 1. Normal forms & functional dependencies 2/19/2018. Today s Lecture. What you will learn about in this section

Geodatabase Database Design. Tomislav Sapic GIS Technologist Faculty of Natural Resources Management Lakehead University


Detailed Data Modelling: Attribute Collection and Normalisation of Data

CS317 File and Database Systems

Techno India Batanagar Computer Science and Engineering. Model Questions. Subject Name: Database Management System Subject Code: CS 601

Today Learning outcomes LO2

CS403- Database Management Systems Solved Objective Midterm Papers For Preparation of Midterm Exam

1. Considering functional dependency, one in which removal from some attributes must affect dependency is called

CMP-3440 Database Systems

Objectives Definition iti of terms List five properties of relations State two properties of candidate keys Define first, second, and third normal for

PURPOSE OF DATABASE SYSTEM

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Fall 2009 Lecture 3 - Schema Normalization

CMP-3440 Database Systems

Lecture 01. Fall 2018 Borough of Manhattan Community College

EECS-3421a: Test #1 Design

Detailed Data Modelling. Detailed Data Modelling. Detailed Data Modelling. Identifying Attributes. Attributes

Applied Databases. Sebastian Maneth. Lecture 5 ER Model, normal forms. University of Edinburgh - January 25 th, 2016

Fundamentals of Database Systems

Database Systems. Normalization Lecture# 7

Draw A Relational Schema And Diagram The Functional Dependencies In The Relation >>>CLICK HERE<<<

Lecture 3 (Part 2) Akhtar Ali

3 February 2011 CSE-3421M Test #1 p. 1 of 14. CSE-3421M Test #1. Design

The University of Nottingham

FIT1004 Database Topic 6: Normalisation

8) A top-to-bottom relationship among the items in a database is established by a

Lecture4: Guidelines for good relational design Mapping ERD to Relation. Ref. Chapter3

Functional Dependencies & Normalization for Relational DBs. Truong Tuan Anh CSE-HCMUT

Chapter 4. The Relational Model

CS614 - Data Warehousing - Midterm Papers Solved MCQ(S) (1 TO 22 Lectures)

PART III SOLUTIONS TO REVIEW QUESTIONS AND EXERCISES

THE RELATIONAL DATABASE MODEL

Functional Dependencies and Finding a Minimal Cover

Database Management System Prof. Partha Pratim Das Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

CLASS DISCUSSION AND NOTES

Functional Dependencies, Normalization. Rose-Hulman Institute of Technology Curt Clifton

Transcription:

Database Technologies Madalina CROITORU croitoru@lirmm.fr IUT Montpellier

Part 5 NORMAL FORMS AND NORMALISATION

Database design In the database design one can follow a bottom up approach or a top down approach (most well known is the ER modelling) Normalisation is a obligatory step in the design can be used in both cases In the following we will only focus on the normalisation for the top down approach, as a validation technique for the created tables

Normalisation Normalisation is a technique for producing a set of relations with desirable properties, given the data requirements of the enterprise: Minimal number of attributes necessary for the requirements Attributes with a close logical relationship (also called functional dependencies) are found within the same relation Minimal redundancy attributes represented only once with the exception of forgein keys Why normalise: Easy to maintain the data: updates are achieved with a minimal number of operations thus reducing the opportunities for data inconsistency occuring the database Easy to access the data Less space on the computer

Functional dependencies Functional dependency: describe the relationship between attributes. Attribute A is dependent on attribute B (A-> B) if every value of A is associated with exactly one value of B. Example: StaffNo functionally determines position (for a specific staffno we can determine its position). Their relationship is 1:1 for each staffno there is only one position. The converse is not true. The relationship between position and StaffNo is 1:* - there are several staff numbers associated with a given position. When determining functional dependencies it is important to distinguish between the values held at a certain point in time and the set of all possible values (the functional dependency is a property of the relational schema or the property of this particular instance of the relational schema).

Full functional dependency A full functional dependency indicates that if A and B are attributes of a relation, B is fully dependent on A if B is functionally dependent on A but not on any proper subset of A. Example: staffno, sname -> branchno is a functional dependency because each value of (staffno, sname) is associated with a single value of branchno. A full dependency is the following: staffno- >branchno. The functional dependencies we will use for normalisation satisfy: 1. They hold for all time 2. They have minimal number of attributes to maintain the dependency (full functional) 3. There is a one to one relationship between attributes on the left and those of the right hand side (conversely it could be either 1:1 or 1:*).

Normal forms In this course we will focus on: First Normal Form Second Normal Form Third Normal Form There are other normal forms (BCNF, 4NF, 5NF and Higher Normal Forms) not addressed for lack of time. Please check the course reference book for further details.

First normal form A relation is in 1NF if the intersection of each row and column contain one and exactly one value To obtain a 1NF relation one must identify the cells that contain more than one value The cells are flatten: we create new rows that contain each of the information in the cells These relations might contain a lot of redundancy (subject to insertion anomalies) and thus a second normal form is needed.

Second normal form A relation that is in second normal norm is in first normal form and every non primary key attribute is fully functional on the primary key. The normalisation from 1 st normal form relations to 2 nd normal forms relations involves the removal of partial dependencies. If a partial dependency exists we remove the partially dependent attributes from the relation by placing them in a new relation along with a copy of their determinant

2 nd NF - example We identify the functional dependencies of ClientRental: clientno, propertyno->rentstart, rentfinish clientno->cname propertyno->paddress, rent, ownerno, oname ownerno->oname ClientNo, rentstart->propertyno, paddress, rentfinish, rent, ownerno, oname propertyno, rentstart->clientno, cname, rentfinish Non primary ket attributes are removed along with the copy of the part of the primary key they are fully functionally dependent. This results in the creation of three tables.

Third normal form A relation is in third normal form if it is in first and second normal form and every no non-primary key attribute is transitively dependent on the primary key. The normalisation of 2 nd NF relations to 3 rd NF involves the removal of transitive dependencies. If a transitive dependency exists we remove the transitively dependent attribute from the relation by placing the attributes in a new relation along with a copy of the determinant.

rd 3 NF - example PropertyOwner: all the non primary key attributes are functionally dependent on the primary key with the exception of oname which is transitively dependent on the ownerno. We thus create two new relations: PropertyforRent and Owner.

Exercises The following lists samples dentist / patient appointment data. A patient is given an appointment at a specific time and date with a dentist located at a particular hospital (surgery). On each day of patient appointments a dentist is allocated to a specific hospital for that day. Identify the functional dependencies. Describe the normalisation process. Identify the primary, alternate and forgein keys for the 3NF relations.

Exercises A company FastCabs provides taxi service to their clients. Their sample data is illustrated below. Assume that a taxi driver is assigned to a single taxi, but a taxi can be assigned to one or more drivers. Identify the functional dependencies of the table below Apply normalisation to 3NF and check your result if conform to below Explain how the original table can be recreated through relational joins between primary and foreign keys columns of the tables in 3NF.