Purpose: The purpose of the Relational Diagram is to document the relationship between different types of information on a physical level. Below, you can see an example of a Relational Diagram showing the relationship an Order in a booking system to related data.

Core concerns: The Relational Diagram is a physical data model and consists of Tables and Physical Foreign Keys. Inside each table, information about Indexes, the related Data Entity, Columns and Physical keys.
Relation to other templates: The Relational Diagram offers a more detailed view on data and its interrelationships than for example the Conceptual Data Model and the Business Object Model. Other physical data models include the Data Mapping Diagram, the Class Diagram, the Data Model Diagram and the Data Replication Diagram.
Properties and metadata: The Relational Diagram can for example retain the following information:
- A description of the diagram
- Link to the owner of the diagram
- Link to the one responsible for the accuracy of the diagram
- Audits (auto generated information regarding its current state and access rights)
- Associated documents, diagrams and other objects
- Inherent Risk detailing risk considerations
- Governance information detailing information about the published diagram and who has been involved in the approval of the diagram
- Project status: information about budgeted and actual man-hours spent, percentage completed and the latest milestone, result and quality control of a change process.
In the picture below you can see the Relational Diagram’s properties dialogue window, where the properties can be viewed and edited:

Reverse and forward Engineering
The RelationalDiagram can be used to Reverse engineer a database.
Right click on the white canvas to open the dialog for the Diagram.

On the main tab you can add a link to a Data Source (linking a DataSourceConnection).
Once you can have addded a DataSource you can select Catalogue and Schema from the drop-down menu. If the drop-down list is empty, then the DataSourceConnection isn’t working, and you have to test it, see more.
NOTE there need to be a parent SubjectArea for the diagram for this to work, if not you will get this message.

You can link a SubjectArea to a RelationalDiagram from the SubjectArea, see more here.
Physical Detail
Add the default values by right clicking and select “Use from Default”

Reverse Engineer
It is now possible to reverse engineer the Relational Diagram using the Setting from above (DataSourceConnection, Catalog, Schema, and Setting on Physical Detail).
Select Reverse Engineer from the Tools menu i QLM, and select the tables to be included in the Diagram.

After a little while the Diagram is created (reverse engineered)

You can re-arrange the symbols to get a good representation.

The Green dots represent that the Model correspond to the real Database.
You can open the properties of the tables on the diagram.

If you change the properties of the table so that it no longer corresponds to the databasestructure, the dot turns from green to yellow on the diagram.
Table – Physical Detail
On the Physical Detail tab, it is possible to change the target value and options for the details.

Hint: All fields are read-only by default. Move the horizontal cursor to the left and select the Option will enable 4 options:
- 0 => Read only
- 1 => Editable as string
- 2=> By choice e.g. True or False
- 3=> Object selection filtered by template
Forward Engineering
It is possible to forward engineer from the RelationalDiagram to the physical database. This can be executed from the Tools menu in QLM.
Create DDL
From the RelationalDiagram it is possible to create DDL code that can be used to create or update a database.
DDL conversion parameters are set on the DDL Settings tab. You can right click the box to Use default.

On the Physical Details tab you can similary add the Default settings, and choose the DDL pending action (Update/Create).

When the Create DDL is activated, an ExternalDocument will be created based upon the settings and added to the list of DDL Conversions on the RelationalDiagram.

Conversion
It is possible to convert between the different models.

It is possible to convert a RelationalDiagram from the physical level to a logical DataModelDiagram from the tools menu in QLM.

Video
The DataSourceConnection can together with the DataModellingStructure be used to reverse engineering of databases, getting the database structure represented in a RelationalDiagram.





















