Agent 7 which languages? skills?

Size: px
Start display at page:

Download "Agent 7 which languages? skills?"

Transcription

1 Agent 7 which languages? skills? select * from languagerel where agent_id = 7 lang_id agent_id agent 7 speaks 4 languages select * from skillrel where agent_id = 7 skill_id agent_id agent 7 has 2 skills CS386/586 Introduction to Database Systems, Lois Delcambre Slide 1

2 Intersect vs. Intersect ALL SELECT agent_id FROM languagerel WHERE agent_id = 7 INTERSECT SELECT agent_id FROM skillrel WHERE agent_id = 7 agent_id Agent 7 has (at least one) language and (at least one) skill 7 SELECT agent_id FROM languagerel WHERE agent_id = 7 INTERSECT ALL SELECT agent_id FROM skillrel WHERE agent_id = 7 agent_id 7 7 Agent 7 has at most 2 of either skills or languages or both CS386/586 Introduction to Database Systems, Lois Delcambre Slide 2

3 Except vs. Except all SELECT agent_id FROM languagerel WHERE agent_id = 7 EXCEPT SELECT agent_id FROM skillrel WHERE agent_id = 7 No rows found. Agent 7 has both languages and skills SELECT agent_id FROM languagerel WHERE agent_id = 7 EXCEPT ALL SELECT agent_id FROM skillrel WHERE agent_id = 7 agent_id 7 7 Agent 7 has two more languages than skills CS386/586 Introduction to Database Systems, Lois Delcambre Slide 3

4 Except vs. Except all (cont.) SELECT agent_id FROM languagerel WHERE agent_id = 7 EXCEPT ALL SELECT agent_id FROM skillrel WHERE agent_id = 7 agent_id (repeated from previous slide) 7 Agent 7 has two more languages 7 than skills SELECT agent_id FROM skillrel WHERE agent_id = 7 EXCEPT ALL SELECT agent_id FROM languagerel WHERE agent_id = 7 No rows found. Agent 7 has fewer skills than languages. CS386/586 Introduction to Database Systems, Lois Delcambre Slide 4

5 Union vs. Union ALL SELECT agent_id FROM languagerel WHERE agent_id = 7 UNION SELECT agent_id FROM skillrel WHERE agent_id = 7 agent_id Agent 7 has languages or skills 7 SELECT agent_id FROM languagerel WHERE agent_id = 7 UNION ALL SELECT agent_id FROM skillrel WHERE agent_id = 7 Agent 7 s languages + skills = 6 agent_id CS386/586 Introduction to Database Systems, Lois Delcambre Slide 5

6 Relational Algebra (as defined mathematically by Codd) vs. SQL σ, Π,, X, ρ for relations as sets σ, Π,, X, ρ for tables as bags,, for relations as sets,, for tables as bags Relational Algebra Yes NO Yes NO SQL GROUP BY/HAVING NO YES YES (with DISTINCT) Basic Select-From-Where YES (it s the default) Basic Select-From-Where YES (UNION, INTERSECT, EXCEPT) YES (UNION ALL, INTERSECT ALL, EXCEPT ALL) Aggregate operators NO YES (divide operator) YES NO (not directly) Note that in a DBMS, there are algebraic operators for bags/sets and for grouping and aggregates. We use (only) the original rel. alg. operators defined for sets. CS386/586 Introduction to Database Systems, Lois Delcambre Slide 6

7 How do you like to see the Spy Database? As tables? Agent(agent_id,first,middle,last,address,city,country,salary,clearance_id) Mission(mission_id,, access_id, team_id, mission_status) Affiliation(aff_id, title, description) AffiliationRel(aff_id, agent_id, affiliation_strength) LanguageRel(lang_id, agent_id) Language(lang_id, language) SecurityClearance(sc_id, sc_level, description) Skill(skill_id, skill) SkillRel(skill_id, agent_id) Team(team_id,, meeting_frequency) TeamRel(team_id, agent_id) CS386/586 Introduction to Database Systems, Lois Delcambre Slide 7

8 How do you like to see the Spy Database? As tables with foreign keys? Agent(agent_id,first,middle,last,address,city,country,salary,clearance_id) Mission(mission_id,, access_id, team_id, mission_status) Affiliation(aff_id, title, description) AffiliationRel(aff_id, agent_id, affiliation_strength) LanguageRel(lang_id, agent_id) Language(lang_id, language) SecurityClearance(sc_id, sc_level, description) Skill(skill_id, skill) SkillRel(skill_id, agent_id) Team(team_id,, meeting_frequency) TeamRel(team_id, agent_id) CS386/586 Introduction to Database Systems, Lois Delcambre Slide 8

9 How do you like to see the Spy Database? MS Access Relationship Diagram of tables? Affiliation aff_id AffiliationRel aff_id agent_id affiliation_strength SkillRel skill_id agent_id Skill skill_id Language lang_id LanguageRel lang_id agent_id Agent agent_id clearance_id TeamRel team_id agent_id SecurityClearance clearance_id Team team_id Mission mission_id team_id access_id CS386/586 Introduction to Database Systems, Lois Delcambre Slide 9

10 How do you like to see the Spy Database? Entity-Relationship Diagram (ERD)? Affiliation strength AffiliationRel SkillRel TeamRel Language Agent Team 0..1 LanguageRel Skill 1..1 SecurityClearance 1..1 Mission Rectangles: Entities Lines: Relationships (with cardinalities) CS386/586 Introduction to Database Systems, Lois Delcambre Slide 10

11 Entity-Relationship Diagram (ERD) Note: Relationships need s. (I ll use the ones from the Spy DB tables for the manymany relationship.) Language Skill LanguageRel AffiliationRel SkillRel Affiliation Agent SecurityClearance Team strength TeamRel Agent-clearance 1..1 Other relationships arise from foreign keys; they needs s, too. Mission Mission-clearance AssignedTeam CS386/586 Introduction to Database Systems, Lois Delcambre Slide 11

