Download presentation
Presentation is loading. Please wait.
Published byΣταματία Ζαχαρίου Modified over 5 years ago
5
Question Which of the following plays an important role in representing information about the real world in a database? Explain briefly 1)DDL )DML 3)Buffer manager 4)the data model
6
E-R Model Attribute Attribute Employees ssn name lot Attribute Entity
7
E-R Model dname did dbudget Department Attribute Attribute Attribute
Entity
8
Figure. The Report_To Relationship Set
name ssn lot Employees super-visor subor-dinate Reports_To Figure. The Report_To Relationship Set since name dname ssn lot did budget Employees Works_In Departments Figure. The Works_in Relationship set
9
E-R Model Figure. Key Constraint on Manages since lot name ssn dname
did budget Manages Employees Departments Figure. Key Constraint on Manages
10
Mapping cardinality of a relationship
1-to-1 1-to Many Many-to-1 Many-to-Many
11
1-to-many
12
Many - 1
13
Many - many
14
Alternative Cardinality Specification
15
Department major offers faculty teaches Professor advisor enrollment
Courses teaches Professor advisor enrollment Students
16
Department major offers faculty teaches Professor advisor enrollment
Courses teaches Professor advisor enrollment Students
17
Participation Constraints
since since name name dname dname ssn lot did did budget budget Employees Manages Departments Works_In since
18
Weak Entities name cost ssn lot pname age Employees Policy Dependents
19
ISA (`is a’) Hierarchies
name ssn lot Employees hourly_wages hours_worked ISA contractid Hourly_Emps Contract_Emps
20
Aggregation name ssn lot Employees Monitors until started_on since
dname pid pbudget did budget Projects Sponsors Departments
21
Entity vs. Attribute Figure. The Works_In4 Relationship Set
from to name Employees ssn lot dname did budget Works_In4 Departments Figure. The Works_In4 Relationship Set name dname budget did ssn lot Employees Works_In4 Departments Duration from to Figure. The Works_In4 Relationship Set
22
Entity vs. Relationship
since dbudget name dname ssn lot did budget Employees Manages2 Departments Figure. The Manages2 Relationship Set name ssn lot since dname Employees did budget Manages2 Departments ISA This fixes the problem! Managers dbudget Figure. The Manages2 Relationship Set
23
Binary vs. Ternary Relationships
name Employees ssn lot pname age Covers Dependents Bad design Policies policyid cost <- Figure. Policies as an entity Set name Employees ssn lot pname age Dependents Purchaser Beneficiary Better design Figure. PolicyRevisited policyid cost Policies
24
Exercises 1)Explain the following terms briefly: attribute, domain, entity, relation-ship, entity set, relationship set, one-to-many relationship, many-to-many relationship, participation constraint, overlap constraint, covering constraint, weak entity set, aggregation, and role indicator
25
2) A university database contains information about professors (identified
employee id No., or EIN) and courses (identified by courseid). Professors teach courses; each of the following situations ,concerns the Teaches relationship set. For each situation, draw an ER diagram that describes it (assuming no further constraints hold) i. Professors can teach the same course in several semesters, and each offering must be recorded. ii. Professors can teach the same course in several semesters, and only the most recent such offering needs to be recorded . (Assume this condition applies in all subsequent questions.) iii. Every professor must teach some course
26
iv. every professor teaches exactly one course (no more, no less).
v. Every professor teaches exactly one course (no more, no less), and every course must be taught by some professor
27
vi. Now suppose that certain courses can be taught by a team of professors jointly,
but it is possible that no one professor in a team can teach the course. Model this situation, introducing additional entity sets and relationship sets if necessary
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.