Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

Tables and Columns

Tables and columns form the basis of Physical data models.

Topics

Topic

Detail

See also

Rows and Columns

The basic structural element of a relational database is the table, which represents a set of records, or rows, that have the same structure.

Each row contains one or more columns.

Every individual item of data entered into a relational database is represented by a value in a column of a row in a table.

Enterprise Architect's UML Profile for Data Modeling represents:

Database tables as Classes with a stereotype of <<table>>
Columns by Attributes with a stereotype of <<column>>

 

Create a Table

Create Columns

Example

A simple example of a Physical data model in Enterprise Architect is shown below. The example consists of two tables represented by UML Classes, named SalesPerson and Customer. The table stereotype is denoted by the icon in the top-right corner of each Class.

The tables each define three columns using UML Attributes typed appropriately for the target DBMS, which happens to be MySQL.

A simple Data model consisting of two tables, represented by UML Classes

A simple Data model consisting of two tables, represented by UML Classes

 

Add New Datatypes

Default DBMS

Prior to creating a tables in a Physical data model it is advisable to set the default DBMS. This pre-sets the default database when you create any new Table elements.

If the DBMS is not set, Tables are created without a DBMS type and field typing cannot be allocated when creating new fields in the table.

You can set the default DBMS type using either:

The Settings | Database Datatypes menu option or
The Code Generation Toolbar

 

Add New Datatypes

Attribute/Field Mapping

To help you map Class Attributes to Table fields, you can create connectors between specific attributes (features) in the Class element and the column Attributes in the Table element.

 

Connect to Element Feature

Model Driven Architecture

Enterprise Architect can generate simple DDL scripts to create the tables in your model. You can also perform Model Driven Architecture (MDA) Transformations to DDL - Enterprise Architect provides a template specifically for DDL transformations.

 

Model Transformation

DDL Transformation

Primary and Foreign Keys

 

Primary Key and Foreign Key information modeling is considered in later topics.

Primary and Foreign Keys