Database Diagram
Elements of the IDEF1X1 notation are used to depict the database schema. Database diagrams illustrate the foreign keys in the database schema. The foreign key columns' properties initially calculate how the foreign keys are displayed.
You can use the established MID modeling tool to create a Database Diagram.
Test the Innovator Enterprise Modeling Suite for free.
Definition
A database diagram is a graphic representation of any part of a database schema. It can be a complete or partial image of a database's structure.
It contains tables and their columns and the foreign key edges between the tables, and possibly also views and their columns and "From" clause edges.
The icon is of a diagram with tables.
Use
You can use the database diagram to model a submodel of the database schema.
Entities are shown as nodes and relationships are shown as edges.
Elements in a Database Diagram
Nodes
The following model elements can be shown as nodes in database diagrams:
Icon | Element | Description |
---|---|---|
![]() |
Database Table | Database tables are normally initially created from entity types of the conceptual schema. You can create e.g. indexes and triggers in the DB table; it is also possible to create technical table columns. |
![]() |
Table Column | Database table columns are normally initially created from attributes of the respective entity of the conceptual schema. |
![]() |
Primary Key | Creates a primary key in a database table. The primary key is automatically created when the table is created or with the primary property on a column. |
![]() |
Alternative Key | Creates an alternative key in a database table. |
![]() |
computedColumn | Creates a table column that is stereotyped as a calculated column. |
![]() |
Database View | DB views are linked with DB tables or DB views they are made up of using From clauses. Use the DB diagram as you would when creating relationships. DB diagrams which contain DB views are used for visualizing their composition and, in doing so, their dependencies. |
![]() |
View Column | As a means of support, a View column is created in the database view for each table column in the table referenced by FROM. You only need to delete the View columns you do not want in the DB view. |
![]() |
Combined View Union View |
A combined view is modeled by its select statements, which are combined with UNION, UNION ALL, INTERSECT or EXCEPT and the setting of parentheses. A union view is a simple form of the combined view whose select statements are combined only with UNION or UNION ALL. |
![]() |
Select Statement |
Select statements are part of a combined view. They are linked with DB tables or DB views they are made up of using From clauses. |
![]() |
Index | Indexes are used for speeding up database access when searching and sorting. |
![]() |
Trigger | You can use triggers to maintain automatic values of table columns when updating, inserting or deleting. This ensures constraints are directly saved in the database without the individual application having to worry about it. |
![]() |
Verification Condition | The constrained expression verification condition creates an SQL check constraint in a database. |
Properties of Table Columns and Keys
Property icons for elements in compartments
Icon | Element | Description |
---|---|---|
![]() |
Primary Key Column | The column is part of the primary key. |
![]() |
Foreign Key Column | The column is part of a foreign key. |
![]() |
Primary/Foreign Key Column | The column is part of the primary key and a foreign key. |
![]() |
Local Column - Not Null | The column cannot contain any null values. |
![]() |
Local Column - Null | The column can contain null values. |
![]() |
Foreign Key Column - Null | The column is part of a foreign key and can contain null values. |
![]() |
Primary Key | The primary key of the table |
![]() |
Key Candidate | A key candidate of a table; remains unchanged during the entire lifespan of an instance. The primary key is the primary key candidate that is best suited to referencing by foreign keys. |
![]() |
Unique Key | A unique key can change during the lifespan of an instance. A reference using a foreign key value finds precisely one instance in the table, but this differs depending on the time of the request. |
![]() |
Denormalized Key | A denormalized key arises during the merging of tables. It indicates that the denormalized instance "knows" this key but this key does not appear in the table for the key, since in the case of denormalization, the instance can occur redundantly multiple times. Despite this, the model requires the reference of these key columns to the referencing columns. The deletion of denormalized keys does not delete the referencing column too. |
Edges
Edges depict relationships between tables in database diagrams.
Icon | Element | Description |
---|---|---|
![]() |
Foreign Key | The foreign key is a relationship between a database table and another table in which it references a key in another table. For each column of the referenced key, there is a linked foreign key column in the table with the foreign key. |
![]() |
From Clause | A From clause depicts a from connection from a database view to a database table or to another database view. The From clauses of a DB view state the sources from which the data of the view is filled. |
![]() |
Sub Select | A sub select depicts a connection from a database view to a database table or to another database view. Sub selects are used and formulated in the expressions of the view elements. |
![]() |
Reference Edge | Adds an existing reference edge to a node. Existing relationships are added as an edge in the diagram. |
![]() |
Attachment | An attachment connects a note with an element in a diagram. |
Display | Element | Description |
---|---|---|
![]() |
Foreign Key Edge | The filled circle depicts the table which contains the foreign key. |
![]() |
Foreign Key Edge | The empty diamond next to the referenced table depicts an optional foreign key, i.e. at least one of its columns allows a null value. |
![]() |
Foreign Key Edge |
A solid line depicts an identifying foreign key, i.e. all of its columns are also contained in the primary key. |
![]() |
Foreign Key Edge | A Z next to an identifying foreign key signalizes a max foreign key of 1, i.e. the primary key contains no other columns other than this foreign key. |
Further Information