Download presentation
Presentation is loading. Please wait.
Published byJob Dean Modified over 9 years ago
1
Chapter 7: Data Modeling Using the Entity Relationship (ER) Model
2
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Database Design Phases
3
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
4
Instance of entities with attributes
5
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Composite attribute:
6
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Entity Type v.s. Entity Set
7
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
9
Relationship
10
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Ternary Relationship Can you think of another example?
11
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Role name of entity and Recursive Relationship
12
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Cardinality ratio: 1:1
13
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Cardinality ratio: M:N
14
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Continued next page… Symbols in ER Diagram
15
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
16
Relationship with higher degree ? why a ≠ b ? Find an equivalent binary relationship
17
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
18
Exercise 1: 1.What are the entities in the E-R diagram? 2.Which queries could be answered using this database? a.List all airports (airport_code) in New York State. b.List the airlines with frequent flier program. c.List airplanes (airplane_id) that could land on Minneapolis Airport. d.List the airplanes (airplane_id) assigned to flight #5 for Delta Airline. e.List all airports within 500 miles of Minneapolis Airport. f.List flight leg instances which were late by at least on hour. 3.In this database, how many fares are possible for a give flight? (A). at most one; (B). many 4.How many scheduled arrive time could a flight have for a given airport? (A). at most one; (B). many
19
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 5. Which of the following have unique values in the database? ① airport_code ② airplane_id ③ seat_no. ④ leg_no.
20
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Exercise 2: The database needs to keep track of each U.S. STATE’s Name (e.g., ‘Texas’, ‘New York’, ‘California’) and include the Region of the State (whose domain is {‘Northwest’, ‘Midwest’, ‘Southeast’, ‘Southwest’, ‘West’}). Each CONGRESS_PERSON in the House of Representatives is described by his or her Name, plus the District represented, the Start_Date when the congressperson was first elected, and the political Party to which he or she belongs (whose domain is {‘Republican’, ‘Democrat’, ‘Independent’, ‘Other’}). The database keeps track of each BILL (i.e., proposed law), including the Bill_name, the Data_of_vote on the bill, whether the bill Passed_or_failed (whose domain is ‘yes’ or ‘no’), and the Sponsor (the congressperson(s) who sponsored-that is, proposed-the bill). The database also keeps track of how each congressperson voted on each bill (domain of Vote attribute is {‘yes’, ‘no’, ‘abstain’,’absent’}).
21
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1.Identify major entities and their identifying attributes 1.Identify major relationship among entities and their cardinality constraints (1:1, 1:N, M:N) 1.Design an ER schema diagram for this application.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.