Database Reference
In-Depth Information
The LastName column is a secondary key, which allows you to retrieve data more efficiently based on
an employee
s last name. (You can add additional secondary key designations later as necessary.) The
DepartmentNum column is a foreign key that identifies the department number in the Department table
in which the employee works.
'
Entity-Relationship (E-R) Diagrams
A popular type of diagram that visually represents the structure of a database is the entity-relationship (E-R)
diagram. In an E-R diagram, rectangles represent the entities (tables). Foreign key restrictions determine
relationships between the tables, and these relationships are represented as lines joining the corresponding
rectangles.
There are several different styles of E-R diagrams currently in use. In this text, the style you will use is
called IDEF1X.
188
NOTE
IDEF stands for “Integrated Definition” and is the name for a family of modeling languages that began with a project of the U.S.
Air Force called Integrated Computer Aided Manufacturing. There are languages for such areas as activity modeling (IDEF0),
conceptual data modeling (IDEF1), simulation modeling (IDEF2), process modeling (IDEF3), and object-oriented software
design (IDEF4). The language in this family for logical data modeling is IDEF1X.
Consider the following database design written in DBDL:
Department (DepartmentNum, Name, Location)
Employee (EmployeeNum, LastName, FirstName, Street, City,
State, Zip, WageRate, SocSecNum, DepartmentNum)
AK SocSecNum
SK LastName, FirstName
FK DepartmentNum fi Department
The E-R diagram for the preceding database design appears in Figure 6-2.
Entity
names
Entities
are drawn as
rectangles
Primary keys
appear above
the line
Department
DepartmentNum
Name
Location
Employee
EmployeeNum
Other
columns appear
below the line
LastName (SK)
FirstName (SK)
Street
City
State
Zip
WageRate
SocSecNum (AK)
DepartmentNum (FK)
Dashed
line indicates the
relationship
Dot
indicates the
“many” part of the
relationship
FIGURE 6-2
E-R diagram
The E-R diagram shown in Figure 6-2 has the following characteristics:
￿
A rectangle represents each entity in the E-R diagram
there is one rectangle for the
Department entity and a second rectangle for the Employee entity. The name of each
entity appears above the rectangle.
Search WWH ::




Custom Search