core07.sdl

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

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

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

#include "core07_structs.h"
#include "core07_cat.h"

and compile the following generated source file(s):

core07_cat.c

Here follows the actual schema:

/*
* EXAMPLE - Core07 for C
*
* This is the DDL (Database Definition Language) for a database implementing
* a many-to-many relationship using network model sets. The database shows
* how to implement a course registration list with Students that attend
* multiple Classes and Classes that are attended by multiple Students.
*
* The student record has a single Name field
* The course record has an ID and Title field
* There is an intersection (registrations) record that does not contain any
* user fields
*/
create table class (
id char(10) primary key,
title char(40) not null
);
create table student (
name char(40) primary key
);
create table enrollment (
begin_date date,
end_date date,
status char(9),
current_grade integer,
class_students char(40) references class,
student_classes char(40) references student
);