1 / 12

Figure 4-4a – Example of generalization

Figure 4-4a – Example of generalization. Notice anything?. All these types of vehicles have common attributes. So we put the shared attributes in a supertype. Note: no subtype for motorcycle, since it has no unique attributes. Figure 4-4b – Generalization to VEHICLE supertype.

lenka
Download Presentation

Figure 4-4a – Example of generalization

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Figure 4-4a – Example of generalization Notice anything? All these types of vehicles have common attributes

  2. So we put the shared attributes in a supertype Note: no subtype for motorcycle, since it has no unique attributes Figure 4-4b – Generalization to VEHICLE supertype

  3. Applies only to purchased parts Only applies to manufactured parts Figure 4-5a – Example of specialization

  4. Figure 4-5b – Specialization to MANUFACTURED PART and PURCHASED PART Note: multivalued attribute was replaced by a relationship to another entity Created 2 subtypes

  5. Figure 4-6b – Partial specialization rule A vehicle could be a car, a truck, or neither

  6. Example COMPANY Database • Requirements of the Company (oversimplified for illustrative purposes) • The company is organized into DEPARTMENTs. Each department has a name, number and an employee who manages the department. We keep track of the start date of the departmentmanager. • Each department controls a number of PROJECTs. Each project has a name, number and islocated at a single location.

  7. Example COMPANY Database (Cont.) • We store each EMPLOYEE’s social security number, address, salary, sex, and birthdate. Each employee works for one department but may work on several projects. We keep track of the number of hours per week that an employee currently works on each project. We also keep track of the direct supervisor of each employee. • Each employee may have a number of DEPENDENTs. For each dependent, we keep track of their name, sex, birthdate, and relationship to employee.

  8. ER DIAGRAM FOR THE COMPANY DATABASE

  9. Academic Teaching Database Design an E-R schema for a database to store info about professors, courses and course sections indicating the following: • The name and employee ID number of each professor • The salary and email address(es) for each professor • How long each professor has been at the university • The course sections each professor teaches • The name, number and topic for each course offered • The section and room number for each course section • Each course section must have only one professor • Each course can have multiple sections

  10. Visual View of the Database Employee ID Years Teaching Section ID Room Start Date N 1 Section Professor teaches Email N Salary First Part of Name Last 1 Number Course Topic Name

  11. Example: University Database • Professors work for only one department • Departments have many professors • Each course is taught by only one professor • Students make a plan or program of study • A course could meet in several rooms/times • Graduate students must have an advisor • Cities are categorized as resident/BirthPlace • Visiting prof. need an End/Start date

More Related