12 Conceptual Database Design Using the Entity-Relationship (ER) Model CS386/586 Introduction to Database Systems, Lois Delcambre Slide 12

13 Overview of Database Design Conceptual design: (ER Model is used for this.) What are the entities and relationships we need? Logical design: Transform ER design to Relational Schema Schema Refinement: (Normalization) Check relational schema for redundancies and related anomalies. Physical Database Design and Tuning: Consider typical workloads; (sometimes) modify the database design; select file types and indexes. CS386/586 Introduction to Database Systems, Lois Delcambre Slide 13

14 Entity-Relationship Model is a different model than the Relational Model Relation model has: tables(relations) with attributes, keys, foreign keys, domain definitions for attributes Entity-Relationship model has: Entities and entity sets with attributes, keys, and domain definitions for attributes relationships among entities and relationship sets with cardinality constraints (in the book they refer to key constraints and participation constraints) CS386/586 Introduction to Database Systems, Lois Delcambre Slide 14

15 Entity-Relationship Diagram (original syntax) code ssn lot home Department Legend: Entity set Relationship set Attribute manager sponsor assigned Project number start date end date budget CS386/586 Introduction to Database Systems, Lois Delcambre Slide 15

16 Definitions Entity: Real-world object distinguishable from other objects. (An employee d John Smith, for example.) An entity is described using a set of attributes. Entity Set: A collection of similar entities. (All employees in the company, for example.) (An entity set if often referred to as just an entity if everyone knows we re talking about the schema rather than individual rows. An entity set may also be called entity type.) CS386/586 Introduction to Database Systems, Lois Delcambre Slide 16

17 Definitions Relationship: Association among 2 or more entities. John s home department is Pharmacy, for example. John is an entity. Pharmacy is an entity. Relationship Set: Collection of similar relationships. The home department relationship set consists of all indications of a home department for an employee. (A relationship set is often referred to as a relationship because everyone knows we are talking about the schema rather than individual rows. A relationship set may also be called a relationship type.) CS386/586 Introduction to Database Systems, Lois Delcambre Slide 17

18 UML version of the same E-R Diagram UML: Unified Modeling Language for OO Design ssn lot home manager Department code assigned Project number start-date end-date budget sponsor CS386/586 Introduction to Database Systems, Lois Delcambre Slide 18

19 Equivalent Relational Schema extra table to represent a many-to-many relationship (ssn,, lot, home-dept) Project-team(ssn, number) Department (id,, manager) Project (number,, start-date, end-date, budget, sponsor) ssn lot assigned home manager Project number start-date end-date budget Department code sponsor CS386/586 Introduction to Database Systems, Lois Delcambre Slide 19

20 Equivalent Relational Schema - with foreign keys shown (ssn,, lot, home-dept) Project-team(ssn, number) Department (id,, manager) Notice that the many-to-many relationship set must be represented in a (new) table. Project (number,, start-date, end-date, budget, sponsor) CS386/586 Introduction to Database Systems, Lois Delcambre Slide 20

21 ERD Relational DB Diagram Many-to-many relationship sets ssn lot ssn lot assigned assigned-projects Proj-Team SSN PNumber team home manager Project number start-date end-date budget home manager Project number start-date end-date budget Department code sponsor Department code sponsor CS386/586 Introduction to Database Systems, Lois Delcambre Slide 21

22 What data do we need to record a relationship? ssn lot home Department code We must indicate which employee and which department are to be connected (for each relationship). We need the key value for an employee and the key value for the department stored together to represent the relationship. CS386/586 Introduction to Database Systems, Lois Delcambre Slide 22

23 Cardinality Constraints on Relationship sets: How many entities can participate? ssn lot home manager Department code assigned Project number start-date end-date budget sponsor CS386/586 Introduction to Database Systems, Lois Delcambre Slide 23

24 Cardinality Constraints on Relationship sets How many entities can participate? ssn lot 1..1 home manager Department code 1..1 assigned Project number start-date end-date budget sponsor CS386/586 Introduction to Database Systems, Lois Delcambre Slide 24

25 An employee can have 0 or 1 home departments ssn lot 1..1 home manager Department code 1..1 assigned Project number start-date end-date budget sponsor CS386/586 Introduction to Database Systems, Lois Delcambre Slide 25

26 A department can have 0 to any number of employees ssn lot 1..1 home manager Department code 1..1 assigned Project number start-date end-date budget sponsor CS386/586 Introduction to Database Systems, Lois Delcambre Slide 26

27 Unified Modeling Language (UML): Class Diagram ssn lot 1..1 home Departments code ssn lot home 0..1 Departments code ssn lot home 1..* Departments code Which one is right? We must discover the semantics of the application! CS386/586 Introduction to Database Systems, Lois Delcambre Slide 27

28 Various notation for one-to-many one many 1 m 1 * zero..one one..many * maximum cardinalities only minimum and maximum cardinalities Notice, UML notation allows any sort of cardinality. DBMSs are limited to enforcing a max of 1 or many and a min of 0 or 1. CS386/586 Introduction to Database Systems, Lois Delcambre Slide 28

29 Various notations for many-to-many many many one..many one..many 1..* 1..* m n * * maximum cardinalities only minimum and maximum cardinalities CS386/586 Introduction to Database Systems, Lois Delcambre Slide 29

30 Relationship sets can have attributes ssn lot start-date descriptive attribute of the relationship set code E-R notation home Department UML notation ssn lot home 0..1 Department code start-date CS386/586 Introduction to Database Systems, Lois Delcambre Slide 30

31 Try all three locations for the attributes: which one makes sense? ssn lot home 0..1 start-date Department code? start-date? start-date? CS386/586 Introduction to Database Systems, Lois Delcambre Slide 31

