DATABASE TECHNOLOGY. Spring An introduction to database systems

Size: px
Start display at page:

Download "DATABASE TECHNOLOGY. Spring An introduction to database systems"

Transcription

1 1 DATABASE TECHNOLOGY Spring 2007 An introduction to database systems Kjell Orsborn Uppsala Database Laboratory Department of Information Technology, Uppsala University, Uppsala, Sweden

2 2 Introduction to Database Design Using Entity-Relationship Modeling Elmasri/Navathe chs 3-4 Kjell Orsborn Department of Information Technology Uppsala University, Uppsala, Sweden

3 3 ER-modeling Aims at defining a high-level specification of the information content in the database. History Chen, P. P. S., The entity-relationship model: towards a unified view of data, ACM TODS, 1, , p Why ER-models? High-level description - easier to understand for non-technicians More formal than natural language - avoid misconceptions and multiple interpretations Implementation independent (of DBMS) - less technical details Documentation Model transformation to an implementation data model

4 4 Entity type and entity An entity type represents a physical or abstract concept with some sort of identity. The individual instances of the concept are members of a set of entities that have the same set of attributes. Entity types express the intention, i.e. the meaning of the concept whereas the set of entities represents the extension of that type. Names of entity types are given in singular form. The description of an entity type is called its schema. PERSON name, ssn, address, phoneno Each attribute in an entity type is associated with a domain that indicates the allowed values of that attribute.

5 Attribute An attribute is a characteristic or aspect that describe an entity (and is defined on entity types). Every attribute has a domain (or value set). A domain specifies the set of allowed values each individual attribute can be assigned. There is (at least) six different types of values for attributes: simple/ sex: M or F composite name: (Ior, Karlsson) single-valued/ name: Ior Karlsson multivalued friends: {Nasse, Puh,...} stored/ birthdate: derived age : 0 null ER-diagram Simple Composite Multivalued Derived 5 Note!

6 6 Attribute cont... Key: an attribute that has unique values for every instance of an entity type is called a key attribute. Sometimes several attributes are used together to get a unique key. An entity type can have more than one key. key hello

7 7 Relationship type and relationship A relationship type represents a relationship (or relation/connection), between a number of entity types. A relationship type R is a set of relationships (i.e. relational instances) or tuples. A relationship type, R, can mathematically be defined as: R E 1 E 2 E n where each E j is a entity type. A tuple (or an instance) t R is written as (e 1, e 2,..., e n ) or <e 1, e 2,..., e n > where e j E j.

8 8 Structural constraints for relationship types Cardinality ratio constraint specifies the number of relational instances that an entity can take part in. For binary relationship types: one-to-one (1:1) one-to-many (1:N) many-to-many (M:N) N M N

9 9 Structural constraints cont.... Partial Total Participation constraint specifies whether the entity existence is dependent of another entity via a relationship type. E.g. can an employee exist without working for a department? Partial participation: the entity can exist without this relationship Total participation: the entity requires this relationship in order to exist. employee works_for department manages

10 10 Roles of relationship types A role name specifies what role an entity type plays in a specific relationship Role names are sometimes used in ER-diagrams to clarify the roles of the participating entity types. Employee manager 1 N worker Supervision

11 11 Attributes for relationship types Also a relationship type can have attributes. E.g. in the case where the weekly number of hours an employee works on a project should be kept, that can be represented for each instance of the relation works-on. If the relation is a 1:1 or 1:N relation, the attribute can be stored at one of the participating entities. When the relation is of the type M:N one must store the attributes with the instance of the relation.

12 12 Weak entity types Weak entity types are those that are meaningless without an owner entity type. Weak entities are uniquely identified in the extension with their owner s key attributes together with its own (broken) underlined attribute. The relationship to the owner is called the identifying relationship.

13 13 ER-notation (Elmasri/Navathe fig. 3.14)

14 14 Example ER-modeling An enterprise consists of a number of departments. Each department has a name, a number, a manager, and a number of employees. The starting date for every department manager should also be registered. A department can have several office rooms. Every department finances a number of projects. Each project has a name, a number and an office room. For each employee, the following information is kept: name, social security number, address, salary and sex. An employee works for only one department but can work with several projects that can be related to different departments. Information about the number of hours (per week) that an employee work with a project should be stored. Information about the employees manager should also be stored.

