Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "DROP TABLE IF EXISTS Command;"+
- "DROP TABLE IF EXISTS RecipeIngredient;"+
- "DROP TABLE IF EXISTS InventoryIngredient;"+
- "DROP TABLE IF EXISTS Ingredient;"+
- "DROP TABLE IF EXISTS Recipe;"+
- "DROP TABLE IF EXISTS Inventory;"+
- "CREATE TABLE "+database+".Inventory("+
- "iid int,"+
- "weight double,"+
- "CONSTRAINT PK_Inventory PRIMARY KEY (iid));"+
- "CREATE TABLE "+database+".Ingredient("+
- "ean varchar(13),"+
- "`name` tinytext,"+
- "CONSTRAINT PK_Ingredient PRIMARY KEY (ean));"+
- "CREATE TABLE "+database+".InventoryIngredient("+
- "iid int,"+
- "ean varchar(13),"+
- "CONSTRAINT PK_InventoryIngredient PRIMARY KEY (iid),"+
- "CONSTRAINT FK_InventoryIngredient_Inventory FOREIGN KEY (iid) REFERENCES Inventory (iid),"+
- "CONSTRAINT FK_InventoryIngredient_Ingredient FOREIGN KEY (ean) REFERENCES Ingredient (ean));"+
- "CREATE TABLE "+database+".Recipe("+
- "rid int,"+
- "nom tinytext,"+
- "CONSTRAINT PK_Recipe PRIMARY KEY (rid));"+
- "CREATE TABLE "+database+".RecipeIngredient("+
- "ean varchar(13),"+
- "rid int,"+
- "weight double,"+
- "CONSTRAINT PK_RecipeIngredient PRIMARY KEY (rid),"+
- "CONSTRAINT FK_RecipeIngredient_Ingredient FOREIGN KEY (ean) REFERENCES Ingredient (ean),"+
- "CONSTRAINT FK_RecipeIngredient_Recipe FOREIGN KEY (rid) REFERENCES Recipe (rid));"+
- "CREATE TABLE "+database+".Command("+
- "cid int,"+
- "ean varchar(13),"+
- "CONSTRAINT PK_Command PRIMARY KEY (cid),"+
- "CONSTRAINT FK_Command_Ingredient FOREIGN KEY (ean) REFERENCES Ingredient (ean));";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement