B.1 The SQL Code for Rosa's SystemThe 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) ); |