15 15 The Relational Model The relational model was introduced by Dr. Edgar (Ted) F. Codd ( ) in Dr. Codd. a mathematician from Oxford (UK), was at that time working as an IBM researcher in the IBM San Jose Research Laboratory (USA). Many DBMS s are based on the relational data model. It support simple declarative, but yet powerful, languages for describing operations on data. Operations in the relational model applies to relations (tables) and produce new relations. This means that an operation can be applied to the result of another operation and that several different operations can be combined. Operations are described in an algebraic notation that is based on relational algebra.

16 16 Relation schema and instance A 1, A 2,..., A n are attributes represented by a column in the table R = (A 1, A 2,..., A n ) is a relation schema Customer-schema(customer-name, customer-street, customer-city) r(r) is a relation on the relation schema R customer(customer-schema) an attribute The current values (relation instance) of a relation are specified by a table. An element t of r is a tuple - represented by a row in a table customer customer customer-name customer-street customer-city Jones M ain Harrison a relation Smith North Rye Curry North Rye Lindsay Park Pittsfield a tuple

17 17 First Normal Form Only simple or atomic values are allowed in the relational model. Attributes is not allowed to have composite or multiple values. The theory for the relational model is based on these assumptions which is called: The first normal form assumption

18 18 Keys Because relations are sets, all tuples in the relation are different. There is usually a subset k of the attributes in a relation schema R, i.e. k R, that has the characteristic that if the tuples t1, t2 r(r) and t1 t2, the following holds: t1[k] t2[k] (i.e. the value of k in t1 the value of k in t2) Every such subset k is called a superkey for R. A superkey k is minimal if there is no other superkey k' such that k' k. Every minimal superkey (NOTE! there can be more than one) is called a candidate key for R. The candidate key chosen by the database designer as the key for R is called R:s primary key or just key.

19 19 1. Domain constraint Integrity constraints for a relational database schema attribute values for attribute A shall be atomic values from dom(a) 2. Key constraint candidate keys for a relation must be unique 3. Entity integrity constraint no primary key is allowed to have a null value 4. Referential integrity constraint a tuple that refers to another tuple in another relation must refer to an existing tuple 5. Semantic integrity constraint e.g. an employee s total work time per week can not exceed 40 hours for all projects taken all together

20 20 From E-R to relational model The basic procedure defines a set of relational schemas that represent entity and relationship types in the E-R model. This model should further with integrity constraints. Primary keys allow entity types and relationship types to be expressed uniformly as tables which represent the contents of the database. A database which conforms to an E-R diagram can be represented by a collection of tables. For each entity type and relationship type there is a unique table which is assigned the name of the corresponding entity type or relationship type. Each table has a number of columns (generally corresponding to attributes), which have unique names. Converting an E-R diagram to a table format is the basis for deriving a relational database design from an E-R diagram.

21 21 Summary Entity types and their attributes Step 1) Entity types Each entity gets a corresponding table, with the primary key column set to its key attribute. Step 2) Weak entity types The primary key of a weak entity type table has the primary key of the owner table as a component. Relationships Step 3) 1-1 Relationship 4 alternatives: fk in E1 or E2, separate R table, common table for E1 & E2 Step 4) 1-N Relationship fk i entity on the N-side, separate R table Step 5) M-N Relationship separate R table

22 22 Summary cont... Multivalued attributes and relationships Step 6) Multivalued attributes Separate table for the attribute with its pk composed of the owner pk and the value column. Step 7) Multivalued relationships Separate R table. N-N-N: pk composed of all fk s. 1-N-N: pk is fk to the E1- table.

23 23 Translating entity types and their attributes pk Step 1: Entity types - a strong entity type reduces to a table with the same attributes. Key attributes (primary key - pk) is made the primary key column(s) for the table. Each attribute gets their own column. Composite attributes are normally represented by their simple components. Example customer schema and table: Customer(social-security, customer-name, c-street, c-city) social-security customer-name c-street c-city Jones M ain Harrison Smith North Rye Hayes M ain Harrison

24 24 Translating entity types cont... Step 2: Weak entity types - a weak entity type becomes a table that includes a column for the primary key of the identifying strong entity type. pk E1 1 N R E2 k a1 a2 pk a1 pk k a2

25 25 Translating entity types cont... The table corresponding to a relationship type linking a weak entity type to its identifying strong entity type is redundant. Example of the payment schema and table: The payment table already contains the information that would appear in the loanpayment table (i.e., the columns loan-number and payment-no). Payment(loan-number, payment-no, pay-date, amount) loan-number payment-no pay-date amount L M ay L M ay L M ay