32 Relationship sets can have role s (in addition to the of the relationship set) ssn lot manager managed-by manages Department code role role relationship set CS386/586 Introduction to Database Systems, Lois Delcambre Slide 32

33 Example: reading role s An employee manages 0 or 1 departments ssn lot manager managed-by manages Department code role role relationship set CS386/586 Introduction to Database Systems, Lois Delcambre Slide 33

34 Same entity sets can participate in different roles for the same relationship set E-R notation UML notation ssn supervisor lot subordinate ssn lot 0..1 supervisor subordinate Reports-to Reports_To CS386/586 Introduction to Database Systems, Lois Delcambre Slide 34

35 Exercise: Draw an ERD Professors have a SSN, a and an age and their SSNs uniquely identify them. Professors teach courses. Each course is supervised by one professor. Courses are uniquely identified by their courseid, and they have a. Choose cardinalities for all your relationships. CS386/586 Introduction to Database Systems, Lois Delcambre Slide 35

36 Weak Entity Sets (and Identifying Relationship sets) Department code 0..1 home manager 1 SSN office strong entity set This is a weak entity set It wouldn t be in the database if the strong entity weren t present. children Dependents date-of-birth identifying relationship set weak entity set CS386/586 Introduction to Database Systems, Lois Delcambre Slide 36

37 Weak Entity Sets and Identifying Relationship sets: Alternative Notation Department code * home * manager 1 SSN office strong entity set participation in the identifying relationship set is required partial key - must be concatenated with key for the strong entity set (SSN) Children Dependents date-of-birth identifying relationship set weak entity set CS386/586 Introduction to Database Systems, Lois Delcambre Slide 37

38 Weak Entity Sets and Identifying Relationship sets: Alternative Notation (cont.) Department code * home * manager 1 Cardinalities for an identifying relationship set SSN office 1..1 Children Dependents Name Date-of-birth strong entity set identifying relationship set weak entity set CS386/586 Introduction to Database Systems, Lois Delcambre Slide 38

39 Ternary vs. Binary Relationship sets Product Supplier Product supplies Supplier supplies required-for authorized -for Project Project These two schemas are not equivalent! When would we use a ternary relationship set? When would we use three binary relationship sets? CS386/586 Introduction to Database Systems, Lois Delcambre Slide 39

40 Binary vs. Ternary Relationship sets (Cont.) The ternary relationship set means that a Supplier must be authorized to supply a particular part to a particular project. e.g., Office-Depot can supply laser printer paper to project 112. Office-Max can supply paper clips to Project 112. Office-Max can supply pencils to project 115. (But based on that much information, Office-Max can t supply pencils to 112.) The three binary relationship sets each represent something distinct. A Supplier can be authorized to supply certain products (Office-Max can supply pencils). A Project can require certain products (112 needs pencils). And a Supplier can be authorized to supply a certain project. (Office-Max supplies 112) Therefore: Office-Max can supply pencils to 112. CS386/586 Introduction to Database Systems, Lois Delcambre Slide 40

41 Duality: entity value and attribute relationship Project P-number P- Due-Date Assignment Manager SSN E-Name Office Should Office be an attribute of? or a separate entity set? Most attributes can be promoted to an entity set and some entities can be demoted to an attribute value. This explains why there are so many different ways to design a schema. CS386/586 Introduction to Database Systems, Lois Delcambre Slide 41

42 What are some reasons to model Office as an entity set? Project P-number P- Due-Date Assignment Manager SSN E-Name Assigned Office Office O-number an employee can have more than one office there are other attributes of Office Office needs to participate in other relationship sets such as a relationship set connecting to furniture or telephones or network drops (located in the office) CS386/586 Introduction to Database Systems, Lois Delcambre Slide 42

43 Office as an entity (with attributes & relationships) Project P-number P- Due-Date Assignment Manager SSN E-Name Assigned Office Office O-number sq-ft orientation Location NetworkDrop IP-address location CS386/586 Introduction to Database Systems, Lois Delcambre Slide 43

44 What are some reasons to model Office as an attribute of? Project P-number P- Due-Date Assignment Manager SSN E-Name O-number Assigned Office Office O-number it is faster to access office number; there is no join required. schema is a little simpler; one less table CS386/586 Introduction to Database Systems, Lois Delcambre Slide 44

45 Key Constraints - as described in the book (limit participation in relationship set to at most 1) same as maximum multiplicity of 1 in UML d- ssn lot d-code Manages Department ssn lot 1 Manages * Department d-code d Each dept has at most one manager, according to the key constraint on Manages. CS386/586 Introduction to Database Systems, Lois Delcambre Slide 45

46 Participation Constraint - as in text: when every entity MUST participate in a relationship set a Project has exactly one manager Project Manager 1..1 Project n 1 Manager a Project MUST have a manager and there is at most 1 employee who is manager CS386/586 Introduction to Database Systems, Lois Delcambre Slide 46

47 Translating an ER Diagram to a Relational Schema CS386/586 Introduction to Database Systems, Lois Delcambre Slide 47

48 1. Translate each entity set into a table, with keys. Entity set: can be represented as a table in the relational model SSN E-Name Office has a key which becomes a key for the table CREATE TABLE (SSN CHAR(11), E-Name CHAR(20), Office INTEGER, PRIMARY KEY (SSN)) CS386/586 Introduction to Database Systems, Lois Delcambre Slide 48

49 If your relational DBMS does not allow multi-valued attributes then 1a. Create a table for each multi-valued attribute. How many offices can one employee have? Project (P-number, P-, Due-Date) (SSN, E-Name, Office) vs. Project (P-number, P-, Due-Date) (SSN, E-Name) Office-Assignment (SSN, Office) CS386/586 Introduction to Database Systems, Lois Delcambre Slide 49

