Database Tables

Tables are the fundamental components of a relational database, representing multiple rows of structured data elements (referred to as Columns). Every individual item of data entered into a relational database is represented by a value in a column.

Enterprise Architect's UML Profile for Data Modeling represents:

  • Database Tables as UML Class objects with a stereotype of <<table>>
  • Table columns as UML attributes of a Table, with a stereotype of <<column>>
  • Primary Keys as UML operations/methods of a Table, with a stereotype of <<PK>>
  • Foreign Keys as UML operations/methods of a Table, with a stereotype of <<FK>>
  • Indexes as UML operations/methods of a Table, with a stereotype of <<index>>
  • Unique Constraints as UML operations/methods of a Table, with a stereotype of <<unique>>
  • Check Constraints as UML operations/methods of a Table, with a stereotype of <<check>>
  • Table Triggers as UML operations/methods of a Table, with a stereotype of <<trigger>>

Enterprise Architect refers to all of the UML operations of a Table collectively as Constraints, hence the screen you use to maintain a Table's UML attributes and operations is called the Columns and Constraints screen.

Example

This simple example of a Physical Data Model diagram in Enterprise Architect consists of two Database Tables represented by UML Classes, named customers and customer_addresses.

Each Table defines database columns, using UML attributes typed appropriately for the target DBMS (in this case, PostgreSQL).

Notes

  • The Table stereotype is denoted by the icon in the top-right corner of each Class (see the Data Modeling Notation topic)
  • The Enterprise Architect maintenance screen for managing Table Columns doesn't allow you to change the attributes stereotype, since <<column>> is the only valid option
  • It is possible to hide the <<column>> stereotype label shown in the example Tables (see the Data Modeling Notation topic)

Learn more