26 26 Translating relationship types Step 3: 1-1 Relationship types The foreign key column (fk) is a copy of the other entity s primary key column (pk). The values in a fk-column point to unique row in the other table, and thus implement the relationship. pk1 E1 1 1 R E2 pk2 a1 a2 Alt 1: pk1 a1 pk2 a2 f k1 Alt 2: pk1 a1 f k2 pk2 a2

27 27 Translating 1-1 relationship types cont... E1 R E2 Alt 3: pk1 a1 f k1 f k2 pk2 a2 E1 E2 Alt 4: pk1 a1 pk2 a2

28 28 Translating relationship... cont... Step 4: 1-N Relationship types Include the primary key of the 1-side as a foreign key on the N-side, (i.e. the foreign key column is placed on the entity on the N-side). Alternatively, an extra table (R) is created whose primary key is a foreign key composed by the primary key from the N-side. pk1 E1 1 N R E2 pk2 a1 a2 Alt 1: pk1 a1 pk2 a2 f k1 Alt 2: pk1 a1 f k1 f k2 pk2 a2

29 29 Translating relationship... cont... Step 5: M-N Relationship types Always a separate table with columns for the primary keys of the two participating entity types, and any descriptive attributes of the relationship type. pk1 E1 M R N E2 pk2 a1 a2 pk1 a1 f k1 f k2 pk2 a2

30 30 Translating relationship... cont... Step 6: Multivalued attributes A separate table is created for the multivalued attribute. Its primary key is composed of the owning entity s primary key, and the attribute value itself. a pk E mva E E-MVA pk a pk mva

31 31 Translating relationship... cont... Step 7: Multivalued relationship types First try to remove multivalued relationships on the E-R model level by model transformation. A separate table is created, with foreign keys to all tables that are included in the relationship. Its primary key is composed of all foreign keys. pk1 E1 N R N E2 pk2 N a pk3 E3 R f k1 f k2 f k3 a

32 32 Translating relationship... cont... Step 7: Multivalued relationship types continued In the case where R is 1-N-N, the primary key on R shall not include the fk for the table with cardinality 1. pk1 E1 1 N R E2 pk2 N a pk3 E3 R f k1 f k2 f k3 a

33 33 Example E-R to relational model translation ename EMPLOYEE salary N 1 WORKS_IN 1 1 MANAGES sname saddr dname DEPARTMENT SUPPLIER dno 1 CARRIES N M N SUPPLIES price date iname ITEM ino N M ono ORDER INCLUDE quantity N PLACED_BY CUSTOMER cname 1 balance caddr

34 34 Entity and relationship types in the example (see figures in Elmasri/Navathe) Entity types: EMPLOYEE(name(fstname,famname), ssn, address, sex, salary) DEPARTMENT( name, number, {room}) PROJECT( name, number, room, department) Relationsship types: An employee MANAGES a department 1:1 Every department FINANCES at least one project 1:N Every employee WORKS-FOR a department N:1 Every employee WORKS -WITH one (or several) project(s) M:N An employee IS-MANAGER over several employees 1:N

35 35 ER-diagram for the example enamn fnamn JOBBAR-ÅT namn nummer lokal namn kön lön AVDELNING persnr adress ANSTÄLLD LEDER FINANSIERAR startdatum ÄR-CHEF JOBBAR-MED PROJEKT namn nummer lokal timmar

36 36 ER-diagram for the example fstname famname WORKS-FOR name number room name sex salary DEPARTMENT ssn address EMPLOYEE MANAGES FINANCES startdate IS-MANAGER WORKS-WITH PROJECT name number room hours

37 37 ER-diagram for the example

38 38 Entity types in the example EMPLOYEE name(fstname,famname), ssn, address, sex, salary, department, manager, {works-on(project, hours)} DEPARTMENT name, number, {room}, dmanager, startdate PROJECT name, number, room, department

39 39 Relationship types in the example Every department is led (managed) by a manager Every department finances at least one project Every employee works for a department Every employee works with one (or several) project(s) Every employee has a manager employee MANAGES department 1:1 department FINANCES project 1:N employee WORKS-FOR department N:1 employee WORKS -WITH project M:N employee IS-MANAGER employee 1:N (See figures in Elmasri/Navathe)

40 40 A simple ER-diagram example Customer(customer-id, customer-name, customer-street, customer-city) Account(account-number, balance) A customer is a depositor of money in an account.

41 41 Relational schemas for the example Schemas for the entity types in the example above EMPLOYEE(ENAME, SALARY, DEPT) DEPARTMENT(DNO, DNAME, MGR) SUPPLIER(SNAME, SADDR) ITEM(INO, INAME, DNO) ORDER(ONO, DATE, CUST) CUSTOMER(CNAME, CADDR, BALANCE) Schemas for relationship types (M:N) SUPPLIES(SNAME, INO, PRICE) INCLUDE(ONO, INO, QUANTITY)

42 42 An example relation If customer-name = {Jones, Smith, Curry, Lindsay } customer-street = { Main, North, Park } customer-city = { Harrison, Rye, Pittsfield } Then r = {(Jones, Main, Harrison), (Smith, North, Rye), (Curry, North, Rye), (Lindsay, Park, Pittsfield)} is a relation over customer-name customer-street customercity

43 43 Key examples Example superkey: {customer-name, customer- street} and {customer- name} are both superkeys of Customer, if no two customers can possibly have the same name. Example candidate key: {customer- name} is a candidate key for Customer, since it is a superkey (assuming no two customers can possibly have the same name), and no subset of it is a superkey.

DATABASE TECHNOLOGY - 1DL124

DATABASE TECHNOLOGY - 1DL124 1 DATABASE TECHNOLOGY - 1DL124 Summer 2007 An introductury course on database systems http://user.it.uu.se/~udbl/dbt-sommar07/ alt. http://www.it.uu.se/edu/course/homepage/dbdesign/st07/ Kjell Orsborn

More information

DATABASE DESIGN I - 1DL300

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

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

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

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

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

A database can be modeled as: + a collection of entities, + a set of relationships among entities.

A database can be modeled as: + a collection of entities, + a set of relationships among entities. The Relational Model Lecture 2 The Entity-Relationship Model and its Translation to the Relational Model Entity-Relationship (ER) Model + Entity Sets + Relationship Sets + Database Design Issues + Mapping

More information

Chapter 2: Relational Model

Chapter 2: Relational Model Chapter 2: Relational Model Database System Concepts, 5 th Ed. See www.db-book.com for conditions on re-use Chapter 2: Relational Model Structure of Relational Databases Fundamental Relational-Algebra-Operations

More information

Database System Concepts

Database System Concepts s Slides (fortemente) baseados nos slides oficiais do livro c Silberschatz, Korth and Sudarshan. Chapter 2: Model Departamento de Engenharia Informática Instituto Superior Técnico 1 st Semester 2009/2010

More information

CSE 132A Database Systems Principles

CSE 132A Database Systems Principles CSE 132A Database Systems Principles Prof. Alin Deutsch RELATIONAL DATA MODEL Some slides are based or modified from originals by Elmasri and Navathe, Fundamentals of Database Systems, 4th Edition 2004

More information

DATABASE TECHNOLOGY - 1MB025 (also 1DL029, 1DL300+1DL400)

DATABASE TECHNOLOGY - 1MB025 (also 1DL029, 1DL300+1DL400) 1 DATABASE TECHNOLOGY - 1MB025 (also 1DL029, 1DL300+1DL400) Spring 2008 An introductury course on database systems http://user.it.uu.se/~udbl/dbt-vt2008/ alt. http://www.it.uu.se/edu/course/homepage/dbastekn/vt08/

More information

DATABASTEKNIK - 1DL116

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

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

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

Database Systems. Lecture2:E-R model. Juan Huo( 霍娟 )

Database Systems. Lecture2:E-R model. Juan Huo( 霍娟 ) Database Systems Lecture2:E-R model Juan Huo( 霍娟 ) Reference slides: http://www.cs.wisc.edu/ dbbook Berkeley, Professor Eben Haber,Professor Mary Roth Review: Benefits of a DBMS 1. Data independence applications

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

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

CMSC 424 Database design Lecture 4: Relational Model ER to Relational model. Book: Chap. 2 and 6. Mihai Pop

CMSC 424 Database design Lecture 4: Relational Model ER to Relational model. Book: Chap. 2 and 6. Mihai Pop CMSC 424 Database design Lecture 4: Relational Model ER to Relational model Book: Chap. 2 and 6 Mihai Pop Oracle accounts SQL homework next week Administrative issues Summary Entity-relationship Model

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

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

Chapter 2: Relational Model

Chapter 2: Relational Model Chapter 2: Relational Model Database System Concepts, 5 th Ed. See www.db-book.com for conditions on re-use Chapter 2: Relational Model Structure of Relational Databases Fundamental Relational-Algebra-Operations

More information

Database System Concepts, 5 th Ed.! Silberschatz, Korth and Sudarshan See for conditions on re-use "

