/*
 * Raima Database Manager
 *
 * Copyright (c) 2012 Raima Inc.,  All rights reserved.
 *
 * EXAMPLE - perf07
 *
 * This is the DDL (SQL Database Definition Language) for a simple Bill of 
 * Materials database.  This version uses set relationships instead of 
 * indexing.
 */

database perf07_db {
    data file "perf07.d01" contains item;
    data file "perf07.d02" contains bill;
    key file  "perf07.k01" contains id_code;

    record item {
        unique key char id_code[16];
        char   description[58];
        double cost;
    }
    record bill {
        double  quantity;
        int32_t level;
    }

    set bom {
        order last;
        owner item;
        member bill;
    }
    set where_used {
        order last;
        owner item;
        member bill;
    }
}
