APDIS107 Lecture 3
APDIS107 Lecture 3
Good models yield good database designs that are the basis for good
applications.
DATABASE MODELS
Database Model – collection of logical constructs used to represent the data structure
and the data relationships found within the database.
b. MANIPULATIVE PART – defining the types of operation that are allowed on the
data(this includes the operations that are used for updating or retrieving data from the
database and for changing the structure of the database).
a. Entity-Relationship
b. Semantic
c. Functional
d. Object-oriented
1. ONE-TO-MANY RELATIONSHIP
A painter paints many different paintings, but each one of them is painted by only
that painter. Thus the painter(the “one”) is related to the paintings(the “many”).
Therefore, the database designers label the relationship “PAINTER” paints PAINTING”
as 1:M, Similarly, a customer account(the ”one”) might contain many invoices, but
those invoices(the “many”) are related to only a single customer account. The
“CUSTOMER generates INVOICE” relationship would also be labeled 1:M.
2. MANY-TO-MANY RELATIONSHIP
An employee might learn many job skills, and each job skill might be learned by
many employees. Database designers label the relationship “EMPLOYEE learns
SKILL” as M:N. Similarly, a student can take many courses, and each course can be
taken by many students, thus yielding the M:N relationship label for the relationship
expressed by “STUDENT takes COURSE”.
3. ONE-TO-ONE RELATIONSHIP
A retail company’s management structure may require that each one of its stores
be managed by a single employee. In turn, each store manager – who is an employee
– only manages a single store. Therefore, the relationship “EMPLOYEE manages
STORE” is labeled 1:1.
ASSIGNMENT: