FDatabase Ch3
FDatabase Ch3
Outlines:1) Using High-Level Conceptual Data Models for Database Design. 2) Entity Types, Entity sets, Attributes, and Keys. 3) Relationship Types, Relationship Sets, Roles, and Structural Constraints. 4) ER Diagrams, Naming conventions, and Design Issues.
Functional Requirements
Functional Analysis High-Level Transaction Specification
DBMS-independent DBMS-specific
Data Requirements
Conceptual Design Conceptual Schema (Ina high-level data model) Logical Design (Data Model Mapping) Logical (Conceptual) Schema
attribute values that describe each entity become a major part of the
data stored in the database.
Types of Attributes
1- Composite Attributes: can be divided into smaller subparts, which represent more basic attributes with independent meanings.
ZIP
Number
2- Simple (Atomic) Attributes: that are not divisible are called simple or atomic attributes. For example, City, Number.
car, or a College Degrees attribute for a person. Cars with one color
have a single value, whereas two-tone cars have two values for Colors. 5- Stored Attributes : The attribute value that related with another attribute value and can be derive this attribute. For example Birth date. 6-Derived Attributes: In some cases, two (or more) attribute values are related-for example, the Age and Birth date attributes of a
An entity type may also have no key, in which case it is called a weak entity type.
name, a Unique number, and a particular employee who manages the department.
We keep track of the Start date when that employee began managing the department. A department may have several Locations. 2- A department controls a number of Projects, each of which has a Unique
department. We keep track of the Number of hours per week that an employee
works on each project. We also keep track of the direct supervisor of each employee. 4- We want to keep track of the Dependents of each employee for insurance
purposes. We keep each dependent's First name, Gender, Birth date, and
Relationship to the employee.
10
Derived Attribute
Multivalued Attribute
Letters.
Composite Attribute E1 1
R
N
(min, max)
E2
Total Participation of E2 IN R
E1
R R
E2
11
e2
e3 e4 e5 e6 . .
.
.
13
Relationship Degree
The number of entity sets that participate in a relationship is called the degree of the relationship. The three most common degrees of a relationship in a database are:
14
Supplier s1
s2
s3 s4
Supply
Part
r4 r5 r6
p1 p2 p3
.
.
15
e2
e3 e4 e5 e6 e7
1 2
2
r6
. .
16
17
entity depends on its being related to another entity via the relationship
type. This constraint specifies the minimum number of relationship instances that each entity can participate in, and is sometimes called the minimum cardinality constraint. There are two types of participation constraints (total and partial). An example for Total participation, An employee entity can exist only if it participates in at least one WORKS_FOR relationship instance. Total
18
A weak entity type normally has a Partial Key, which is the set of
attributes that can uniquely identify weak entities that are related to the same owner entity.
19