Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

CONCEPTUAL DATA MODEL (CDM)

Relationships
A relationship is an association among two or more entities. For example, a
STUDENTS entity might be related to a COURSES entity, or an EMPLOYEE entity
might be related to an OFFICES entity.

When these relationships are implemented in the database, they provide the links
among the various tables.

Inheritance
■Supertypeentity: an entity that is in relation with one or more subtype
entities. It contains attributes that are common with it sub entities.
■Subtype entity: it is a part of a supertypeentity. It has unique
attributes.

LOGICAL DATA MODEL (LDM)


A relational table
Corresponds to an entity type, or an association type
It’s composed of attributes (columns) that describe the type
Relations with other tables are expressed by foreign keys (a foreign key
corresponds to a primary key in the related table)
 Each entity becomes a table
 Each attribute becomes a column in the table Entity
 Each entity becomes a table
 The entity identifier becomes the primary key of the table becomes
Client (Id, Name, Address)
A) Relationships: 1, 1 – 0, n or 1, 1 – 1, n
■ The identifier of the entity with cardinality 0,n or 1,n is added as a foreign key to
the table resulting from the entity with 1,1 cardinality
Client (ClientID, Name, Address)
Order (OrderID, Date, DeliveryAddress, ClientID)

1
B) Relationship 1, 1 – 0, 1
■ The identifier of the entity with cardinality 0,1 is added as a foreign key to the
table resulting from the entity with 1, 1 cardinality
Employee ( EmpID, Name)
Department (DepID, NameDep, EmpID)
C) Relationships 1, n – 1, n 1, n – 0, n 0, n – 0, n
 The relation becomes a new table
 The new table has the identifiers of the 2 entities as a primary key
 The properties of the relation become columns of the new table
Driver (DriverID, Name)
Competition (CompetitionID, date)
Position (DriverID, Rank, CompetitionID)
D) Relationships 0, 1 – 0, n or 0, 1 – 1, n
The relation becomes a new table. It has:
The identifier of the entity with 0,1 cardinalities as a primary key
The primary key of the entity with 0, n cardinality as a foreign key
Attributes of the relation as columns:
Employee (EmpID, Name)
Project (ProjectID, Budget)
Works On (EmpID, dateStart, ProjectID)
E) Relationships 0, 1 - 0, 1
The relation becomes a new table. It has:
The identifier of the independent entity as a primary key
The identifier of the dependent entity as a foreign key
The attributes of the relation as columns
Closet (ClosetID)
Student (StudentID, Fname, Lname)
Own (StudentID, OwnDate, ClosetID)
F) Relationships 1, 1 - 1, 1
-The identifier of the independent entity is a foreign key in the dependent entity
Invoice (InvoiceID, InvDate)
Receipt (ReceiptID, RecDate, RecAmount, InvoiceID).

You might also like