Products Support Documentation Download
Database Schema
Database Schema Definition

The DDL (Database Definition Language) specification for the database used in this example is located in the file core04_db.sdl.

/*
* EXAMPLE - Core04 for C
*
* This is the DDL (Database Definition Language) for a database implementing
* two one-to-many relationship using reference model sets. The database will
* implement the beginnings of an mp3 collection. The one (owner) side
* of the relationship is an artist records. The many (member) side of the
* relationship is the album record. There will be a second set where the one
* side is the album record and the many side is a track record.
*/
create table artist
(
artistid rowid primary key,
name char(100) not null
);
create table album
(
albumid rowid primary key,
artistid rowid not null references artist(artistid),
title char(100) not null
);
create table track
(
albumid rowid not null references album(albumid),
title char(100) not null
);

The schema was compiled using the RDM rdm-compile utility with the -s option to generate C-structures for interfacing with the database.

rdm-compile -s core04_db.sdl