core06.sdl

Schema for the core06Example_main.c example. Compile this schema using rdm-compile as follows:

rdm-compile --c-structs --lc-struct-members --catalog core06.sdl

and include the generated header file(s) as follows:

#include "core06_structs.h"
#include "core06_cat.h"

and compile the following generated source file(s):

core06_cat.c

Here follows the actual schema:

/*
* EXAMPLE - Core04 for C
*
* This is the DDL (Database Definition Language) for a database implementing
* two one-to-many relationship using network 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.
* The artist name and album title will be index so they can be retrieved in
* sorted order. The index will also allow an application to preform an
* efficient search on those fields.
*/
create table artist
(
artistid rowid primary key,
name char(100) key not null
);
create table album
(
albumid rowid primary key,
artistid rowid references artist(artistid),
title char(100) key not null
);
create table track
(
albumid rowid references album(albumid),
title char(100) not null
);