Database Section 1
Database Section 1
(ERD)
Eng:Mohamed eldawansy
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY
Problem identification
Analysis
Logical Design
Physical Design
Mapping
Implementation
Basic Definitions
Database System
2
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY
DBMS Advantages
DBMS Disadvantages
3
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY
4
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY
5
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY
Partial key:
§ A set of attributes that can be associated with P.K of an owner
entity set to distinguish a weak entity.
1. Composite Attribute
2. Multi-valued Attribute
3. Derived Attribute
4. Complex Attribute
5. Simple Attribute
Simple Attribute
access-date
cust-name number
cust-id
cust-street
cust-city balance
6
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY
Composite Attribute
Derived Attribute
7
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY
Multi-valued
Complex Attribute
8
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY
Relationship
A Relationship is an association among several entities.
Ø Degree of Relationships
Ø Cardinality Constraint
Ø Participation Constraint
1-Degree of Relationships
9
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY
10
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY
2-Cardinality
How many instances of one entity will or must be connected to a
single instance from the other entities.
Ø One-One Relationship
Ø One-Many Relationship
Ø Many- Many Relationship
11
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY
12
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY
13
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY
Keys
1-Candidate key:
§ is a set of one or more attributes whose value can uniquely
identify an entity in the entity set
Ø Any attribute in the candidate key cannot be omitted without
destroying the uniqueness property of the candidate key.
Example:
Ø (SSN, Name) is NOT a candidate key .
Ø “SSN” is a candidate key of customer.
Ø Candidate key could have more than one attributes.
14
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY
Primary Key
Example: Both “SSN” and “License #” are candidate keys of Driver
entity set.
Primary Key: is the candidate key that is chosen by the database
designer as the unique identifier of an entity.
[Unique & Not Null]
Primary key May be Composite
15
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY
Case study
College has decided to store information about its Students and
curriculums in a database. College has wisely chosen to hire you as a
database designer. Prepare an E-R diagram for College that describes
its activities according to The following Description:
17