Database System Concepts, 5 th Ed.! Silberschatz, Korth and Sudarshan See   for conditions on re-use Database System Concepts, 5 th Ed.! Silberschatz, Korth and Sudarshan See www.db-book.com for conditions on re-use " Structure of Relational Databases! Fundamental Relational-Algebra-Operations! Additional

More information

ITCS 3160 DATA BASE DESIGN AND IMPLEMENTATION

ITCS 3160 DATA BASE DESIGN AND IMPLEMENTATION ITCS 3160 DATA BASE DESIGN AND IMPLEMENTATION JING YANG 2010 FALL Class 3: The Relational Data Model and Relational Database Constraints Outline 2 The Relational Data Model and Relational Database Constraints

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 5. Relational Model Concepts 5/2/2008. Chapter Outline. Relational Database Constraints

Chapter 5. Relational Model Concepts 5/2/2008. Chapter Outline. Relational Database Constraints Chapter 5 The Relational Data Model and Relational Database Constraints Copyright 2004 Pearson Education, Inc. Chapter Outline Relational Model Concepts Relational Model Constraints and Relational Database

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

Chapter 5. Relational Model Concepts 9/4/2012. Chapter Outline. The Relational Data Model and Relational Database Constraints

Chapter 5. Relational Model Concepts 9/4/2012. Chapter Outline. The Relational Data Model and Relational Database Constraints Chapter 5 The Relational Data Model and Relational Database Constraints Copyright 2004 Pearson Education, Inc. Chapter Outline Relational Model Constraints and Relational Database Schemas Update Operations

More information

Chapter 3: Relational Model

Chapter 3: Relational Model Chapter 3: Relational Model Structure of Relational Databases Relational Algebra Tuple Relational Calculus Domain Relational Calculus Extended Relational-Algebra-Operations Modification of the Database

More information

Lecture 14 of 42. E-R Diagrams, UML Notes: PS3 Notes, E-R Design. Thursday, 15 Feb 2007

Lecture 14 of 42. E-R Diagrams, UML Notes: PS3 Notes, E-R Design. Thursday, 15 Feb 2007 Lecture 14 of 42 E-R Diagrams, UML Notes: PS3 Notes, E-R Design Thursday, 15 February 2007 William H. Hsu Department of Computing and Information Sciences, KSU KSOL course page: http://snipurl.com/va60

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

ACS-3902 Fall Ron McFadyen 3D21 Slides are based on chapter 5 (7 th edition) (chapter 3 in 6 th edition)

ACS-3902 Fall Ron McFadyen 3D21 Slides are based on chapter 5 (7 th edition) (chapter 3 in 6 th edition) ACS-3902 Fall 2016 Ron McFadyen 3D21 ron.mcfadyen@acs.uwinnipeg.ca Slides are based on chapter 5 (7 th edition) (chapter 3 in 6 th edition) 1 The Relational Data Model and Relational Database Constraints

More information

Overview of Database Design Process Example Database Application (COMPANY) ER Model Concepts

Overview of Database Design Process Example Database Application (COMPANY) ER Model Concepts Chapter Outline Overview of Database Design Process Example Database Application (COMPANY) ER Model Concepts Entities and Attributes Entity Types, Value Sets, and Key Attributes Relationships and Relationship

More information

Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity Sets Extended E-R Features Design of the Bank Database Reduction to

Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity Sets Extended E-R Features Design of the Bank Database Reduction to Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity Sets Extended E-R Features Design of the Bank Database Reduction to Relation Schemas Database Design UML A database can be modeled

More information

ECE 650 Systems Programming & Engineering. Spring 2018

ECE 650 Systems Programming & Engineering. Spring 2018 ECE 650 Systems Programming & Engineering Spring 2018 Relational Databases: Tuples, Tables, Schemas, Relational Algebra Tyler Bletsch Duke University Slides are adapted from Brian Rogers (Duke) Overview

More information

Chapter 2: Entity-Relationship Model. Entity Sets. Entity Sets customer and loan. Attributes. Relationship Sets. A database can be modeled as:

Chapter 2: Entity-Relationship Model. Entity Sets. Entity Sets customer and loan. Attributes. Relationship Sets. A database can be modeled as: Chapter 2: Entity-Relationship Model Entity Sets 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

More information

Comp 5311 Database Management Systems. 2. Relational Model and Algebra

Comp 5311 Database Management Systems. 2. Relational Model and Algebra Comp 5311 Database Management Systems 2. Relational Model and Algebra 1 Basic Concepts of the Relational Model Entities and relationships of the E-R model are stored in tables also called relations (not

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

CS 377 Database Systems

CS 377 Database Systems CS 377 Database Systems Relational Data Model Li Xiong Department of Mathematics and Computer Science Emory University 1 Outline Relational Model Concepts Relational Model Constraints Relational Database

More information

COSC 304 Introduction to Database Systems. Entity-Relationship Modeling

COSC 304 Introduction to Database Systems. Entity-Relationship Modeling COSC 304 Introduction to Database Systems Entity-Relationship Modeling Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Conceptual Database Design Conceptual database design

More information

Entity-Relationship Modelling. Entities Attributes Relationships Mapping Cardinality Keys Reduction of an E-R Diagram to Tables

Entity-Relationship Modelling. Entities Attributes Relationships Mapping Cardinality Keys Reduction of an E-R Diagram to Tables Entity-Relationship Modelling Entities Attributes Relationships Mapping Cardinality Keys Reduction of an E-R Diagram to Tables 1 Entity Sets A enterprise can be modeled as a collection of: entities, and

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

ER Model. Objectives (2/2) Electricite Du Laos (EDL) Dr. Kanda Runapongsa Saikaew, Computer Engineering, KKU 1

ER Model. Objectives (2/2) Electricite Du Laos (EDL) Dr. Kanda Runapongsa Saikaew, Computer Engineering, KKU 1 ER Model Asst. Prof. Dr. Kanda Runapongsa Saikaew (krunapon@kku.ac.th) Dept of Computer Engineering Khon Kaen University Objectives (1/2) Relational Data Model Terminology of relational data model How

More information

The Basic (Flat) Relational Model. Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

The Basic (Flat) Relational Model. Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley The Basic (Flat) Relational Model Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 Outline The Relational Data Model and Relational Database Constraints Relational

More information

DATABASE DESIGN - 1DL400

DATABASE DESIGN - 1DL400 DATABASE DESIGN - 1DL400 Spring 2014 2014-01-21 A course on modern database systems http://www.it.uu.se/research/group/udbl/kurser/dbii_vt14/integrity.pdf Tore Risch Uppsala Database Laboratory Department

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

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

Data Modeling Using the Entity- Relationship Model Design & Analysis of Database Systems

Data Modeling Using the Entity- Relationship Model Design & Analysis of Database Systems Data Modeling Using the Entity- Relationship Model 406.426 Design & Analysis of Database Systems Jonghun Park jonghun@snu.ac.kr Dept. of Industrial Engineering Seoul National University outline overview

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 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

CSIT5300: Advanced Database Systems

CSIT5300: Advanced Database Systems CSIT5300: Advanced Database Systems L02: Relational Data Model Dr. Kenneth LEUNG Department of Computer Science and Engineering The Hong Kong University of Science and Technology Hong Kong SAR, China kwtleung@cse.ust.hk

More information

The Relational Data Model and Relational Database Constraints

The Relational Data Model and Relational Database Constraints CHAPTER 5 The Relational Data Model and Relational Database Constraints Copyright 2017 Ramez Elmasri and Shamkant B. Navathe Slide 1-2 Chapter Outline Relational Model Concepts Relational Model Constraints

More information

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

Chapter 6: Entity-Relationship Model. E-R Diagrams Chapter 6: Entity-Relationship Model A database can be modeled as: a collection of entities, relationship among entities. An entity is an object that exists and is distinguishable from other objects. Example:

More information

Example: specific person, company, event, plant

Example: specific person, company, event, plant A database can be modeled as: a collection of entities, relationship among entities. An entity is an object that exists and is distinguishable from other objects. Example: specific person, company, event,

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

DATABASE DESIGN - 1DL400

DATABASE DESIGN - 1DL400 DATABASE DESIGN - 1DL400 Spring 2012 A course on modern database systems http://www.it.uu.se/edu/course/homepage/dbastekn2/vt12/ Tore Risch Uppsala Database Laboratory Department of Information Technology,

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

Lecture3: Data Modeling Using the Entity-Relationship Model.

Lecture3: Data Modeling Using the Entity-Relationship Model. College of Computer and Information Sciences - Information Systems Dept. Lecture3: Data Modeling Using the Entity-Relationship Model. Ref. Chapter12 Prepared by L. Nouf Almujally & Aisha AlArfaj Rev. by

More information

LECTURE 3: ENTITY-RELATIONSHIP MODELING

LECTURE 3: ENTITY-RELATIONSHIP MODELING LECTURE 3: ENTITY-RELATIONSHIP MODELING Ref. Chapter11 + Appendix F from Database Systems: A Practical Approach to Design, Implementation and Management. Thomas Connolly, Carolyn Begg. 1 IS220 : D a t

More information

CS34800 Information Systems. The Relational Model Prof. Walid Aref 29 August, 2016

CS34800 Information Systems. The Relational Model Prof. Walid Aref 29 August, 2016 CS34800 Information Systems The Relational Model Prof. Walid Aref 29 August, 2016 1 Chapter: The Relational Model Structure of Relational Databases Relational Algebra Tuple Relational Calculus Domain Relational

More information

Chapter Outline. Note 1. Overview of Database Design Process Example Database Application (COMPANY) ER Model Concepts

Chapter Outline. Note 1. Overview of Database Design Process Example Database Application (COMPANY) ER Model Concepts Chapter Outline Overview of Database Design Process Example Database Application (COMPANY) ER Model Concepts Entities and Attributes Entity Types, Value Sets, and Key Attributes Relationships and Relationship

More information

COSC344 Database Theory and Applications. σ a= c (P) Lecture 3 The Relational Data. Model. π A, COSC344 Lecture 3 1

COSC344 Database Theory and Applications. σ a= c (P) Lecture 3 The Relational Data. Model. π A, COSC344 Lecture 3 1 COSC344 Database Theory and Applications σ a= c (P) S P Lecture 3 The Relational Data π A, C (H) Model COSC344 Lecture 3 1 Overview Last Lecture Database design ER modelling This Lecture Relational model

More information

The Relational Model

The Relational Model The Relational Model UVic C SC 370, Fall 2002 Daniel M. German Department of Computer Science University of Victoria 3 1 The Relational Model CSC 370 dmgerman@uvic.ca Overview How is data represented in

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

Relational Model History. COSC 304 Introduction to Database Systems. Relational Model and Algebra. Relational Model Definitions.

Relational Model History. COSC 304 Introduction to Database Systems. Relational Model and Algebra. Relational Model Definitions. COSC 304 Introduction to Database Systems Relational Model and Algebra Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Relational Model History The relational model was

More information

Chapter 5. The Relational Data Model and Relational Database Constraints. Slide 5-١. Copyright 2007 Ramez Elmasri and Shamkant B.

Chapter 5. The Relational Data Model and Relational Database Constraints. Slide 5-١. Copyright 2007 Ramez Elmasri and Shamkant B. Slide 5-١ Chapter 5 The Relational Data Model and Relational Database Constraints Chapter Outline Relational Model Concepts Relational Model Constraints and Relational Database Schemas Update Operations

More information

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 5-1

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 5-1 Slide 5-1 Chapter 5 The Relational Data Model and Relational Database Constraints Chapter Outline Relational Model Concepts Relational Model Constraints and Relational Database Schemas Update Operations

More information

Introduction to Relational Databases. Introduction to Relational Databases cont: Introduction to Relational Databases cont: Relational Data structure

Introduction to Relational Databases. Introduction to Relational Databases cont: Introduction to Relational Databases cont: Relational Data structure Databases databases Terminology of relational model Properties of database relations. Relational Keys. Meaning of entity integrity and referential integrity. Purpose and advantages of views. The relational

More information

Chapter 2 Introduction to Relational Models

Chapter 2 Introduction to Relational Models CMSC 461, Database Management Systems Spring 2018 Chapter 2 Introduction to Relational Models These slides are based on Database System Concepts book and slides, 6th edition, and the 2009 CMSC 461 slides

More information

CSCI1270 Introduction to Database Systems

CSCI1270 Introduction to Database Systems CSCI1270 Introduction to Database Systems Relations Relational Data Model Introduced by Ted Codd (late 60 s early 70 s) Before = Network Data Model (Cobol as DDL, DML) Very contentious: Database Wars Relational

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

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

A l Ain University Of Science and Technology

A l Ain University Of Science and Technology A l Ain University Of Science and Technology 4 Handout(4) Database Management Principles and Applications The Entity Relationship (ER) Model http://alainauh.webs.com/ http://www.comp.nus.edu.sg/~lingt

More information

CS275 Intro to Databases

CS275 Intro to Databases CS275 Intro to Databases The Relational Data Model Chap. 3 How Is Data Retrieved and Manipulated? Queries Data manipulation language (DML) Retrieval Add Delete Update An Example UNIVERSITY database Information

More information

Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 5-1

Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 5-1 Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 5-1 Chapter 5 The Relational Data Model and Relational Database Constraints Copyright 2007 Pearson Education, Inc. Publishing

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

Relational Data Model. Christopher Simpkins

Relational Data Model. Christopher Simpkins Relational Data Model Christopher Simpkins 1 / 22 Relational Data Model A relation schema R(A a,..., A n ) is a relation name R and a list of attributes A 1,..., A n. Each attribute A i is the name of

More information

Conceptual Database Design. COSC 304 Introduction to Database Systems. Entity-Relationship Modeling. Entity-Relationship Modeling

Conceptual Database Design. COSC 304 Introduction to Database Systems. Entity-Relationship Modeling. Entity-Relationship Modeling COSC 304 Introduction to Database Systems Entity-Relationship Modeling Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Conceptual Database Design Conceptual database design

More information

The Relational Model

The Relational Model The Relational Model What is the Relational Model Relations Domain Constraints SQL Integrity Constraints Translating an ER diagram to the Relational Model and SQL Views A relational database consists

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

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

Data Modeling Using the Entity-Relationship Model

Data Modeling Using the Entity-Relationship Model 3 Data Modeling Using the Entity-Relationship Model Conceptual modeling is a very important phase in designing a successful database application. Generally, the term database application refers to a particular

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

Databases: Why? Databases: What? Databases: How? DATABASE DESIGN I - 1DL300

Databases: Why? Databases: What? Databases: How? DATABASE DESIGN I - 1DL300 Databases: Why? DATABASE DESIG I - DL300 Spring 202 An introductury course on database systems http://www.it.uu.se/edu/course/homepage/dbastekn/vt2 Erik Zeitler Uppsala Database Laboratory Department of

More information

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

Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition Chapter 3-3 Chapter Outline Example Database Application (COMPANY) ER

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

01/01/2017. Chapter 5: The Relational Data Model and Relational Database Constraints: Outline. Chapter 5: Relational Database Constraints

01/01/2017. Chapter 5: The Relational Data Model and Relational Database Constraints: Outline. Chapter 5: Relational Database Constraints Chapter 5: The Relational Data Model and Relational Database Constraints: Outline Ramez Elmasri, Shamkant B. Navathe(2017) Fundamentals of Database Systems (7th Edition),pearson, isbn 10: 0-13-397077-9;isbn-13:978-0-13-397077-7.

More information

Intro to DB CHAPTER 6

Intro to DB CHAPTER 6 Intro to DB CHAPTER 6 DATABASE DESIGN &THEER E-R MODEL Chapter 6. Entity Relationship Model Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity Sets Extended E-R Features Design of

More information

CSE 880:Database Systems. ER Model and Relation Schemas

CSE 880:Database Systems. ER Model and Relation Schemas CSE 880:Database Systems ER Model and Relation Schemas 1 Major Steps for Database Design and Implementation 1. Requirements Collection and Analysis: Produces database requirements such as types of data,

More information

Copyright 2016 Ramez Elmasr and Shamkant B. Navathei

Copyright 2016 Ramez Elmasr and Shamkant B. Navathei CHAPTER 3 Data Modeling Using the Entity-Relationship (ER) Model Slide 1-2 Chapter Outline Overview of Database Design Process Example Database Application (COMPANY) ER Model Concepts Entities and Attributes

More information

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 7 Data Modeling with Entity Relationship Diagrams

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition Chapter 7 Data Modeling with Entity Relationship Diagrams Objectives In this chapter, students will learn: The

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

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

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

CSCC43H: Introduction to Databases

CSCC43H: Introduction to Databases CSCC43H: Introduction to Databases Lecture 2 Wael Aboulsaadat Acknowledgment: these slides are partially based on Prof. Garcia-Molina & Prof. Ullman slides accompanying the course s textbook. CSCC43: Introduction

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

Relational Model. Nisa ul Hafidhoh

Relational Model. Nisa ul Hafidhoh Relational Model Nisa ul Hafidhoh nisa@dsn.dinus.ac.id Data Model Collection of conceptual tools for describing data, data relationships, data semantics, and consistency constraints Example of Data Model

More information

Database Management System 10 Conversion of ER model to Relational Model

Database Management System 10 Conversion of ER model to Relational Model Database Management System 10 model to Relational School of Computer Engineering, KIIT University 10.1 A database that conforms to an ER diagram schema can be represented by a collection of relational

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

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

Conceptual Design. The Entity-Relationship (ER) Model

Conceptual Design. The Entity-Relationship (ER) Model Conceptual Design. The Entity-Relationship (ER) Model CS430/630 Lecture 12 Slides based on Database Management Systems 3 rd ed, Ramakrishnan and Gehrke Database Design Overview Conceptual design The Entity-Relationship

More information