Introduction

DDL ("Data Definition Language") is a set of statements used to define the data structures and relationships for a database. RDM implements the standard SQL DDL statements with extensions, as necessary, for these purposes. The following sections describe the DDL schema implementation for RDM.

The schema language will be used by the developer in one of the following ways:

  1. The schema can be compiled by the rdm-compile utility to generate C or C++ source and header files which define the database in structures that can be used programmatically in the developer's application. This would be a typical use case.
  2. The schema can be used to create the database directly using rdm-create. This method may be used by applications that only have remote SQL CLI access to the database, like: ODBC applications or Java (JDBC) applications.
  3. The DDL schema instructions can be embedded directly into an RDM application which uses the SQL CLI exclusively. A typical use case may be using the RDM interactive scripting tool (rdm-sql) for database modeling during application development.

Here is an example of a simple schema definition file:

CREATE TABLE maker
(
    maker_id INTEGER PRIMARY KEY,
    maker_name CHAR (20)
);

CREATE TABLE product
(
    product_id CHAR (5) PRIMARY KEY,
    product_name CHAR (50),
    maker_id INTEGER REFERENCES maker (maker_id)
);

Learn more about creating a database schema in the following "Defining a Schema" section.