Mapping-Day2ddddddddddddddddddddddddd.ppt

AbdelhameedRabieaaKh 8 views 26 slides Oct 30, 2025
Slide 1
Slide 1 of 26
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26

About This Presentation

ffffffffffffffffffffffffffffffffffffffffffffff


Slide Content

10/30/25

Table or entity: a collection of records
Attribute or Column or field: a Characteristic
of an entity
Row or Record or tuble: the specific
characteristics of one entity
Database: a collection of tables

Primary Key
Foreign Key
composite primary key

Step 1: Mapping of Regular Entity Types
Step 2: Mapping of Weak Entity Types
Step 3: Mapping of Binary 1:1 Relation Types
Step 4: Mapping of Binary 1:N Relationship Types.
Step 5: Mapping of Binary M:N Relationship Types.
Step 6: Mapping of N-ary Relationship Types.
Step 7: Mapping of Unary Relationship.

Create table for each entity type
Choose one of key attributes to be the primary
key

8
(a) CUSTOMER
entity type with
simple
attributes
(b) CUSTOMER relation

9
CUSTOMER
entity type with
composite
attribute
CUSTOMER relation with address detail

10
1 – to – many relationship between original entity and new relation
Multivalued attribute becomes a separate relation with foreign key

11
In the most cases Derived attribute not be
stored in DB
Mapping Complex Like Mapping Multivalued
attribute then including parts of the multivalued
attributes as columns in DB

ERD Concepts
2 tables
Customer
ADDRESS(CID,Street,City,Country)
customer has account
balance
number
10/30/25
address
Street CountryCity

Create table for each weak entity.
Add foreign key that correspond to the owner
entity type.
Primary key composed of:
Partial identifier of weak entity
Primary key of identifying relation (strong
entity)

Composite primary key

Employee Has Computer
1 1
Employee(EID, Ename)
Computer(CID, Cname, EID_FK)
EID EName CID CName

Employee work Department
M 1
Department(DID, Dname)
Employee(EID, Ename,DID)
EID EName DID DName

Create a new third table
Add FKs to the new table for both parent
tables
Add simple attributes of relationship to the
new table if any .

10/30/25
Many-to-Many
Student take Course
M M
3 tables
tbl_x (PKx,….,…….)
tbl_y (PKy,….,…….)
tbl_xy (PKx ,PKy, ….,…….)
PKxy= PKx+PKy
Student(SID, Sname)
Course(CID, Cname)
Stud_Course(SID, CID)
SID SName CID CName

The Supplies relationship will need to become a separate relation
Foreign key
Foreign key
Composite primary key

(a) EMPLOYEE entity with
Manages relationship
(b) EMPLOYEE
relation with
recursive foreign
key

10/30/25 ERD Concepts

10/30/25 ERD Concepts
Tags