Sarajane Marques Peres, Ph.D. University of São Paulo Based on Elsmari, Navathe / Silberschatz, Korth, Sudarshan s books

Size: px
Start display at page:

Download "Sarajane Marques Peres, Ph.D. University of São Paulo Based on Elsmari, Navathe / Silberschatz, Korth, Sudarshan s books"

Transcription

1 Sarajane Marques Peres, Ph.D. University of São Paulo Based on Elsmari, Navathe / Silberschatz, Korth, Sudarshan s books ER MODEL à R MODEL

2 Mapping of Regular EnKty Types For each regular (strong) enkty type E in the ER schema, create a relakon R that includes all the simple apributes (or simple components of composite apributes) of E. Choose one of the key apributes of E as the primary key for R. If the chosen key of E is a composite, then the set of simple apributes that form it will together form de primary key of R.

3 Mapping of Regular EnKty Types For each regular (strong) enkty type E in the ER schema, create a relakon R that includes all the simple apributes (or simple components of composite apributes) of E. Choose one of the key apributes of E as the primary key for R. If the chosen key of E is a composite, then the set of simple apributes that form it will together form de primary key of R.

4 Mapping of Regular EnKty Types

5 Mapping of MulKvalued APributes For each mulkvalued apribute A, create a new relakon R. This relakon R will include an apribute corresponding to A, plus the primary key apribute K as a foreign key in R of the relakon that represents the enkty type or relakonship type that has A as a mulkvalued apribute. The primary key of R is the combinakon of A and K.

6 Mapping of MulKvalued APributes For each mulkvalued apribute A, create a new relakon R. This relakon R will include an apribute corresponding to A, plus the primary key apribute K as a foreign key in R of the relakon that represents the enkty type or relakonship type that has A as a mulkvalued apribute. The primary key of R is the combinakon of A and K.

7 Mapping of MulKvalued APributes Dname Dnumber Research 5 AdministraKon 4 Headquarters 1 Dnumber Dloca2on 1 Houston 4 Stafford 5 Bellaire 5 Sugarland 5 Houston

8 Mapping of Weak EnKty Types For each weak enkty type W in the ER schema with owner enkty type E, create a relakon R and include all simple apributes (or simple components of composite apributes) of W as apributes of R. Include as foreign key apribute(s) of R, the primary key apribute(s) of the relakons(s) that correspond to the owner(s) enkty type(s); The primary key of R is the combinakon of the primary key(s) of the owner(s) and the parkal key of the weak enkty type W, if any.

9 Mapping of Weak EnKty Types For each weak enkty type W in the ER schema with owner enkty type E, create a relakon R and include all simple apributes (or simple components of composite apributes) of W as apributes of R. Include as foreign key apribute(s) of R, the primary key apribute(s) of the relakons(s) that correspond to the owner(s) enkty type(s); The primary key of R is the combinakon of the primary key(s) of the owner(s) and the parkal key of the weak enkty type W, if any.

10 Mapping of Weak EnKty Types

11 Mapping of Binary 1:1 RelaKonship Types For each binary 1:1 relakonship type R in the ER schema, idenkfy the relakons S and T that correspond to the enkty types parkcipakng in R. Choose one approach: 1. The foreign key approach (most useful) 2. The merged relakonship approach 3. The cross- reference or relakonship relakon approach

12 Mapping of Binary 1:1 RelaKonship Types 1. Foreign key approach: Choose one of the relakons S, say and include as a foreign key in S the primary key of T. It is beper to choose an enkty type with total par2cipa2on in R in the role of S. Include all the simple apributes (or simple components of composite apributes) of the 1:1 relakonship type R as apributes of S.

13 Mapping of Binary 1:1 RelaKonship Types 1. Foreign key approach: Choose one of the relakons S, say and include as a foreign key in S the primary key of T. It is beper to choose an enkty type with total par2cipa2on in R in the role of S. Include all the simple apributes (or simple components of composite apributes) of the 1:1 relakonship type R as apributes of S. Mgr_ssn: APribute unique key!

14 Mapping of Binary 1:1 RelaKonship Types Using the same approach, but choosing the relakon T instead the relakon S. Dname Dnumber Research 5 AdministraKon 4 Headquarters 1 Fname Ssn Sex Mgr_dno Mgr- start- date John 1 M Franklin 2 M NULL NULL Alicia 3 F NULL NULL Jennifer 4 F NULL NULL Joyce 5 F NULL NULL Ahmed 6 M James 7 M

15 Mapping of Binary 1:1 RelaKonship Types Using the same approach, but choosing the relakon T instead the relakon S. Dname Dnumber Research 5 AdministraKon 4 Headquarters 1 Fname Ssn Sex Mgr_dno Mgr- start- date John 1 M Franklin 2 M NULL NULL Alicia 3 F NULL NULL Jennifer 4 F NULL NULL Joyce 5 F NULL NULL Ahmed 6 M James 7 M

16 Mapping of Binary 1:1 RelaKonship Types Using the same approach, but choosing the relakon T instead the relakon S. Dname Dnumber Research 5 AdministraKon 4 Headquarters 1 Fname Ssn Sex Mgr_dno Mgr- start- date John 1 M Franklin 2 M NULL NULL Alicia 3 F NULL NULL Jennifer 4 F NULL NULL Joyce 5 F NULL NULL Ahmed 6 M James 7 M

17 Mapping of Binary 1:1 RelaKonship Types Using the same approach, but choosing the relakon T instead the relakon S. Dname Dnumber Research 5 AdministraKon 4 Headquarters 1???? Mgr???? Fname Ssn Sex Mgr_dno Mgr- start- date John 1 M Franklin 2 M NULL NULL Alicia 3 F NULL NULL Jennifer 4 F NULL NULL Joyce 5 F NULL NULL Ahmed 6 M James 7 M

18 Mapping of Binary 1:1 RelaKonship Types Using the same approach, but choosing the relakon T instead the relakon S. Dname Dnumber Research 5 AdministraKon 4 Headquarters 1???? Mgr???? Fname Ssn Sex Mgr_dno Mgr- start- date John 1 M Franklin 2 M NULL NULL Alicia 3 F NULL NULL Jennifer 4 F NULL NULL Joyce 5 F NULL NULL Ahmed 6 M James 7 M

19 Mapping of Binary 1:1 RelaKonship Types 2. Merged relakon approach: An alternakve mapping is to merge the two enkty types and the relakonship into a single relakon. This is possible when both parkcipakons are total, as this would indicate that the two tables will have the exact same number of tuples at all Kmes. 3. Cross- reference or relakonship relakon approach: The third opkon is to set up a third relakon R for the purpose of cross- referencing the primary keys of the two relakons S and T represenkng the enkty type. The relakon R will include the primary key apributes of S and T as foreign keys to S and T. The primary key of R will be one of the two foreign keys, and the other foreign key will be a unique key of R.

20 Mapping of Binary 1:N RelaKonship Types For each regular binary 1:N relakonship type R, idenkfy the relakon S that represents the parkcipakng enkty type at the N- side of the relakonship type; Include as foreign key in S the primary key of the relakon T that represents the other enkty type parkcipakng in R; Be careful! Include any simple apributes (or simple components of composite apributes) of the 1:N relakonship type as apributes of S.

21 Mapping of Binary 1:N RelaKonship Types Be careful! For each regular binary 1:N relakonship type R, idenkfy the relakon S that represents the parkcipakng enkty type at the N- side of the relakonship type; Include as foreign key in S the primary key of the relakon T that represents the other enkty type parkcipakng in R; Include any simple apributes (or simple components of composite apributes) of the 1:N relakonship type as apributes of S. A cross- reference approach is also possible.

22 Mapping of Binary 1:N RelaKonship Types

23 Mapping of Binary M:N RelaKonship Types For each binary M:N relakonship type R, create a new relakon S to represent R. Include as foreign key apributes in S the primary keys of the relakons that represent the parkcipakng enkty types; their COMBINATION will form the primary key of S. Also includes any simple apributes of the M:N relakonship type (or simple components of composite apributes) as apribute of S.

24 Mapping of Binary M:N RelaKonship Types For each binary M:N relakonship type R, create a new relakon S to represent R. Include as foreign key apributes in S the primary keys of the relakons that represent the parkcipakng enkty types; their COMBINATION will form the primary key of S. Also includes any simple apributes of the M:N relakonship type (or simple components of composite apributes) as apribute of S.

25 Mapping of Binary M:N RelaKonship Types

26 Mapping of Binary M:N RelaKonship Types

27 Mapping of Binary M:N RelaKonship Types

28 RelaKonal Model (complete)

29 Analysing

30 Mapping of N- ary RelaKonship Types For each n- ary relakonship type R, where n>2, create a new relakon S to represent R. Include as foreign key apributes in S the primary keys of the relakons that represent the parkcipakng enkty types. Include any simple apributes of the n- ary relakonship type (or simple components of composite apributes) as apributes of S. The primary key of S is usually a combinakon of all the foreign keys that reference the relakons represenkng the parkcipakng enkty types. If the cardinality constraints on any of the enkty types E parkcipakng in R is 1, then the primary key of S should no include the foreign key apribute that references relakon E corresponding to E. K N 1 N M M

31 Mapping of N- ary RelaKonship Types K N 1 N M M

32 Mapping of N- ary RelaKonship Types Sname A B Proj_name Alfa Beta Part_no 1 2 C Gama 3 Sname Proj_name Part_no Quan2ty A Alfa 1 20 A Alfa 2 20 B Alfa 1 20 B Beta 1 10 C Beta 1 20 C Beta 3 40

33 Mapping of N- ary RelaKonship Types Sname A B Proj_name Alfa Beta Part_no 1 2 C Gama 3 Sname Proj_name Part_no Quan2ty A Alfa 1 20 A Alfa 2 20 B Alfa 3 20 B Beta 1 10 C Beta 2 20 C Beta 3 40

34 Mapping of SpecializaKon or GeneralizaKon NotaKon: APrs(R): apributes of relakon R PK(R): primary key of R OpKons for Mapping SpecializaKon or GeneralizaKon: Convert each specializakon with m subclasses {S 1, S 2,, S m } and (generalized) superclass C, where the apributes of C are {k, a 1,, a n } and k is the (primary) key, into relakon schemas using one of the following opkons: OpKon A: MulKple relakons superclass and subclasses; OpKon B: MulKple relakons subclass relakons only; OpKon C: Single relakons with one type apribute; OpKon D: Single relakon with mulkple type apributes.

35 Mapping of SpecializaKon or GeneralizaKon OpKon A: MulKple relakons superclass and subclasses. Create a relakon L for C with apributes APrs(L) = {k, a 1,, a n } and PK(L) = k. Create a relakons L i for each subclass S i, 1 <= i <= m, with the apributes APrs(L i ) = {k} U {apributes of S i } and PK(L i ) = k. This opkon works for any specializakon (total or parkal, disjoint or overlapping).

36 Mapping of SpecializaKon or GeneralizaKon OpKon A: MulKple relakons superclass and subclasses. Create a relakon L for C with apributes APrs(L) = {k, a 1,, a n } and PK(L) = k. Create a relakons L i for each subclass S i, 1 <= i <= m, with the apributes APrs(L i ) = {k} U {apributes of S i } and PK(L i ) = k. This opkon works for any specializakon (total or parkal, disjoint or overlapping).

37 Mapping of SpecializaKon or GeneralizaKon OpKon A: MulKple relakons superclass and subclasses.

38 Mapping of SpecializaKon or GeneralizaKon OpKon B: MulKple relakons subclass relakons only. Create a relakon L i for each subclass S i, 1 <= i <= m, with the apributes APrs(Li) = {apributes of S i } U {k, a i,, a n } and PK(L i ) = k. This opkon only works for a specializakon whose subclasses are total. AddiKonally, it is only recommended if the specializakon has the disjointedness constraint. If the specializakon is overlapping, the same enkty may be duplicated in several relakons.

39 Mapping of SpecializaKon or GeneralizaKon OpKon B: MulKple relakons subclass relakons only. Create a relakon L i for each subclass S i, 1 <= i <= m, with the apributes APrs(Li) = {apributes of S i } U {k, a i,, a n } and PK(L i ) = k. This opkon only works for a specializakon whose subclasses are total. AddiKonally, it is only recommended if the specializakon has the disjointedness constraint. If the specializakon is overlapping, the same enkty may be duplicated in several relakons.

