Relational Schema Design



Similar documents
Database Design Methodologies

ER & EER to Relational Mapping. Chapter 9 1

Bridge from Entity Relationship modeling to creating SQL databases, tables, & relations

Chapter 2: Entity-Relationship Model. Entity Sets. " Example: specific person, company, event, plant

ER modelling, Weak Entities, Class Hierarchies, Aggregation

CSC 742 Database Management Systems

7.1 The Information system

Converting E-R Diagrams to Relational Model. Winter Lecture 17

XV. The Entity-Relationship Model

2. Conceptual Modeling using the Entity-Relationship Model

Chapter 2: Entity-Relationship Model. E-R R Diagrams

Chapter 2: Entity-Relationship Model

COMP 378 Database Systems Notes for Chapter 7 of Database System Concepts Database Design and the Entity-Relationship Model

Lecture 12: Entity Relationship Modelling

Database Design Process

Database Design Overview. Conceptual Design ER Model. Entities and Entity Sets. Entity Set Representation. Keys

Database Design Process

DATABASE DESIGN. - Developing database and information systems is performed using a development lifecycle, which consists of a series of steps.

LiTH, Tekniska högskolan vid Linköpings universitet 1(7) IDA, Institutionen för datavetenskap Juha Takkinen

A Tool for Generating Relational Database Schema from EER Diagram

The Entity-Relationship Model

Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model

The Entity-Relationship Model

The Entity-Relationship Model

Data Modeling. Database Systems: The Complete Book Ch ,

Chapter 8 The Enhanced Entity- Relationship (EER) Model

Databases What the Specification Says

Database Design Methodology

Chapter 3. Data Modeling Using the Entity-Relationship (ER) Model

IV. The (Extended) Entity-Relationship Model

Requirement Analysis & Conceptual Database Design. Problem analysis Entity Relationship notation Integrity constraints Generalization

Foundations of Information Management

Conceptual Design Using the Entity-Relationship (ER) Model

THE ENTITY- RELATIONSHIP (ER) MODEL CHAPTER 7 (6/E) CHAPTER 3 (5/E)

The E-R èentity-relationshipè data model views the real world as a set of basic objects èentitiesè and

Lesson 8: Introduction to Databases E-R Data Modeling

not necessarily strictly sequential feedback loops exist, i.e. may need to revisit earlier stages during a later stage

three Entity-Relationship Modeling chapter OVERVIEW CHAPTER

Database Design and the E-R Model

Database Concepts. Database & Database Management System. Application examples. Application examples

Entity-Relationship Model. Purpose of E/R Model. Entity Sets

Entity-Relationship Model

Data Modelling and E-R Diagrams

Entity - Relationship Modelling

Databases and BigData

Graphical Systems Modeling with UML / SysML Class diagrams

CS 377 Database Systems. Database Design Theory and Normalization. Li Xiong Department of Mathematics and Computer Science Emory University

Entity Relationship Diagram

Normalization. Purpose of normalization Data redundancy Update anomalies Functional dependency Process of normalization

A. TRUE-FALSE: GROUP 2 PRACTICE EXAMPLES FOR THE REVIEW QUIZ:

An Example: Video Rental System

OVERVIEW 1.1 DATABASE MANAGEMENT SYSTEM (DBMS) DEFINITION:-

BİL 354 Veritabanı Sistemleri. Entity-Relationship Model

Database Design Methodology

SCHEMAS AND STATE OF THE DATABASE

DATABASE MANAGEMENT SYSTEMS. Question Bank:

Designing a Database Schema

DATABASE INTRODUCTION

The Relational Model. Why Study the Relational Model? Relational Database: Definitions. Chapter 3

Data Analysis 1. SET08104 Database Systems. Napier University

The Relational Data Model: Structure

Database Management Systems

Unit 2.1. Data Analysis 1 - V Data Analysis 1. Dr Gordon Russell, Napier University

DATABASE DESIGN: NORMALIZATION NOTE & EXERCISES (Up to 3NF)

Review: Participation Constraints

Outline. Data Modeling. Conceptual Design. ER Model Basics: Entities. ER Model Basics: Relationships. Ternary Relationships. Yanlei Diao UMass Amherst

Normalization. Normalization. Normalization. Data Redundancy

Grocery Store Project

Chapter 10. Practical Database Design Methodology. The Role of Information Systems in Organizations. Practical Database Design Methodology

Modern Systems Analysis and Design

Part 7: Object Oriented Databases

Umbrello UML Modeller Handbook

Concepts of Database Management Seventh Edition. Chapter 6 Database Design 2: Design Method

Exercise 1: Relational Model

IT2304: Database Systems 1 (DBS 1)

Foundations of Information Management

EXAMINATIONS 2008/2009 ACADEMIC YEAR FOR THE DEGREE OF BACHELOR OF BUSINESS MANAGEMENT AND INFORMATION TECHNOLOGY

SAMPLE FINAL EXAMINATION SPRING SESSION 2015

Database Systems. Session 3 Main Theme. Enterprise Data Modeling Using The Entity/Relationship (ER) Model. Dr. Jean-Claude Franchitti

A brief overview of developing a conceptual data model as the first step in creating a relational database.

IT2305 Database Systems I (Compulsory)

