B.1 The SQL Code for Rosa s System

B.1 The SQL Code for Rosa's System

The following code snippet is the SQL script to create the tables for Rosa's Breakfast Service:

 CREATE TABLE Comestible (     comestibleID                   INTEGER                       NOT NULL,     name                           VARCHAR (40)                  NULL,     price                          REAL                          NULL,     minimalQuantity                INTEGER                       NULL,     transportForm                  VARCHAR (40)                  NULL,     PRIMARY KEY (comestibleID) ); CREATE TABLE StandardBreakfast (     standardBreakfastID            INTEGER                       NOT NULL,     name                           VARCHAR (40)                  NULL,     price                          REAL                          NULL,     style                          INTEGER                       NULL,     PRIMARY KEY (tabelID) ); CREATE TABLE Part (     standardBreakfastID            INTEGER                       NOT NULL,     comestibleID                   INTEGER                       NOT NULL,     quantity                       INTEGER                       NULL,     PRIMARY KEY (standardBreakfastID, comestibleID) ); CREATE TABLE Customer (     customerID                     INTEGER                       NOT NULL,     accountNumber                  DECIMAL                       NULL,     addressStreet                  VARCHAR (40)                  NULL,     addressCity                    VARCHAR (40)                  NULL,     addressStreetNumber            VARCHAR (40)                  NULL,     addressPostalCode              VARCHAR (40)                  NULL,     addressTelephoneNumber         VARCHAR (40)                  NULL,     PRIMARY KEY (customerID) ); CREATE TABLE BreakfastOrder (     breakfastOrderID               INTEGER                       NOT NULL,     customerId                     INTEGER                       NOT NULL,     orderDate                      DATE                          NULL,     deliveryAddressStreet          VARCHAR (40)                  NULL,     deliveryAddressCity            VARCHAR (40)                  NULL,     deliveryAddressStreetNumber    VARCHAR (40)                  NULL,     deliveryAddressPostalCode      VARCHAR (40)                  NULL,     deliveryAddressTelephoneNumber VARCHAR (40)                  NULL,     deliveryDate                   DATE                          NULL,     deliveryTime                   TIME                          NULL,     discount                       REAL                          NULL,     PRIMARY KEY (breakfastOrderID) ); CREATE TABLE Breakfast (     breakfastID                    INTEGER                       NOT NULL,     breakfastOrderID               INTEGER                       NOT NULL,     standardBreakfastID            INTEGER                       NOT NULL,     number                         INTEGER                       NULL,     PRIMARY KEY (breakfastID) ); CREATE TABLE Change (     breakfastID                    INTEGER                       NOT NULL,     comestibleID                   INTEGER                       NOT NULL,     quantity                       INTEGER                       NULL,     PRIMARY KEY (breakfastId, comestibleID) ); 


MDA Explained. The Model Driven Architecture(c) Practice and Promise 2003
Project Leadership (The Project Management Essential Library)
ISBN: N/A
EAN: 2147483647
Year: 2004
Pages: 118

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net