40 Mapping of SpecializaKon or GeneralizaKon OpKon B: MulKple relakons subclass relakons only.

41 Mapping of SpecializaKon or GeneralizaKon OpKon C: Single relakons with one type apribute. Create a single relakon L with apributes APrs(L) = {k, a 1,, a n } U {apributes of S i } U U {apributes of S i } U {t} and PK(L) = k. The apribute t is called a type (or discriminakng) apribute whose value indicates the subclass to which each tuple belongs, if any. This opkons works only for specializakon whose subclasses are disjoint, and has the potenkal for generakng many NULL values if many specific apributes exist in the subclasses.

42 Mapping of SpecializaKon or GeneralizaKon OpKon C: Single relakons with one type apribute. Create a single relakon L with apributes APrs(L) = {k, a 1,, a n } U {apributes of S i } U U {apributes of S i } U {t} and PK(L) = k. The apribute t is called a type (or discriminakng) apribute whose value indicates the subclass to which each tuple belongs, if any. This opkons works only for specializakon whose subclasses are disjoint, and has the potenkal for generakng many NULL values if many specific apributes exist in the subclasses.

43 Mapping of SpecializaKon or GeneralizaKon OpKon C: Single relakons with one type apribute.

44 Mapping of SpecializaKon or GeneralizaKon OpKon D: Single relakon with mulkple type apributes. Create a single relakon schema L with apributes APrs(L) = {k, a 1,, a n } U {apributes of S 1 } U U {apributes of S m } U {t 1, t 2,, t m } and PK(L) = k. Each t i, 1 <= i <= m, is a Boolean type apribute indicakng whether a tuple belongs to subclass S i. This opkon is used for a specializakon whose subclasses are overlapping (but will also work for a disjoint specializakon).

45 Mapping of SpecializaKon or GeneralizaKon OpKon D: Single relakon with mulkple type apributes. Create a single relakon schema L with apributes APrs(L) = {k, a 1,, a n } U {apributes of S 1 } U U {apributes of S m } U {t 1, t 2,, t m } and PK(L) = k. Each t i, 1 <= i <= m, is a Boolean type apribute indicakng whether a tuple belongs to subclass S i. This opkon is used for a specializakon whose subclasses are overlapping (but will also work for a disjoint specializakon).

46 Mapping of SpecializaKon or GeneralizaKon OpKon D: Single relakon with mulkple type apributes.

47 MulKlevel specializakon (or generalizakon)

48 MulKlevel specializakon (or generalizakon)

49 Sarajane Marques Peres, Ph.D. University of São Paulo Based on Elsmari, Navathe / Silberschatz, Korth, Sudarshan s books ER MODEL à R MODEL

ER to Relational Mapping

ER to Relational Mapping ER to Relational Mapping 1 / 19 ER to Relational Mapping Step 1: Strong Entities Step 2: Weak Entities Step 3: Binary 1:1 Relationships Step 4: Binary 1:N Relationships Step 5: Binary M:N Relationships

More information

Chapter 9: Relational DB Design byer/eer to Relational Mapping Relational Database Design Using ER-to- Relational Mapping Mapping EER Model

Chapter 9: Relational DB Design byer/eer to Relational Mapping Relational Database Design Using ER-to- Relational Mapping Mapping EER Model Chapter 9: Relational DB Design byer/eer to Relational Mapping Relational Database Design Using ER-to- Relational Mapping Mapping EER Model Constructs to Relations Relational Database Design by ER- and

More information

Chapter 7 Relational Database Design by ER- and EERR-to-Relational Mapping

Chapter 7 Relational Database Design by ER- and EERR-to-Relational Mapping Chapter 7 Relational Database Design by ER- and EERR-to-Relational Mapping Copyright 2004 Pearson Education, Inc. Chapter Outline ER-to-Relational Mapping Algorithm Step 1: Mapping of Regular Entity Types

More information

Relational DB Design by ER- and EER-to-Relational Mapping Design & Analysis of Database Systems

Relational DB Design by ER- and EER-to-Relational Mapping Design & Analysis of Database Systems Relational DB Design by ER- and EER-to-Relational Mapping 406.426 Design & Analysis of Database Systems Jonghun Park jonghun@snu.ac.kr Dept. of Industrial Engineering Seoul National University outline

More information

Database Management

Database Management 204320 - Database Management Chapter 9 Relational Database Design by ER and EERto-Relational Mapping Adapted for 204320 by Areerat Trongratsameethong Copyright 2011 Pearson Education, Inc. Publishing as

More information

Outline. Note 1. CSIE30600 Database Systems ER/EER to Relational Mapping 2

Outline. Note 1. CSIE30600 Database Systems ER/EER to Relational Mapping 2 Outline ER-to-Relational Mapping Algorithm Step 1: Mapping of Regular Entity Types Step 2: Mapping of Weak Entity Types Step 3: Mapping of Binary 1:1 Relation Types Step 4: Mapping of Binary 1:N Relationship

More information

COSC344 Database Theory and Applications. σ a= c (P) S. Lecture 4 Relational algebra. π A, P X Q. COSC344 Lecture 4 1

COSC344 Database Theory and Applications. σ a= c (P) S. Lecture 4 Relational algebra. π A, P X Q. COSC344 Lecture 4 1 COSC344 Database Theory and Applications σ a= c (P) S π A, C (H) P P X Q Lecture 4 Relational algebra COSC344 Lecture 4 1 Overview Last Lecture Relational Model This Lecture ER to Relational mapping Relational

More information

MIT Database Management Systems Lesson 03: ER-to-Relational Mapping

MIT Database Management Systems Lesson 03: ER-to-Relational Mapping MIT 22033 Database Management Systems Lesson 03: ER-to-Relational Mapping By S. Sabraz Nawaz Senior Lecturer in MIT Department of Management and IT, SEUSL Chapter Outline ER-to-Relational Mapping Algorithm

More information

This chapter discusses how to design a relational

This chapter discusses how to design a relational 9 chapter Relational Database Design by ER- and EER-to-Relational Mapping This chapter discusses how to design a relational database schema based on a conceptual schema design. Figure 7.1 presented a high-level

More information

ER-to-Relational Mapping

ER-to-Relational Mapping Lecture 9 1 1. Context 2. The Algorithm Outline 2 Database Design and Implementation Process 3 Data Models 4 Example ERD 5 Resulting Relational Schema 6 Step 1: Regular Entity Types i. For each regular/strong

More information

Chapter 9 Outline. Relational Database Design by ER and EERto-Relational. Mapping Fundamentals of Database Systems

Chapter 9 Outline. Relational Database Design by ER and EERto-Relational. Mapping Fundamentals of Database Systems 204222 - Fundamentals of Database Systems Chapter 9 Relational Database Design by ER and EERto-Relational Mapping Chapter 9 Outline Relational Database Design Using ER-to- Relational Mapping Relational

More information

Database Management System (15ECSC208) UNIT I: Chapter 2: Relational Data Model and Relational Algebra

Database Management System (15ECSC208) UNIT I: Chapter 2: Relational Data Model and Relational Algebra Database Management System (15ECSC208) UNIT I: Chapter 2: Relational Data Model and Relational Algebra Relational Data Model and Relational Constraints Part 1 A simplified diagram to illustrate the main

More information

Translation of ER-diagram into Relational Schema. Dr. Sunnie S. Chung CIS430/530

Translation of ER-diagram into Relational Schema. Dr. Sunnie S. Chung CIS430/530 Translation of ER-diagram into Relational Schema Dr. Sunnie S. Chung CIS430/530 Learning Objectives Define each of the following database terms 9.2 Relation Primary key Foreign key Referential integrity

More information

Some different database system architectures. (a) Shared nothing architecture.

Some different database system architectures. (a) Shared nothing architecture. Figure.1 Some different database system architectures. (a) Shared nothing architecture. Computer System 1 Computer System CPU DB CPU DB MEMORY MEMORY Switch Computer System n CPU DB MEMORY Figure.1 continued.

More information

Advanced Databases (SE487) Prince Sultan University College of Computer and Information Sciences

Advanced Databases (SE487) Prince Sultan University College of Computer and Information Sciences Advanced Databases (SE487) Prince Sultan University College of Computer and Information Sciences ER to Relational Mapping Anis Koubaa Chapter 9 Outline } Relational Database Design Using ER-to-Relational

More information

Topic 5: Mapping of EER Diagrams to Relations

Topic 5: Mapping of EER Diagrams to Relations Topic 5: Mapping of EER Diagrams to Relations Olaf Hartig olaf.hartig@liu.se Recall: DB Design Process 2 Running Example 3 Algorithm for Mapping from the ER Model to the Relational Model Step 1: Map Regular

More information

Ch 9: Mapping EER to Relational. Follow a seven-step algorithm to convert the basic ER model constructs into relations steps 1-7

Ch 9: Mapping EER to Relational. Follow a seven-step algorithm to convert the basic ER model constructs into relations steps 1-7 Ch 9: Mapping EER to Relational Follow a seven-step algorithm to convert the basic ER model constructs into relations steps 1-7 Additional steps for EER model for specialization/generalization steps 8a

More information

Translation of ER-diagram into Relational Schema. Dr. Sunnie S. Chung CIS430/530

Translation of ER-diagram into Relational Schema. Dr. Sunnie S. Chung CIS430/530 Translation of ER-diagram into Relational Schema Dr. Sunnie S. Chung CIS430/530 Learning Objectives Define each of the following database terms 9.2 Relation Primary key Foreign key Referential integrity

More information

Mapping ER Diagrams to. Relations (Cont d) Mapping ER Diagrams to. Exercise. Relations. Mapping ER Diagrams to Relations (Cont d) Exercise

Mapping ER Diagrams to. Relations (Cont d) Mapping ER Diagrams to. Exercise. Relations. Mapping ER Diagrams to Relations (Cont d) Exercise CSC 74 Database Management Systems Topic #6: Database Design Weak Entity Type E Create a relation R Include all simple attributes and simple components of composite attributes. Include the primary key

More information

Translation ER/EER to relational

Translation ER/EER to relational Database technology Lecture 4: Mapping of EER model to relations Jose M. Peña jose.m.pena@liu.se Translation ER/EER to relational Migrate from mini world model to a model understandable by a DBMS. 1 EER

More information

Course Notes on From Entity-Relationship Schemas to Relational Schemas

Course Notes on From Entity-Relationship Schemas to Relational Schemas Course Notes on From Entity-Relationship Schemas to Relational Schemas The chapter deals with practical database design: the construction of a relational schema from an E-R schema this stage of database

More information

Part 1 on Table Function

Part 1 on Table Function CIS611 Lab Assignment 1 SS Chung 1. Write Table Functions 2. Automatic Creation and Maintenance of Database from Web Interface 3. Transforming a SQL Query into an Execution Plan in Relational Algebra for

More information

Database design process

Database design process Database technology Lecture 2: Relational databases and SQL Jose M. Peña jose.m.pena@liu.se Database design process 1 Relational model concepts... Attributes... EMPLOYEE FNAME M LNAME SSN BDATE ADDRESS

More information

Database Systems ER Model. A.R. Hurson 323 CS Building

Database Systems ER Model. A.R. Hurson 323 CS Building ER Model A.R. Hurson 323 CS Building Database Design Data model is a group of concepts that helps to specify the structure of a database and a set of associated operations allowing data retrieval and data

More information

CIS611 Lab Assignment 1 SS Chung

CIS611 Lab Assignment 1 SS Chung CIS611 Lab Assignment 1 SS Chung 1. Creating a Relational Database Schema from ER Diagram, Populating the Database and Querying Over the database with SQL 2. Automatic Creation and Maintenance of Database

More information

Session Active Databases (2+3 of 3)

Session Active Databases (2+3 of 3) INFO-H-415 - Advanced Databes Session 2+3 - Active Databes (2+3 of 3) Consider the following databe schema: DeptLocation DNumber DLocation Employee FName MInit LName SSN BDate Address Sex Salary SuperSSN

More information

PES Institute of Technology Bangalore South Campus (1 K.M before Electronic City,Bangalore ) Department of MCA. Solution Set - Test-II

PES Institute of Technology Bangalore South Campus (1 K.M before Electronic City,Bangalore ) Department of MCA. Solution Set - Test-II PES Institute of Technology Bangalore South Campus (1 K.M before Electronic City,Bangalore 560100 ) Solution Set - Test-II Sub: Database Management Systems 16MCA23 Date: 04/04/2017 Sem & Section:II Duration:

More information

Relational Model. CS 377: Database Systems

Relational Model. CS 377: Database Systems Relational Model CS 377: Database Systems ER Model: Recap Recap: Conceptual Models A high-level description of the database Sufficiently precise that technical people can understand it But, not so precise

More information

Relational Algebra Part I. CS 377: Database Systems

Relational Algebra Part I. CS 377: Database Systems Relational Algebra Part I CS 377: Database Systems Recap of Last Week ER Model: Design good conceptual models to store information Relational Model: Table representation with structures and constraints

More information

RELATIONAL DATA MODEL

RELATIONAL DATA MODEL RELATIONAL DATA MODEL 3.1 Introduction The relational model of data was introduced by Codd (1970). It is based on a simple and uniform data structure - the relation - and has a solid theoretical and mathematical

More information

CONCEPTUAL DESIGN: ER TO RELATIONAL TO SQL

CONCEPTUAL DESIGN: ER TO RELATIONAL TO SQL RELATIONAL MODEL TO Data Model CONCEPTUAL DESIGN: ER TO RELATIONAL TO How to represent Entity sets, Relationship sets, Attributes, Key and participation constraints, Subclasses, Weak entity sets...? 2

More information

Chapter 17. Methodology Logical Database Design for the Relational Model

Chapter 17. Methodology Logical Database Design for the Relational Model Chapter 17 Methodology Logical Database Design for the Relational Model Chapter 17 - Objectives How to derive a set of relations from a conceptual data model. How to validate these relations using the

More information

Dr. Anis Koubaa. Advanced Databases SE487. Prince Sultan University

Dr. Anis Koubaa. Advanced Databases SE487. Prince Sultan University Advanced Databases Prince Sultan University College of Computer and Information Sciences Fall 2013 Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases Anis Koubaa SE487

More information

Overview Relational data model

Overview Relational data model Thanks to José and Vaida for most of the slides. Relational databases and MySQL Juha Takkinen juhta@ida.liu.se Outline 1. Introduction: Relational data model and SQL 2. Creating tables in Mysql 3. Simple

More information

Database Technology. Topic 3: SQL. Olaf Hartig.

Database Technology. Topic 3: SQL. Olaf Hartig. Olaf Hartig olaf.hartig@liu.se Structured Query Language Declarative language (what data to get, not how) Considered one of the major reasons for the commercial success of relational databases Statements

More information

Query 2: Pnumber Dnum Lname Address Bdate 10 4 Wallace 291 Berry, Bellaire, TX Wallace 291 Berry, Bellaire, TX

Query 2: Pnumber Dnum Lname Address Bdate 10 4 Wallace 291 Berry, Bellaire, TX Wallace 291 Berry, Bellaire, TX 5.11 No violation, integrity is retained. Dnum = 2 does not exist. This can be solved by adding a foreign key referencing the department table, so the operation does not execute. Dnum = 4 already exists,

More information

Relational Database Systems Part 01. Karine Reis Ferreira

Relational Database Systems Part 01. Karine Reis Ferreira Relational Database Systems Part 01 Karine Reis Ferreira karine@dpi.inpe.br Aula da disciplina Computação Aplicada I (CAP 241) 2016 Database System Database: is a collection of related data. represents

More information

High Level Database Models

High Level Database Models ICS 321 Fall 2011 High Level Database Models Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 9/21/2011 Lipyeow Lim -- University of Hawaii at Manoa 1 Database

More information

LECTURE 6: GUIDELINES FOR GOOD RELATIONAL DESIGN MAPPING ERD TO RELATIONS

LECTURE 6: GUIDELINES FOR GOOD RELATIONAL DESIGN MAPPING ERD TO RELATIONS LECTURE 6: GUIDELINES FOR GOOD RELATIONAL DESIGN MAPPING ERD TO RELATIONS Ref. Chapter 16 Logical Database Design Methodology for the Relational Model 1 Objectives 2 How to derive a set of relations from

More information

Entity Relationship Data Model. Slides by: Shree Jaswal

Entity Relationship Data Model. Slides by: Shree Jaswal Entity Relationship Data Model Slides by: Shree Jaswal Topics: Conceptual Modeling of a database, The Entity-Relationship (ER) Model, Entity Types, Entity Sets, Attributes, and Keys, Relationship Types,

More information

Translating an ER Diagram to a Relational Schema

Translating an ER Diagram to a Relational Schema Translating an ER Diagram to a Relational Schema CS386/586 Introduction to Database Systems, Lois Delcambre 1999-2009 Slide 1 Translate each entity set into a table, with keys. Entity set: represented

More information

Informatics 1: Data & Analysis

Informatics 1: Data & Analysis Informatics 1: Data & Analysis Lecture 4: From ER Diagrams to Relational Models Ian Stark School of Informatics The University of Edinburgh Friday 24 January 2014 Semester 2 Week 2 http://www.inf.ed.ac.uk/teaching/courses/inf1/da

More information

Database Technology. Topic 2: Relational Databases and SQL. Olaf Hartig.

Database Technology. Topic 2: Relational Databases and SQL. Olaf Hartig. Topic 2: Relational Databases and SQL Olaf Hartig olaf.hartig@liu.se Relational Data Model Recall: DB Design Process 3 Relational Model Concepts Relational database: represent data as a collection of relations

More information

DATABASE DESIGN I - 1DL300

DATABASE DESIGN I - 1DL300 DATABASE DESIGN I - 1DL300 Fall 2009 An introductury course on database systems http://user.it.uu.se/~udbl/dbt1-ht2009/ alt. http://www.it.uu.se/edu/course/homepage/dbastekn/ht09/ Kjell Orsborn Uppsala

More information

Chapter 2: Entity-Relationship Model

Chapter 2: Entity-Relationship Model Chapter 2: Entity-Relationship Model! Entity Sets! Relationship Sets! Design Issues! Mapping Constraints! Keys! E-R Diagram! Extended E-R Features! Design of an E-R Database Schema! Reduction of an E-R

More information

Relational Model: History

Relational Model: History Relational Model: History Objectives of Relational Model: 1. Promote high degree of data independence 2. Eliminate redundancy, consistency, etc. problems 3. Enable proliferation of non-procedural DML s

More information

DATABASDESIGN FÖR INGENJÖRER F

DATABASDESIGN FÖR INGENJÖRER F 1 DATABASDESIGN FÖR INGENJÖRER - 1056F Sommar 2005 En introduktionskurs i databassystem http://user.it.uu.se/~udbl/dbt-sommar05/ alt. http://www.it.uu.se/edu/course/homepage/dbdesign/st05/ Kjell Orsborn

More information

NOTE: DO NOT REMOVE THIS EXAM PAPER FROM THE EXAM VENUE

NOTE: DO NOT REMOVE THIS EXAM PAPER FROM THE EXAM VENUE Exams, Awards & Graduations NOTE: DO NOT REMOVE THIS EXAM PAPER FROM THE EXAM VENUE EXAM COVER SHEET EXAMINATION DETAILS Course Code/s: ISYS1055/1057 Course Name/s: Database Concepts Date of Exam: Sample

More information

Database Design Process

Database Design Process Database Design Process Real World Functional Requirements Requirements Analysis Database Requirements Functional Analysis Access Specifications Application Pgm Design E-R Modeling Choice of a DBMS Data

More information

We shall represent a relation as a table with columns and rows. Each column of the table has a name, or attribute. Each row is called a tuple.

We shall represent a relation as a table with columns and rows. Each column of the table has a name, or attribute. Each row is called a tuple. Logical Database design Earlier we saw how to convert an unorganized text description of information requirements into a conceptual design, by the use of ER diagrams. The advantage of ER diagrams is that

More information

COSC Assignment 2

COSC Assignment 2 COSC 344 Overview In this assignment, you will turn your miniworld into a set of Oracle tables, normalize your design, and populate your database. Due date for assignment 2 Friday, 25 August 2017 at 4

More information

High-Level Database Models (ii)

High-Level Database Models (ii) ICS 321 Spring 2011 High-Level Database Models (ii) Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 1 Logical DB Design: ER to Relational Entity sets to

More information

Security Event System (SES) Joint Techs July 2009

Security Event System (SES) Joint Techs July 2009 Security Event System (SES) Joint Techs July 2009 Credits SES is a project in the REN ISAC community, with project funding from: the U.S. Department of JusKce, and the cooperakon and support of: Internet2,

More information

DATABASE DESIGN I - 1DL300

DATABASE DESIGN I - 1DL300 DATABASE DESIGN I - 1DL300 Fall 2010 An introductory course on database systems http://www.it.uu.se/edu/course/homepage/dbastekn/ht10/ Manivasakan Sabesan Uppsala Database Laboratory Department of Information

More information

Relational Model and Relational Algebra. Slides by: Ms. Shree Jaswal

Relational Model and Relational Algebra. Slides by: Ms. Shree Jaswal Relational Model and Relational Algebra Slides by: Ms. Shree Jaswal Topics: Introduction to Relational Model, Relational Model Constraints and Relational Database Schemas, Concept of Keys: Primary Kay,

More information

Advanced Databases. Winter Term 2012/13. Prof. Dr. Dietmar Seipel University of Würzburg. Advanced Databases Winter Term 2012/13

Advanced Databases. Winter Term 2012/13. Prof. Dr. Dietmar Seipel University of Würzburg. Advanced Databases Winter Term 2012/13 Advanced Databases Winter Term 2012/13 Prof. Dr. Dietmar Seipel University of Würzburg Prof. Dr. Dietmar Seipel Minit FName LName Sex Adress Salary N WORKS_FOR 1 Name Number Locations Name SSN EMPLOYEE

More information

Information Systems Development 37C Lecture: Final notes. 30 th March 2017 Dr. Riitta Hekkala

Information Systems Development 37C Lecture: Final notes. 30 th March 2017 Dr. Riitta Hekkala Information Systems Development 37C00200 Lecture: Final notes 30 th March 2017 Dr. Riitta Hekkala The course should have given you Introduction to the information system development process Understanding

More information

Chapter 6: RELATIONAL DATA MODEL AND RELATIONAL ALGEBRA

Chapter 6: RELATIONAL DATA MODEL AND RELATIONAL ALGEBRA Chapter 6: Relational Data Model and Relational Algebra 1 Chapter 6: RELATIONAL DATA MODEL AND RELATIONAL ALGEBRA RELATIONAL MODEL CONCEPTS The relational model represents the database as a collection

More information

In Chapters 3 through 6, we presented various aspects

In Chapters 3 through 6, we presented various aspects 15 chapter Basics of Functional Dependencies and Normalization for Relational Databases In Chapters 3 through 6, we presented various aspects of the relational model and the languages associated with it.

More information

Querying a Relational Database COMPANY database For Lab4, you use the Company database that you built in Lab2 and used for Lab3

Querying a Relational Database COMPANY database For Lab4, you use the Company database that you built in Lab2 and used for Lab3 CIS30/530 Lab Assignment SS Chung Querying a Relational Database COMPANY database For Lab, you use the Company database that you built in Lab2 and used for Lab3 1. Update the following new changes into

More information

SVY2001: Databases for GIS

SVY2001: Databases for GIS SVY200: Databases for GIS Lecture 0: From ER & EER odels to Relation Scheme. Dr Stuart Barr School of Civil Engineering & Geosciences University of Newcastle upon Tyne. Email: S.L.Barr@ncl.ac.uk Lecture

More information

EECS 647: Introduction to Database Systems

EECS 647: Introduction to Database Systems EECS 647: Introduction to Database Systems Instructor: Luke Huan Spring 2009 Administrative I have communicated with KU Bookstore inquring about the text book status. Take home background survey is due

More information

How to translate ER Model to Relational Model

How to translate ER Model to Relational Model How to translate ER Model to Relational Model Review - Concepts 2 Relational Model is made up of tables A row of table = a relational instance/tuple A column of table = an attribute A table = a schema/relation

More information

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

1. Considering functional dependency, one in which removal from some attributes must affect dependency is called Q.1 Short Questions Marks 1. Considering functional dependency, one in which removal from some attributes must affect dependency is called 01 A. full functional dependency B. partial dependency C. prime

More information

