Identifying Entities and Attributes

From InterBase
Jump to: navigation, search

Go Up to Designing Databases


Based on the requirements that you collect, identify the objects that need to be in the database—the entities and attributes. An entity is a type of person, object, or thing that needs to be described in the database. It might be an object with a physical existence, like a person, a car, or an employee, or it might be an object with a conceptual existence, like a company, a job, or a project. Each entity has properties, called attributes, that describe it.

For example, suppose you are designing a database that must contain information about each employee in the company, departmental-level information, information about current projects, and information about customers and sales. The example below shows how to create a list of entities and attributes that organizes the required data.

List of entities and attributes
Entities Attributes

EMPLOYEE

Employee Number

Last Name

First Name

Department Number

Job Code

Phone Extension

Salary

DEPARTMENT

Department Number

Department Name

Department Head Name

Department Head Employee Number

Budget

Location

Phone Number

PROJECT

Project ID

Project Name

Project Description

Team Leader

Product

CUSTOMER

Customer Number

Customer Name

Contact Name

Phone Number

Address

SALES

PO Number

Customer Number

Sales Rep

Order Date

Ship Date

Order Status

By listing the entities and associated attributes this way, you can begin to eliminate redundant entries. Do the entities in your list work as tables? Should some columns be moved from one group to another? Does the same attribute appear in several entities? Each attribute should appear only once, and you need to determine which entity is the primary owner of the attribute.

For example, DEPARTMENT HEAD NAME should be eliminated because employee names (FIRST NAME and LAST NAME) already exist in the EMPLOYEE entity. DEPARTMENT HEAD EMPLOYEE NUM can then be used to access all of the employee-specific information by referencing EMPLOYEE NUMBER in the EMPLOYEE entity. For more information about accessing information by reference, see Establishing Relationships between Objects.

The next section describes how to map your lists to actual database objects—entities to tables and attributes to columns.

Advance To: