Microsoft Office Tutorials and References
In Depth Information
Entity-Relationship Diagrams
A common shorthand method for describing tables is to write the table name followed by
its fields in parentheses, underlining the fields that represent the primary key and identify-
ing the foreign keys for a table immediately after the table. Using this method, the tables
that appear in Figures A-5 through A-7 and Figure A-9 are described in the following way:
Department ( DeptNum , DeptName, DeptHead)
Foreign key: DeptHead to Employee table
Employee ( EmployeeNum , FirstName, LastName, DeptNum)
Foreign key: DeptNum to Department table
Position ( PositionID , PositionDesc, PayGrade)
Employment ( EmployeeNum , PositionID , StartDate, EndDate)
Foreign key: EmployeeNum to Employee table
Foreign key: PositionID to Position table
EmployeeBonus ( EmployeeNum , Bonus)
Foreign key: EmployeeNum to Employee table
Another popular way to describe tables and their relationships is with entity-relationship
diagrams. An entity-relationship diagram (ERD) shows a database’s entities and the rela-
tionships among the entities in a symbolic, visual way. In an entity-relationship diagram, an
entity and a table are equivalent. Figure A-10 shows an entity-relationship diagram for the
tables that appear in Figures A-5 through A-7 and Figure A-9.
Figure A-10
An entity-relationship diagram
works in
Entity-relationship diagrams have the following characteristics:
• Entities, or tables, appear in rectangles, and relationships appear in diamonds. The
entity name appears inside the rectangle, and a verb describing the relationship appears
inside the diamond. For example, the Employee rectangle is connected to the
Department rectangle by the “works in” diamond and is read: “an employee works in a
• The 1 by the Department entity and the M by the Employee entity identify a one-to-
many relationship between these two entities. In a similar manner, a many-to-many
relationship exists between the Employee and Position entities and one-to-one relation-
ships exist between the Department and Employee entities and between the Employee
and EmployeeBonus entities.
Search JabSto ::

Custom Search