DATABASTEKNIK - 1DL116

DATABASTEKNIK - 1DL116 1 DATABASTEKNIK - 1DL116 Fall 2003 An introductury course on database systems http://user.it.uu.se/~udbl/dbt-ht2003/ Kjell Orsborn Uppsala Database Laboratory Department of Information Technology, Uppsala

More information

COMP Instructor: Dimitris Papadias WWW page:

COMP Instructor: Dimitris Papadias WWW page: COMP 5311 Instructor: Dimitris Papadias WWW page: http://www.cse.ust.hk/~dimitris/5311/5311.html Textbook Database System Concepts, A. Silberschatz, H. Korth, and S. Sudarshan. Reference Database Management

More information

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

Lecture4: Guidelines for good relational design Mapping ERD to Relation. Ref. Chapter3 College of Computer and Information Sciences - Information Systems Dept. Lecture4: Guidelines for good relational design Mapping ERD to Relation. Ref. Chapter3 Prepared by L. Nouf Almujally & Aisha AlArfaj

More information

Course Notes on Relational Algebra

Course Notes on Relational Algebra Course Notes on Relational Algebra What is the Relational Algebra? Relational Algebra: Summary Operators Selection Projection Union, Intersection, Difference Cartesian Product Join Division Equivalences

More information

Data Modeling Using the Entity-Relationship (ER) Model

Data Modeling Using the Entity-Relationship (ER) Model CHAPTER 3 Data Modeling Using the Entity-Relationship (ER) Model Copyright 2017 Ramez Elmasri and Shamkant B. Navathe Slide 1-1 Chapter Outline Overview of Database Design Process Example Database Application

More information

Chapter (4) Enhanced Entity-Relationship and Object Modeling

Chapter (4) Enhanced Entity-Relationship and Object Modeling Chapter (4) Enhanced Entity-Relationship and Object Modeling Objectives Concepts of subclass and superclass and the related concepts of specialization and generalization. Concept of category, which is

More information

CS 405G: Introduction to Database Systems

CS 405G: Introduction to Database Systems CS 405G: Introduction to Database Systems Entity Relationship Model Jinze Liu 9/11/2014 1 CS685 : Special The UNIVERSITY Topics in Data of Mining, KENTUCKY UKY Review A database is a large collection of

More information

ERRDS: A CASE TOOL TO GENERATE AN ER DATA MODEL FROM A RELATIONAL DATABASE SCHEMA

ERRDS: A CASE TOOL TO GENERATE AN ER DATA MODEL FROM A RELATIONAL DATABASE SCHEMA ERRDS: A CASE TOOL TO GENERATE AN ER DATA MODEL FROM A RELATIONAL DATABASE SCHEMA NABIL ARMAN Palestine Polytechnic University Hebron, Palestine Abstract: A relational database (RDB) schema is a description

More information

From ER to Relational Model. Book Chapter 3 (part 2 )

