Database Reference
In-Depth Information
EMPLOYEE
employee-1
employee-2
employee-3
DEPARTMENT
department-1
department-2
department-3
Figure 7-3
Entity types and entities.
Note the two examples shown in the figure:
Entity Types—EMPLOYEE, DEPARTMENT
Entity—Individual occurrences of each entity type
Entity Sets
You now understand the meaning of the two terms “entity” and “entity type.” Take
the example of the entity type EMPLOYEE. Assume that there are 5000 employ-
ees in the database at a given time. This is the set of employee entities in the data-
base at that time. “Entity set” refers to the entire group of entities of an entity type
in the database at a given time.
Figure 7-4 explains the concept of entity set.
Note the sets of employee and department entities shown in the figure. In prac-
tice, the name of the entity type also refers to the entity set. See how the entity type
EMPLOYEE refers to the set of employee entities. A rectangular box denotes an
entity type in the E-R data model.
Weak Entity Types
Consider the real-world situation of customers placing orders and orders contain-
ing one or more detail lines. Each detail line in an order contains the data about a
product ordered. For this small set of real-world information requirements you can
come up with three entity types as shown in Figure 7-5.
Now think about these three entity types, especially about the existence of enti-
ties of these types. An entity of CUSTOMER can exist whether a corresponding
entity of ORDER exists or not. Each customer entity is uniquely identified inde-
Search WWH ::




Custom Search