50 Sample Data Project (P-number, P-, Due-Date) (SSN, E-Name, Office) 12 Smith O Wei O Jones O-112 Project (P-number, P-, Due-Date) (SSN, E-Name) 12 Smith 15 Wei Office-Assignment (SSN, Office) 12 O O O-110 CS386/586 Introduction to Database Systems, Lois Delcambre Slide 50

51 2. Translate each many to many relationship set into a table Project P-number P- Due-Date * Assignment * Manager 1 SSN E-Name Office What are the attributes and what is the key for Assignment? Assignment (?) Project (P-number, P-, Due-Date) (SSN, E-Name, Office) CS386/586 Introduction to Database Systems, Lois Delcambre Slide 51

52 Project P-number P- Due-Date * Assignment * Manager 1 SSN E-Name Office Answer: Assignment (P-Number, SSN) P-Number is a foreign key for Project SSN is a foreign key for Project (P-Number, P-Due-Date) (SSN, E-Name, Office) CS386/586 Introduction to Database Systems, Lois Delcambre Slide 52

53 What should we do with each one to many relationship set? Project P-number P- Due-Date * Assignment * Manager 0..1 SSN E-Name Office What should we do with each one to many relationship set? Manager (?) Project (P-number, P-, Due-Date) (SSN, E-Name, Office) CS386/586 Introduction to Database Systems, Lois Delcambre Slide 53

54 Answer: Create a foreign key for a 1-tomany relationship set (on the many side). Project P-number P- Due-Date * Assignment * Manager 1 SSN E-Name Office Project (P-number, P-, Due-Date, Manager) (SSN, E-Name, Office) Manager is a foreign key (referencing the relation) value of Manager must match an SSN CS386/586 Introduction to Database Systems, Lois Delcambre Slide 54

55 Or... create a table for a 1-many relationship set. Project P-number P- Due-Date * Assignment * Manager 1 SSN E-Name Office Project (P-number, P-, Due-Date, Manager) (SSN, E-Name, Office) vs. Project (P-number, P-, Due-Date) (SSN, E-Name, Office) Manager (P-number, SSN) What are the tradeoffs between these two? Note: P-number is the key for Manager CS386/586 Introduction to Database Systems, Lois Delcambre Slide 55

56 Project P-number P- Due-Date * Assignment * Manager 1 SSN E-Name Office Project (P-number, P-, Due-Date) (SSN, E-Name, Office, Managed-project) vs. Project (P-number, P-, Due-Date) (SSN, E-Name, Office) Manager (P-number, SSN) What if SSN is the key for Manager? CS386/586 Introduction to Database Systems, Lois Delcambre Slide 56

57 What do we do when a many-to-many relationship set has an attribute? Project P-number P- Due-Date Assignment role start-date end-date SSN E-Name Office Assignment (A-project, A-SSN) Project (P-number, P-, Due-Date) (SSN, E-Name, Office) CS386/586 Introduction to Database Systems, Lois Delcambre Slide 57

58 Add attributes to the table representing the relationship Project P-number P- Due-Date Assignment role start-date end-date SSN E-Name Office Assignment (A-project, A-SSN, role, start-date, end-date) Project (P-number, P-, Due-Date) (SSN, E-Name, Office) CS386/586 Introduction to Database Systems, Lois Delcambre Slide 58

59 What do we do when a 1-to-many relationship set has an attribute? Project P-number P- Due-Date Manager start-date end-date SSN E-Name Office Project (P-number, P-, Due-Date, Manager) (SSN, E-Name, Office) CS386/586 Introduction to Database Systems, Lois Delcambre Slide 59

60 Add them to the table with the foreign key for that represents the relationship Project P-number P- Due-Date Manager start-date end-date SSN E-Name Office What do we do when a 1-to-many relationship set has an attribute? Project (P-number, P-, Due-Date, Manager, start-date, end-date) (SSN, E-Name, Office ) CS386/586 Introduction to Database Systems, Lois Delcambre Slide 60

61 Participation Constraints in SQL We can require any table to be in a binary relationship using a foreign key which is required to be NOT NULL (but little else without resorting to CHECK constraints) CREATE TABLE Department ( d-code INTEGER, d- CHAR(20), manager-ssn CHAR(9) NOT NULL, since DATE, PRIMARY KEY (d-code), FOREIGN KEY (manager-ssn) REFERENCES, ON DELETE NO ACTION) CS386/586 Introduction to Database Systems, Lois Delcambre Slide 61

62 Translating Weak Entity Sets Weak entity sets and identifying relationship sets are translated into a single table. Must include key of strong entity set, as a foreign key. When the owner entity is deleted, all owned weak entities must also be deleted. CREATE TABLE Insurance_Policy ( dep- CHAR(20), age INTEGER, cost REAL, ssn CHAR(11) NOT NULL, PRIMARY KEY (dep-, ssn), FOREIGN KEY (ssn) REFERENCES, ON DELETE CASCADE) CS386/586 Introduction to Database Systems, Lois Delcambre Slide 62

63 Note ERDs and UML Diagrams can be at two levels: the ERD/UML level and the Relational Table level. The difference is primarily with the many-to-many relationship sets. CS386/586 Introduction to Database Systems, Lois Delcambre Slide 63

64 Summary of Translation Steps: ER to Tables 1. Create table and choose key for each entity set; include single-valued attributes. 2. Create table for each weak entity set; include single-valued attributes. Include key of owner as a foreign key in the weak entity. Set key as foreign key of owner plus local, partial key. 3. For each 1:1 relationship set, add a foreign key to one of the entity sets involved in the relationship (a foreign key to the other entity in the relationship)*. 4. For each 1:N relationship set, add a foreign key to the entity set on the N-side of the relationship (to reference the entity set on the 1-side of the relationship)*. 5. For each M:N relationship set, create a new table. Include a foreign key for each participant entity set, in the relationship set. The key for the new table is the set of all such foreign keys. 6. For each multi-valued attribute, construct a separate table. Repeat the key for the entity in this new table. It will serve as both the key for this table as well as a foreign key to the original table for the entity. * Unless relationship set has attributes. If it does, create a new table for the relationship set. This algorithm from Elmasri/Navathe, p CS386/586 Introduction to Database Systems, Lois Delcambre Slide 64

65 Entity-Relationship Diagram ssn lot 1..1 home manager Department d-code d assigned Project p-number p- start-date end-date budget sponsor CS386/586 Introduction to Database Systems, Lois Delcambre Slide 65

66 Equivalent Relational Schema ssn lot home-dept 1 1 home manager 1 Department d-code d- manager 1 Assignment SSN p-number 1 Project p-number p- start-date end-date budget sponsoring-dept sponsor Notice that the relationship sets shown in this diagram aren t really needed. foreign keys reference other tables. CS386/586 Introduction to Database Systems, Lois Delcambre Slide 66

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

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

Review The Big Picture

Review The Big Picture CS445 - Introduction to Database Management Systems Fall Semester 2015 LECTURE 6 The Entity-Relationship Model Introduction TEXTBOOK REFERENCE: CHAPTERS 2,3 R&G 1 Review The Big Picture Data Modeling Relational

More information

The Entity-Relationship Model. Overview of Database Design

The Entity-Relationship Model. Overview of Database Design The Entity-Relationship Model Chapter 2, Chapter 3 (3.5 only) Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Overview of Database Design Conceptual design: (ER Model is used at this stage.)

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

The Entity-Relationship Model

The Entity-Relationship Model The Entity-Relationship Model Chapter 2 Instructor: Vladimir Zadorozhny vladimir@sis.pitt.edu Information Science Program School of Information Sciences, University of Pittsburgh 1 Database: a Set of Relations

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

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

