Terminology

The design of a database is traditionally done in an entity relationship diagram (ERD). However, the UML generalizes ERDs into class diagrams. This section bridges the traditional terminology to the newer terminology.

A table in a database is represented by a textbfclass in a class diagram. Well, almost. In database design, a table implies both the structure as well as the data. A class, on the other hand, only includes the structure. Strictly speaking it is the schema of a table that is equivalent to a class.

A table has rows and columns. A column in a table is an attribute of a class. A row in a table is an object ``manufactured'' from a class. It is also common to say a row in a table is an instance of a class.

Tables in a database are often related in a relational database. In practice, it means that a column of one table may contain the foreign key into the primary key of another table. This is represented by a relationship/link/association in a class diagram.

A primary key of a table is a column (or a collection of columns) such that each row can be uniquely identified. A foreign key is a column (or a collection of columns) of a table that is used to lookup rows in another table.

Copyright © 2005-05-16 by Tak Auyeung