Introduction
DDL ("Data Definition Language") is a set of statements the user executes in order to create a new database. In RDM 14.2, standard SQL DDL statements are used for these purposes.
RDM 14.2 provides two methods to create a database.
The first method is to save the DDL statements in a file (called "schema definition file") and compile it using the rdm-compile or rdm-create tool. rdm-compile generates files that can be embedded into an application. rdm-create creates a database that can be accessed directly by an application.
The second method is to execute DDL statements on the fly through SQL. RDM 14.2 provides a command-line interactive tool named rdm-sql. The user can type in DDL statements directly at the rdm-sql command prompt, or feed a file that contains DDL statements into the tool.
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 in the following "Defining a Database" section.