Databases Model the Real World. The Entity- Relationship Model. Conceptual Design. Steps in Database Design. ER Model Basics. ER Model Basics (Contd. The Entity- Relationship Model R &G - Chapter 2 A relationship, I think, is like a shark, you know? It has to constantly move forward or it dies. And I think what we got on our hands is a dead shark. Woody

More information

Represent entities and relations with diagrams

Represent entities and relations with diagrams LEARNING OBJECTIVES Define data modeling terms Describe E-R Model Identify entities and relations Represent entities and relations with diagrams WHAT IS DATA MODELING? A data model is a collection of concepts

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

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

MIS Database Systems Entity-Relationship Model.

MIS Database Systems Entity-Relationship Model. MIS 335 - Database Systems Entity-Relationship Model http://www.mis.boun.edu.tr/durahim/ Ahmet Onur Durahim Learning Objectives Database Design Main concepts in the ER model? ER Diagrams Database Design

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

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

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

OVERVIEW OF DATABASE DEVELOPMENT

OVERVIEW OF DATABASE DEVELOPMENT DATABASE SYSTEMS I WEEK 2: THE ENTITY-RELATIONSHIP MODEL OVERVIEW OF DATABASE DEVELOPMENT Requirements Analysis / Ideas High-Level Database Design Conceptual Database Design / Relational Database Schema

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

LAB 2 Notes. Conceptual Design ER. Logical DB Design (relational) Schema Refinement. Physical DD

LAB 2 Notes. Conceptual Design ER. Logical DB Design (relational) Schema Refinement. Physical DD LAB 2 Notes For students that were not present in the first lab TA Web page updated : http://www.cs.ucr.edu/~cs166/ Mailing list Signup: http://www.cs.ucr.edu/mailman/listinfo/cs166 The general idea of

More information

Data Modeling. Yanlei Diao UMass Amherst. Slides Courtesy of R. Ramakrishnan and J. Gehrke

Data Modeling. Yanlei Diao UMass Amherst. Slides Courtesy of R. Ramakrishnan and J. Gehrke Data Modeling Yanlei Diao UMass Amherst Slides Courtesy of R. Ramakrishnan and J. Gehrke 1 Outline v Conceptual Design: ER Model v Relational Model v Logical Design: from ER to Relational 2 Conceptual

More information

CSE 530A. ER Model. Washington University Fall 2013

CSE 530A. ER Model. Washington University Fall 2013 CSE 530A ER Model Washington University Fall 2013 Database Design Requirements Analysis Conceptual Database Design Creates an abstract model Logical Database Design Converts abstract model to concrete

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

The Entity-Relationship Model

The Entity-Relationship Model The Entity-Relationship Model Chapter 2 Database Management Systems, R. Ramakrishnan and J. Gehrke 1 Overview of Database Design Conceptual design: (ER Model is used at this stage.) What are the entities

More information

The Relational Model 2. Week 3

The Relational Model 2. Week 3 The Relational Model 2 Week 3 1 We have seen how to create a database schema, how do we create an actual database on our computers? professor(pid : string, name : string) course(pid : string, number :

More information

Database Management Systems. Chapter 3 Part 2

Database Management Systems. Chapter 3 Part 2 Database Management Systems Chapter 3 Part 2 The Relational Model Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Logical DB Design: ER to Relational Entity sets to tables: CREATE TABLE

More information

Relational Model. Topics. Relational Model. Why Study the Relational Model? Linda Wu (CMPT )

Relational Model. Topics. Relational Model. Why Study the Relational Model? Linda Wu (CMPT ) Topics Relational Model Linda Wu Relational model SQL language Integrity constraints ER to relational Views (CMPT 354 2004-2) Chapter 3 CMPT 354 2004-2 2 Why Study the Relational Model? Most widely used

More information

Introduction to Database Design

Introduction to Database Design Introduction to Database Design UVic C SC 370 Daniel M German Introduction to Database Design (1.2.0) CSC 370 4/5/2005 14:52 p.1/33 Overview What are the steps in designing a database? What is the entity-relationship

More information

CIS 330: Web-driven Web Applications. Lecture 2: Introduction to ER Modeling

CIS 330: Web-driven Web Applications. Lecture 2: Introduction to ER Modeling CIS 330: Web-driven Web Applications Lecture 2: Introduction to ER Modeling 1 Goals of This Lecture Understand ER modeling 2 Last Lecture Why Store Data in a DBMS? Transactions (concurrent data access,

More information

Introduction to Databases

Introduction to Databases Introduction to Databases Data Retrival SELECT * FROM Students S WHERE S.age < 18 Data Retrival SELECT S.name, S.login FROM Students S WHERE S.age < 18 Entity sets to tables Entity sets to tables CREATE

More information

Advance Database Management System

Advance Database Management System Advance Database Management System Conceptual Design Lecture- A simplified database design process Database Requirements UoD Requirements Collection and Analysis Functional Requirements A simplified database

More information

The Entity-Relationship Model. Steps in Database Design

The Entity-Relationship Model. Steps in Database Design The Entity-Relationship Model Steps in Database Design 1) Requirement Analysis Identify the data that needs to be stored data requirements Identify the operations that need to be executed on the data functional

More information

Introduction to Database Design. Dr. Kanda Runapongsa Dept of Computer Engineering Khon Kaen University

Introduction to Database Design. Dr. Kanda Runapongsa Dept of Computer Engineering Khon Kaen University Introduction to Database Design Dr. Kanda Runapongsa (krunapon@kku.ac.th) Dept of Computer Engineering Khon Kaen University Overview What are the steps in designing a database? Why is the ER model used

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

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

The Entity-Relationship Model. Overview of Database Design. ER Model Basics. (Ramakrishnan&Gehrke, Chapter 2)

The Entity-Relationship Model. Overview of Database Design. ER Model Basics. (Ramakrishnan&Gehrke, Chapter 2) The Entity-Relationship Model (Ramakrishnan&Gehrke, Chapter 2) CS 432 Fall 2007 1 Overview of Database Design Conceptual design: (ER Model is used at this stage.) What are the entities and relationships

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

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

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

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

Introduction to Database Design

Introduction to Database Design Introduction to Database Design UVic C SC 370, Fall 2002 Daniel M. German Department of Computer Science University of Victoria 2 1 Introduction to Database Design CSC 370 dmgerman@uvic.ca Overview What

More information

Database Applications (15-415)

Database Applications (15-415) Database Applications (15-415) The Entity Relationship Model Lecture 2, January 15, 2014 Mohammad Hammoud Today Last Session: Course overview and a brief introduction on databases and database systems

More information

ER Model Overview. The Entity-Relationship Model. Database Design Process. ER Model Basics

ER Model Overview. The Entity-Relationship Model. Database Design Process. ER Model Basics ER Model Overview The Entity-Relationship Model Davood Rafiei Developed by Peter Chen in the mid 70 s Used for the design of conceptual schema. The world is described in terms of entities relationships

More information

Why Study the Relational Model? The Relational Model. Relational Database: Definitions. The SQL Query Language. Relational Query Languages

Why Study the Relational Model? The Relational Model. Relational Database: Definitions. The SQL Query Language. Relational Query Languages Why Study the Relational Model? The Relational Model Most widely used model. Vendors: IBM, Informix, Microsoft, Oracle, Sybase, etc. Legacy systems in older models E.G., IBM s IMS Recent competitor: object-oriented

More information

Overview of db design Requirement analysis Data to be stored Applications to be built Operations (most frequent) subject to performance requirement

Overview of db design Requirement analysis Data to be stored Applications to be built Operations (most frequent) subject to performance requirement ITCS 3160 Data Base Design and Implementation Jing Yang 2010 Fall Class 12: Data Modeling Using the Entity-Relationship (ER) Model Overview of db design Requirement analysis Data to be stored Applications

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

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

The Relational Model. Why Study the Relational Model? Relational Database: Definitions The Relational Model Database Management Systems, R. Ramakrishnan and J. Gehrke 1 Why Study the Relational Model? Most widely used model. Vendors: IBM, Microsoft, Oracle, Sybase, etc. Legacy systems in

More information

CSC 261/461 Database Systems Lecture 8. Spring 2018

CSC 261/461 Database Systems Lecture 8. Spring 2018 CSC 261/461 Database Systems Lecture 8 Spring 2018 Announcement Quiz No New Problem Set Study Chapter 5, 6, and 7 Go through the problem set Announcement Project 2 Part 1 Already out. Workshop covered

More information

The Relational Model. Chapter 3. Comp 521 Files and Databases Fall

The Relational Model. Chapter 3. Comp 521 Files and Databases Fall The Relational Model Chapter 3 Comp 521 Files and Databases Fall 2012 1 Why Study the Relational Model? Most widely used model by industry. IBM, Informix, Microsoft, Oracle, Sybase, etc. It is simple,

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

The Entity-Relationship Model (ER Model) - Part 2

The Entity-Relationship Model (ER Model) - Part 2 Lecture 4 The Entity-Relationship Model (ER Model) - Part 2 By Michael Hahsler Based on slides for CS145 Introduction to Databases (Stanford) Lecture 4 > Section 2 What you will learn about in this section

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/ 1 In this chapter, you will learn:

More information

Database Design. Database Design I: The Entity-Relationship Model. Entity Type (con t) Representation in Relational Model.

Database Design. Database Design I: The Entity-Relationship Model. Entity Type (con t) Representation in Relational Model. Database Design Database Design I: The Entity-Relationship Model Chapter 5 Goal: specification of database schema Methodology: Use E-R R model to get a high-level graphical view of essential components

More information

The Relational Model. Chapter 3

The Relational Model. Chapter 3 The Relational Model Chapter 3 Why Study the Relational Model? Most widely used model. Systems: IBM DB2, Informix, Microsoft (Access and SQL Server), Oracle, Sybase, MySQL, etc. Legacy systems in older

More information

CMSC 424 Database design Lecture 3: Entity-Relationship Model. Book: Chap. 1 and 6. Mihai Pop

CMSC 424 Database design Lecture 3: Entity-Relationship Model. Book: Chap. 1 and 6. Mihai Pop CMSC 424 Database design Lecture 3: Entity-Relationship Model Book: Chap. 1 and 6 Mihai Pop Database Design Steps Entity-relationship Model Typically used for conceptual database design info Conceptual

More information

The Relational Model. Chapter 3. Database Management Systems, R. Ramakrishnan and J. Gehrke 1

The Relational Model. Chapter 3. Database Management Systems, R. Ramakrishnan and J. Gehrke 1 The Relational Model Chapter 3 Database Management Systems, R. Ramakrishnan and J. Gehrke 1 Why Study the Relational Model? Most widely used model. Vendors: IBM, Informix, Microsoft, Oracle, Sybase, etc.

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

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data.

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data. Managing Data Data storage tool must provide the following features: Data definition (data structuring) Data entry (to add new data) Data editing (to change existing data) Querying (a means of extracting

More information

CSC 261/461 Database Systems Lecture 8. Fall 2017

CSC 261/461 Database Systems Lecture 8. Fall 2017 CSC 261/461 Database Systems Lecture 8 Fall 2017 Announcement Project 2 is out. Not a group project! CSC 261, Spring 2017, UR Agenda More about ER model ER model to Relation (Table) CSC 261, Spring 2017,

More information

CSE 530A. ER Model to Relational Schema. Washington University Fall 2013

CSE 530A. ER Model to Relational Schema. Washington University Fall 2013 CSE 530A ER Model to Relational Schema Washington University Fall 2013 Relational Model A relational database consists of a group of relations (a.k.a., tables) A relation (table) is a set of tuples (rows)

More information

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

THE ENTITY- RELATIONSHIP (ER) MODEL CHAPTER 7 (6/E) CHAPTER 3 (5/E) THE ENTITY- RELATIONSHIP (ER) MODEL CHAPTER 7 (6/E) CHAPTER 3 (5/E) 2 CHAPTER 7 OUTLINE Using High-Level, Conceptual Data Models for Database Design Entity-Relationship (ER) model Popular high-level conceptual

More information

Objectives of logical design... Transforming the ERD diagram into relations. Relational database components. Mapping a composite attribute

Objectives of logical design... Transforming the ERD diagram into relations. Relational database components. Mapping a composite attribute Logical database design and the relational model Objectives of logical design... Translate the conceptual design into a logical database design that can be implemented on a chosen DBMS Input: conceptual

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

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

Database Design. ER Model. Overview. Introduction to Database Design. UVic C SC 370. Database design can be divided in six major steps:

Database Design. ER Model. Overview. Introduction to Database Design. UVic C SC 370. Database design can be divided in six major steps: Database Design Database design can be divided in six major steps: Requirements analysis Conceptual Database design (mostly done using the ER model) Logical Database design Schema refinement Physical Database

More information

Database Applications (15-415)

Database Applications (15-415) Database Applications (15-415) The Relational Model Lecture 3, January 18, 2015 Mohammad Hammoud Today Last Session: The entity relationship (ER) model Today s Session: ER model (Cont d): conceptual design

More information

CSC 261/461 Database Systems Lecture 10

CSC 261/461 Database Systems Lecture 10 CSC 261/461 Database Systems Lecture 10 Spring 2018 Please put away all electronic devices Announcements From now on, no electronic devices allowed during lecture Includes Phone and Laptop Why? For your

More information

The Relational Model. Chapter 3. Comp 521 Files and Databases Fall

The Relational Model. Chapter 3. Comp 521 Files and Databases Fall The Relational Model Chapter 3 Comp 521 Files and Databases Fall 2014 1 Why the Relational Model? Most widely used model by industry. IBM, Informix, Microsoft, Oracle, Sybase, MySQL, Postgres, Sqlite,

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

Entity-Relationship Diagrams

Entity-Relationship Diagrams Entity-Relationship Diagrams Fall 2017, Lecture 3 There is nothing worse than a sharp image of a fuzzy concept. Ansel Adams 1 Recall: Relational Database Management Relational DataBase Management Systems

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

Database Systems. Overview - important points. Lecture 5. Some introductory information ERD diagrams Normalization Other stuff 08/03/2015

Database Systems. Overview - important points. Lecture 5. Some introductory information ERD diagrams Normalization Other stuff 08/03/2015 Lecture 5 Database Systems Instructor: M.Imran Khalil Imrankhalil3@gmail.com Resource:Imrankhalil3.wordpress.com University of Sargodha Canal Campus Lahore Overview - important points Some introductory

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

Conceptual Data Modeling

Conceptual Data Modeling Conceptual Data odeling A data model is a way to describe the structure of the data. In models that are implemented it includes a set of operations that manipulate the data. A Data odel is a combination

More information

The Entity-Relationship (ER) Model

The Entity-Relationship (ER) Model The Entity-Relationship (ER) Model (Study Cow book Chapter 2) Comp 521 Files and Databases Fall 2012 1 Overview of Database Design Conceptual design: (ER Model is used at this stage.) What are the entities

More information

Overview. Introduction to Database Design. ER Model. Database Design

Overview. Introduction to Database Design. ER Model. Database Design Introduction to Database Design UVic C SC 370 Dr. Daniel M. German Department of Computer Science Overview What are the steps in designing a database? What is the entity-relationship (ER) model? How does

More information

ENTITY-RELATIONSHIP MODEL. CS 564- Spring 2018

ENTITY-RELATIONSHIP MODEL. CS 564- Spring 2018 ENTITY-RELATIONSHIP MODEL CS 564- Spring 2018 WHAT IS THIS LECTURE ABOUT E/R Model: entity sets, attribute relation: binary, multi-way relationship roles, attributes on relationships subclasses (ISA) weak

More information

The Entity-Relationship (ER) Model 2

The Entity-Relationship (ER) Model 2 The Entity-Relationship (ER) Model 2 Week 2 Professor Jessica Lin Keys Differences between entities must be expressed in terms of attributes. A superkey is a set of one or more attributes which, taken

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

Introduction to Data Management. Lecture #3 (Conceptual DB Design) Instructor: Chen Li

Introduction to Data Management. Lecture #3 (Conceptual DB Design) Instructor: Chen Li Introduction to Data Management Lecture #3 (Conceptual DB Design) Instructor: Chen Li 1 Announcements v HW #1 is now available v Today s plan Conceptual DB design, cont. Advanced ER concepts 2 Weak Entities

More information

The Entity-Relationship Model

The Entity-Relationship Model The Entity-Relationship Model Chapter 2 Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Overview of Database Design Conceptual design: (ER Model is used at this stage.) What are the entities

More information

Relational Model (cont d) & Entity Relational Model. Lecture 2

Relational Model (cont d) & Entity Relational Model. Lecture 2 Relational Model (cont d) & Entity Relational Model Lecture 2 Relational Database Operators Relational algebra Defines theoretical way of manipulating table contents using relational operators: SELECT

More information

Objectives Definition iti of terms Importance of data modeling Write good names and definitions for entities, relationships, and attributes Distinguis

Objectives Definition iti of terms Importance of data modeling Write good names and definitions for entities, relationships, and attributes Distinguis Chapter 3: Modeling Data in the Organization Modern Database Management 9 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Heikki Topi 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Objectives

More information

CIS 330: Applied Database Systems

CIS 330: Applied Database Systems 1 CIS 330: Applied Database Systems Lecture 3: Introduction to ER Modeling The Relational Model Johannes Gehrke johannes@cs.cornell.edu http://www.cs.cornell.edu/johannes Announcements How many laptops

More information

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

Databases Model the Real World. The Entity- Relationship Model. Conceptual Design. Steps in Database Design. ER Model Basics. ER Model Basics (Contd. The Entity- Relationship Model CS 186 Fall 2002: Lecture 2 R &G - Chapter 2 A relationship, I think, is like a shark, you know? It has to constantly move forward or it dies. And I think what we got on

More information

Database Systems. Course Administration

Database Systems. Course Administration Database Systems ( ) September 20, 2004 Lecture #2 By Hao-hua Chu ( ) 1 Course Administration Can everyone get the textbook? HW #1 is out on the course homepage It is due one week from today. Next week

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

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

CS 146 Database Systems

CS 146 Database Systems DBMS CS 146 Database Systems Entity-Relationship (ER) Model CS 146 1 CS 146 2 A little history Progression of Database Systems In DBMS: single instance of data maintained and accessed by different users

More information

The Relational Model. Roadmap. Relational Database: Definitions. Why Study the Relational Model? Relational database: a set of relations

The Relational Model. Roadmap. Relational Database: Definitions. Why Study the Relational Model? Relational database: a set of relations The Relational Model CMU SCS 15-415/615 C. Faloutsos A. Pavlo Lecture #3 R & G, Chap. 3 Roadmap Introduction Integrity constraints (IC) Enforcing IC Querying Relational Data ER to tables Intro to Views

More information

Converting ER to Relational Schema

Converting ER to Relational Schema Converting ER to Relational Schema Project P-number P-name Due-Date 0..* Assignment 0..* 0..* Manager 1..1 Employee SSN E-Name Office 1 1 CS386/586 Introduction to Database Systems, Lois Delcambre, David

More information

SQL DDL. CS3 Database Systems Weeks 4-5 SQL DDL Database design. Key Constraints. Inclusion Constraints

SQL DDL. CS3 Database Systems Weeks 4-5 SQL DDL Database design. Key Constraints. Inclusion Constraints SQL DDL CS3 Database Systems Weeks 4-5 SQL DDL Database design In its simplest use, SQL s Data Definition Language (DDL) provides a name and a type for each column of a table. CREATE TABLE Hikers ( HId

More information

Overview of the Class and Introduction to DB schemas and queries. Lois Delcambre

Overview of the Class and Introduction to DB schemas and queries. Lois Delcambre Overview of the Class and Introduction to DB schemas and queries Lois Delcambre 1 CS 386/586 Introduction to Databases Instructor: Lois Delcambre lmd@cs.pdx.edu 503 725-2405 TA: TBA Office Hours: Immediately

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

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

CS/INFO 330 Entity-Relationship Modeling. Announcements. Goals of This Lecture. Mirek Riedewald

CS/INFO 330 Entity-Relationship Modeling. Announcements. Goals of This Lecture. Mirek Riedewald CS/INFO 330 Entity-Relationship Modeling Mirek Riedewald mirek@cs.cornell.edu Announcements Office hour update (see class homepage) First homework assignment will be available from CMS later today Some

More information

Database Design CENG 351

Database Design CENG 351 Database Design Database Design Process Requirements analysis What data, what applica;ons, what most frequent opera;ons, Conceptual database design High level descrip;on of the data and the constraint

More information

Database Applications (15-415)

Database Applications (15-415) Database Applications (15-415) The Entity Relationship Model Lecture 2, January 12, 2016 Mohammad Hammoud Today Last Session: Course overview and a brief introduction on databases and database systems

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

ER to Relational Mapping. ER Model: Overview

ER to Relational Mapping. ER Model: Overview ER to Relational Mapping Davood Rafiei 1 ER Model: Overview The world is described in terms of Entities Relationships Attributes Constraints and Complications Key constraints Participation constraints

More information

The Entity Relationship Model

The Entity Relationship Model The Entity Relationship Model CPS352: Database Systems Simon Miner Gordon College Last Revised: 2/4/15 Agenda Check-in Introduction to Course Database Environment (db2) SQL Group Exercises The Entity Relationship

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