From ER to Relational Model. Book Chapter 3 (part 2 ) From ER to Relational Model Book Chapter 3 (part 2 ) Logical DB Design: ER to Relational Translate Entity sets to tables: ssn name Employees lot CREATE TABLE Employees (ssn CHAR(11), name CHAR(20), lot

More information

Contents. Database. Information Policy. C03. Entity Relationship Model WKU-IP-C03 Database / Entity Relationship Model

Contents. Database. Information Policy. C03. Entity Relationship Model WKU-IP-C03 Database / Entity Relationship Model Information Policy Database C03. Entity Relationship Model Code: 164323-03 Course: Information Policy Period: Spring 2013 Professor: Sync Sangwon Lee, Ph. D 1 Contents 01. Overview of Database Design 02.

More information

Relational Databases BORROWED WITH MINOR ADAPTATION FROM PROF. CHRISTOS FALOUTSOS, CMU /615

Relational Databases BORROWED WITH MINOR ADAPTATION FROM PROF. CHRISTOS FALOUTSOS, CMU /615 Relational Databases BORROWED WITH MINOR ADAPTATION FROM PROF. CHRISTOS FALOUTSOS, CMU 15-415/615 Roadmap 3 Introduction Integrity constraints (IC) Enforcing IC Querying Relational Data ER to tables Intro

More information

Using High-Level Conceptual Data Models for Database Design A Sample Database Application Entity Types, Entity Sets, Attributes, and Keys

Using High-Level Conceptual Data Models for Database Design A Sample Database Application Entity Types, Entity Sets, Attributes, and Keys Chapter 7: Data Modeling Using the Entity- Relationship (ER) Model Using High-Level Conceptual Data Models for Database Design A Sample Database Application Entity Types, Entity Sets, Attributes, and Keys

More information

E-R Diagram to Relational Schema

E-R Diagram to Relational Schema Database Design ICOM 5016 Database Systems Database Design Amir H. Chinaei Department of Electrical and Computer Engineering University of Puerto Rico, Mayagüez Slides are adapted from: The first step

More information

CIS 330: Applied Database Systems. ER to Relational Relational Algebra

CIS 330: Applied Database Systems. ER to Relational Relational Algebra CIS 330: Applied Database Systems ER to Relational Relational Algebra 1 Logical DB Design: ER to Relational Entity sets to tables: ssn name Employees lot CREATE TABLE Employees (ssn CHAR(11), name CHAR(20),

More information

Relational Calculus: 1

Relational Calculus: 1 CSC 742 Database Management Systems Topic #8: Relational Calculus Spring 2002 CSC 742: DBMS by Dr. Peng Ning 1 Relational Calculus: 1 Can define the information to be retrieved not any specific series

More information

Chapter 6: Entity-Relationship Model

Chapter 6: Entity-Relationship Model Chapter 6: Entity-Relationship Model Database System Concepts, 5th Ed. See www.db-book.com for conditions on re-use Chapter 6: Entity-Relationship Model Design Process Modeling Constraints E-R Diagram

More information

The Relational Model. Outline. Why Study the Relational Model? Faloutsos SCS object-relational model

The Relational Model. Outline. Why Study the Relational Model? Faloutsos SCS object-relational model The Relational Model CMU SCS 15-415 C. Faloutsos Lecture #3 R & G, Chap. 3 Outline Introduction Integrity constraints (IC) Enforcing IC Querying Relational Data ER to tables Intro to Views Destroying/altering

More information

Data Modeling with the Entity Relationship Model. CS157A Chris Pollett Sept. 7, 2005.

Data Modeling with the Entity Relationship Model. CS157A Chris Pollett Sept. 7, 2005. Data Modeling with the Entity Relationship Model CS157A Chris Pollett Sept. 7, 2005. Outline Conceptual Data Models and Database Design An Example Application Entity Types, Sets, Attributes and Keys Relationship

More information

Conceptual Data Models for Database Design

Conceptual Data Models for Database Design Conceptual Data Models for Database Design Entity Relationship (ER) Model The most popular high-level conceptual data model is the ER model. It is frequently used for the conceptual design of database

More information

DC62 DATABASE MANAGEMENT SYSTEMS DEC 2013

DC62 DATABASE MANAGEMENT SYSTEMS DEC 2013 Q.2 (a) What are the different types of database end users? Discuss the main activities of each. End users are the people whose jobs require access to the database for querying, updating, and generating

More information

Chapter 6: Entity-Relationship Model

Chapter 6: Entity-Relationship Model Chapter 6: Entity-Relationship Model Database System Concepts, 5th Ed. See www.db-book.com for conditions on re-use Chapter 6: Entity-Relationship Model Design Process Modeling Constraints E-R Diagram

More information

Chapter 6: Entity-Relationship Model. The Next Step: Designing DB Schema. Identifying Entities and their Attributes. The E-R Model.

Chapter 6: Entity-Relationship Model. The Next Step: Designing DB Schema. Identifying Entities and their Attributes. The E-R Model. Chapter 6: Entity-Relationship Model The Next Step: Designing DB Schema Our Story So Far: Relational Tables Databases are structured collections of organized data The Relational model is the most common

More information

Database Applications (15-415)

Database Applications (15-415) Database Applications (15-415) ER to Relational & Relational Algebra Lecture 4, January 20, 2015 Mohammad Hammoud Today Last Session: The relational model Today s Session: ER to relational Relational algebra

More information

CMP-3440 Database Systems

CMP-3440 Database Systems CMP-3440 Database Systems Database Architecture Lecture 02 zain 1 Database Design Process Application 1 Conceptual requirements Application 1 External Model Application 2 Application 3 Application 4 External

More information

Informatics 1: Data & Analysis

Informatics 1: Data & Analysis Informatics 1: Data & Analysis Lecture 4: From ER Diagrams to Relational Models Ian Stark School of Informatics The University of Edinburgh Friday 26 January 2018 Semester 2 Week 2 https://blog.inf.ed.ac.uk/da18

More information

A Translation of the One-to-One Relationship for Introductory. Relational Database Courses

A Translation of the One-to-One Relationship for Introductory. Relational Database Courses 12/17/2002 A Translation of the One-to-One Relationship for Introductory Relational Database Courses Jonathan P. Bernick Department of Computer Science Coastal Carolina University Conway, South Carolina

More information

Database Management System 6 ER Modeling...

Database Management System 6 ER Modeling... Database Management System 6 School of Computer Engineering, KIIT University 6.1 A key allows us to identify a set of attributes that suffice to distinguish entities from each other A key is a property

More information

Relational Design 1 / 34

Relational Design 1 / 34 Relational Design 1 / 34 Relational Design Basic design approaches. What makes a good design better than a bad design? How do we tell we have a "good" design? How to we go about creating a good design?

More information

Relational Algebra & Calculus. CS 377: Database Systems

Relational Algebra & Calculus. CS 377: Database Systems Relational Algebra & Calculus CS 377: Database Systems Quiz #1 Question: What is metadata and why is it important? Answer: Metadata is information about the data such as name, type, size. It is important

More information

The Next Step: Designing DB Schema. Chapter 6: Entity-Relationship Model. The E-R Model. Identifying Entities and their Attributes.

The Next Step: Designing DB Schema. Chapter 6: Entity-Relationship Model. The E-R Model. Identifying Entities and their Attributes. Chapter 6: Entity-Relationship Model Our Story So Far: Relational Tables Databases are structured collections of organized data The Relational model is the most common data organization model The Relational

More information

Translation of ER-diagram into Relational Schema. Dr. Sunnie S. Chung CIS430/530

Translation of ER-diagram into Relational Schema. Dr. Sunnie S. Chung CIS430/530 Translation of ER-diagram into Relational Schema Dr. Sunnie S. Chung CIS430/530 Learning Objectives Define each of the following database terms Relation Primary key Foreign key Referential integrity Field

More information

Database Design & Deployment

Database Design & Deployment ICS 321 Data Storage & Retrieval High Level Database Models Prof. Lipyeow Lim InformaCon & Computer Science Department University of Hawaii at Manoa Lipyeow Lim - - University of Hawaii at Manoa 1 Database

More information

Database Management System (15ECSC208) UNIT I: Chapter 1: Introduction to DBMS and ER-Model

Database Management System (15ECSC208) UNIT I: Chapter 1: Introduction to DBMS and ER-Model Database Management System (15ECSC208) UNIT I: Chapter 1: Introduction to DBMS and ER-Model Data Modeling Using the Entity Relationship Model Part 3 Review Conceptual Schema Outcome of the high-level

More information

LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER)

LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) Ref. Chapter12 from Database Systems: A Practical Approach to Design, Implementation and Management. Thomas Connolly, Carolyn Begg. IS220 : D at

More information

OBJECTIVES. How to derive a set of relations from a conceptual data model. How to validate these relations using the technique of normalization.

OBJECTIVES. How to derive a set of relations from a conceptual data model. How to validate these relations using the technique of normalization. 7.5 逻辑数据库设计 OBJECTIVES How to derive a set of relations from a conceptual data model. How to validate these relations using the technique of normalization. 2 OBJECTIVES How to validate a logical data model

More information

1/24/2012. Chapter 7 Outline. Chapter 7 Outline (cont d.) CS 440: Database Management Systems

1/24/2012. Chapter 7 Outline. Chapter 7 Outline (cont d.) CS 440: Database Management Systems CS 440: Database Management Systems Chapter 7 Outline Using High-Level Conceptual Data Models for Database Design A Sample Database Application Entity Types, Entity Sets, Attributes, and Keys Relationship

More information