230 likes | 507 Views
Chapter 7: Data Modeling Using the Entity Relationship (ER) Model. Database Design Phases. Instance of entities with attributes. Composite attribute:. Entity Type v.s. Entity Set. Relationship. Ternary Relationship. Can you think of another example?.
E N D
Chapter 7: Data Modeling Using the Entity Relationship (ER) Model
Ternary Relationship Can you think of another example?
Symbols in ER Diagram Continued next page…
Relationship with higher degree ? why a ≠ b ? Find an equivalent binary relationship
Exercise 1: • What are the entities in the E-R diagram? • Which queries could be answered using this database? • List all airports (airport_code) in New York State. • List the airlines with frequent flier program. • List airplanes (airplane_id) that could land on Minneapolis Airport. • List the airplanes (airplane_id) assigned to flight #5 for Delta Airline. • List all airports within 500 miles of Minneapolis Airport. • List flight leg instances which were late by at least on hour. • In this database, how many fares are possible for a give flight? • (A). at most one; (B). many • How many scheduled arrive time could a flight have for a given airport? • (A). at most one; (B). many
5. Which of the following have unique values in the database? • airport_code • airplane_id • seat_no. • leg_no.
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’}).
Identify major entities and their identifying attributes • Identify major relationship among entities and their cardinality constraints (1:1, 1:N, M:N) • Design an ER schema diagram for this application.