Figure: Database Modeling and Implementation Process
Figure: Database Modeling and Implementation Process
render them in the E/R model. The abstract E/R design is then
converted to a schema in the data-specification language of
some DBMS. Most commonly, this DBMS uses the relational
model.
price
Makes Company
Product
stockprice
Buys
Employs
Person
address name
Let us design a database for a Lab, including
information about student and team. Information
about a student includes id, name (e.g., first name,
last name), grade. A team has team number and
grade. We also need to record the student(s) who
form team. A student can be in one team, a team
can have many students. Draw the E/R diagram for
this database.
lastname firstname
name
studentGrade
ID
Forms Team
Student
teamNumber teamGrade
one-one:
1 a
2 b
3 c
d
1 a
many-one 2 b
3 c
d
1 a
2 b
many-many 3 c
d
makes Company
Product
buys
employs
Person
purchaseDate
studentGrade
ID price
Student Product
18
There are several ways this constraint could be
enforced:
20
Example:
Representing a constraint on the number of students per team
<=5
21
Entity sets are weak when their key attributes come from other
classes to which they are related.
- part-of hierarchies
- splitting n-ary relations to binary.