Question: home / study / engineering / computer science / computer science questions and answers / write the sql ddl to create the following 5 tables
home / study / engineering / computer science / computer science questions and answers / write the sql ddl to create the following 5 tables describing cooking: recipe, ingredient, ...
Question: Write the SQL DDL to create the following 5 tables describing cooking: recipe, ingredient, author...
Write the SQL DDL to create the following 5 tables describing cooking: recipe, ingredient, author, cook, requires:
1. An Author table where each author is identified by an integer id and has a name (up to 30 characters).
2. An Ingredient table where each ingredient has an id of exactly 5 characters and a name (up to 30 characters).
3. A Recipe table where each recipe is identified by a field called id that is an integer. Other attributes include name (string up to 40 characters), author id (integer), and directions (string up to 255 characters). Make all foreign keys set to null on delete and no action (generate error) on update.
4. A Cook table where each time a recipe is made it is identified by a date/time (DATETIME). The table also has a recipe id and a comment (string up to 255 characters). Make all foreign keys set to perform cascade on delete and cascade on update.
5. A Requires table that stores what ingredients are needed in a recipe. This table has a recipe id, ingredient id, and amount (floating point number). Make all foreign keys set to cascade on both update and delete.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