CS 4604: Introduc0on to Database Management Systems. B. Aditya Prakash Lecture #5: En-ty/Rela-onal Models- - - Part 1

A Comparative Analysis of Entity-Relationship Diagrams 1

Object-Oriented Data Modeling

Uses Crows feet notation for ER Diagrams in ERwin

We know how to query a database using SQL. A set of tables and their schemas are given Data are properly loaded

Introduction to normalization. Introduction to normalization

Fundamentals of Database System

Lecture 6. SQL, Logical DB Design

Database Design. Database Design I: The Entity-Relationship Model. Entity Type (con t) Chapter 4. Entity: an object that is involved in the enterprise

Basic Concepts. Chapter A: Network Model. Cont.) Data-Structure Diagrams (Cont( Data-Structure Diagrams. General Relationships. The DBTG CODASYL Model

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer

Entity Relationship Model

Fundamentals of Database Design

Information Systems Modelling Information Systems I: Databases

Database Fundamentals: 1

Logical Schema Design: The Relational Data Model

The Relational Model. Ramakrishnan&Gehrke, Chapter 3 CS4320 1

Databases Model the Real World. The Entity- Relationship Model. Conceptual Design. Steps in Database Design. ER Model Basics. ER Model Basics (Contd.

Transcription:

Relational Schema Design Using ER Methodology to Design Relational Database Schemas The Development Process Collect requirements. Analyze the requirements. Conceptually design the data (e.g., draw an ER diagram). Logically design the data (e.g., choose relation names and schemas). ER Diagrams Relations Rule 1 A strong entity E becomes a relation. Create relation R that includes all simple attributes of E and simple component attributes of composite attributes of E. The key of the entity becomes the primary key of the relation schema. F L (,, Fname, L)

_ Rule 2 A weak entity W with owner entity type E becomes a relation R. The relation schema contains the entity s properties and the key of the entity E on which the weak entity depends. Create relation R including all simple attributes and simple component attributes of W. The full key of the entity becomes the primary key of the schema. The weak relationship disappears, If this relationship has any properties, they become attributes of the weak relation's schema. Has Next_of_Kin N Relation Rule 3 Next_of_Kin (, Nname, Relation) For each binary 1:1 relationship type R identify relations corresponding to participating entities, say T and S if there is total participation, make that S include primary key of T as a foreign key in S include all simple attributes and simple components of composites of R as attributes of S 1 1 Manages Branch Branch_No L F Branch_Managed (Branch_No,, ) (,, Fname, L)

Rule 4 A many-to-one relationship is absorbed by the relation corresponding to the entity at the many side. This is done by adding to the schema of the relation corresponding to the many side the key of the relation corresponding to the one side. If the relationship has any properties, these are also added to the schema of the relation corresponding to the many side. If the many-to-one relationship connects a weak entity class with the entity class it depends on, this rule has no effect beyond the effect of Rule 2. For each 1:N binary relationship type R identify relations, say S and T, corresponding to participating entity types if S is at N side of relationship type then include primary key of T in S include any simple attributes or simple components of R as attributes of S 1 M Oversees Property for Rent Property_No L F Overseed_property (Property_No,, ) (,, Fname, L)

Rule 5 A many-to-many relationship becomes a relation. The relation schema contains the keys of the entities related by the relationship, plus any properties of the relationship. The union of the keys of the related entities becomes the primary key of the relation schema. For each binary N:M relationship type K create new relation R to represent K if S and T are the relations corresponding to the participating entity types then include their primary keys as foreign keys in R combination of foreign keys will be primary key of R include any simple attributes or simple components of K as attributes of R Tel_No Newspaper M Advertises N Property for Rent Property_No Newspaper Rule 6 NAP (Newspaper, Property_No) Property for Rent (Property_No, ) Newspaper (Newspaper, Tel_No) For each multi-valued attribute A Create a relation R that contains the attribute A and the primary key of the relation S that corresponds to the entity type that contained A. Email 1 M Has Email Email_Id Email (Email-Id, ) (,, Fname, L)

Rule 7 For each n-ary relationship type L (n>2) create a new relation R to represent L include as foreign keys in R the primary keys of all relations that correspond to the entity types participating in L the primary key of R is the combination of all these foreign keys include any simple attributes or simple components of L as attributes of R Rule 8 For each specialization with subclasses {S1, S2,, Sm } and superclass C where attributes of C are {k, a1, a2,, an } and k is the primary key conversation can be done using one of 4 options: Option 1 create relation L for C where Attr(L) = {k, a1, a2,, an} and PK(L) = k create relation Li for each Si where Attr(Li) = {k} U {attributes of Si} and PK(Li) = k Option 2 create relation Li for each Si where Attr(Li) = {k, a1, a2,, an} U {attributes of Si} and PK(Li) = k Option 3 for cases where subclasses are disjoint create relation L where Attrs(L) = {k, a1, a2,, an} U {attributes of S1} U {attributes of S2} U U {attributes of Sm} U {t} and PK(L) = k, where t is a type (or discriminating) attribute Option 4 for cases where subclasses are overlapping create relation L where Attrs(L) = {k, a1, a2,, an} U {attributes of S1} U {attributes of S2} U U {attributes of Sm} U {t1, t2,, tm} and PK(L) = k, where ti is a boolean attribute indicating whether a tuple belongs to Si