Presentation is loading. Please wait.

Presentation is loading. Please wait.

MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 3 © Akhilesh Bajaj, 2000, 2002, 2003. All Rights.

Similar presentations


Presentation on theme: "MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 3 © Akhilesh Bajaj, 2000, 2002, 2003. All Rights."— Presentation transcript:

1 MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 3 © Akhilesh Bajaj, 2000, 2002, 2003. All Rights Reserved.

2 Review of Lectures 1 & 2 Entities and entity sets Relationships and relationship sets Attributes of entity sets and relationship sets Degree of relationship sets Cardinality of relationship sets Keys of entity sets Existence dependencies (weak entity sets)

3 Goals Today Learn about subclass / superclass hierarchies of entity sets Review all concepts of the ER model (questions from you!!) In-class assignments on drawing ER diagrams

4 An entity set may contain subgroupings of entities that are distinct in some way from other entities in the same set. E.g., The entity set persons contains a subgrouping of persons who are employees. Students may contain undergraduate_students and graduate_students. Subgroupings may be different from the other entities in the set in the sense that they have additional attributes (e.g., graduate_students have an undergraduate_major) or they may be involved in relationships that other entities in the same set are not (e.g., employees participate in the relationship set works_for with the entity set departments). Rule of thumb: At least 2 extra attributes and/or relationships to create a subclass Subclass / Superclass Hierarchies

5 What are some other examples of this? We say that the superset is the entity superclass, while the subset is the entity subclass. Subclasses inherit all the attributes of their superclass and also participate in all the relationship sets that the superclass participates in. E.g., employees is a subclass of persons. It inherits all the attributes of persons. It participates in all the relationship sets that persons participates in. In addition, it may have some extra attributes, and/or may participate in some extra relationship sets. Subclass / Superclass Hierarchies

6 Representation of Subclasses and Superclasses Subclass / Superclass Hierarchies Superclass IS A Subclass -------- In this course, a subclass can have one and only one superclass A superclass can have one or more subclasses. Note the inverted triangle: the base is towards the superclass. attribute

7 Subclass / Superclass Hierarchies In our ER diagram we further describe how these subclasses are formed Condition / User defined: - Condition defined: E.g., only students pursuing a masters or Ph. D. degree are graduate_students. A superclass attribute value Defines if a superclass entity is also in the subclass box. - User-defined: E.g., An employee is assigned to a work team. The superclass is employees, the subclass is employees_working_on_building_projects. The user determines At the time of data entry in which subclass box the superclass entity will go. Disjoint / Overlapping: -Disjoint: An entity can belong to only one subclass (e.g., graduate_students and undergraduate_students) -Overlapping: The same entity can belong to > 1 subclass. E.g., employees_working_on_building_projects and employees_ working_on_design_projects. Total / Partial: - Total: each entity in the superclass has to belong to a subclass -Partial: Some higher level entities may not belong to any subclass. E.g., persons and employees.

8 Representation of Subclasses and Superclasses with Descriptions Subclass / Superclass Hierarchies Superclass IS A Subclass -------- attribute User-defined, disjoint, total

9 ER Model Example University Schema: Objects: Courses, Course sections, Professors, Students (graduate and undergraduate), Classrooms, buildings Example course numbers: MIS3053, MIS4233, MIS3023. Example course section identifiers: MIS3053Fall2008A, MIS4233Fall2008A Example StudentID: 0918512 Example FacultyID: 0918452 Example BuildingID: HELM, OLIP Example classroom ID: HELM316 Events: A student takes a course section and gets a grade, a professor teaches a course section and gets a rating for that course section, a graduate student may TA a Course section, and also get a rating for it. Example grade: ‘A’ Example Professor rating: “Excellent’ Example GA rating: ‘Excellent’ Let us write an ER diagram for this description

10 In Class Assignment 1 Al’s motor shop (AMS) is an automobile repair facility owned by the Capone family. AMS has 5 repair bays. Each repair bay (place where car is repaired) has a bay_id and bay_location. AMS employs 14 employees. Each employee has an employee_id, address, phone and salary. Of these 14, 2 are office staff. They are further described by typing_speed and degree_held. The 12 mechanics are further described by tech_level. Each mechanic is assigned to work on one bay. AMS customers have a cust_id, name, address, phone. In addition, Mr. Capone also wants to capture information for each customer that lists the mechanic who last did a job for the customer, the date on which the job was done, and the amount the customer paid to AMS. Please capture the above requirements in an ER diagram.

11

12 In Class Assignment 2 Wimpy runs a burger joint. He has 6 employees working for him. Some of these are shift managers, the others are grade 1 workers. Wimpy wants you to capture information on each shift. A shift is 8 hours long. Each shift needs a shift manager and 0 or more grade 1 workers. Being a purist, Wimpy sells only burgers, and only 3 types of burgers at that: the wimpy mini, the wimpy burger and the wimpy super. Each burger type has a price, a recipe and amount of fat calories. In each shift, burgers of all 3 types can be sold. Each shift has a time began and a time ended. Wimpy wants to capture information on how many burgers were sold (of each type) in a shift. Please capture the above requirements in an ER diagram.

13


Download ppt "MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 3 © Akhilesh Bajaj, 2000, 2002, 2003. All Rights."

Similar presentations


Ads by Google