Question: use the following code to create your own query that uses two FROM clauses : Create table USERS ( UserID int not null auto _

use the following code to create your own query that uses two FROM clauses :
Create table USERS(
UserID int not null auto_increment,
FirstName varchar(255) not null,
LastName varchar(255) not null,
SignIn date default (curdate()),
Primary Key(UserID)
);
Create table RECIPE(
RecipeID int not null auto_increment,
UserID int not null,
Name varchar(255) not null,
Published date default (curdate()),
Primary Key(RecipeID),
Foreign Key(UserID) references USERS(UserID) on delete cascade
);
Create table RECIPE_STEPS(
RecipeID int not null,
Step int not null,
StepDescription varchar(255) not null,
Primary Key(RecipeID, Step),
Foreign Key (RecipeID) references RECIPE(RecipeID) on delete cascade,
check(Step >=1),
check(char_length(StepDescription)>=10)
);
Create table RECIPE_SAVED(
UserID int not null,
RecipeID int not null,
Primary Key(UserID, RecipeID),
Foreign Key (RecipeID) references RECIPE(RecipeID) on delete cascade,
Foreign Key (UserID) references USERS(UserID) on delete cascade
);
Create table USER_FOLLOW(
UserID int not null,
FollowID int not null,
Primary Key(UserID, FollowID),
Foreign Key(UserID) references USERS(UserID) on delete cascade,
Foreign Key(FollowID) references USERS(UserID) on delete cascade
);
Create table INGREDIENTS(
RecipeID int not null,
IngredientName varchar(255) not null,
Price decimal(10,2) not null default 0.00 check(Price >=0.00),
Primary Key(RecipeID, IngredientName),
Foreign Key (RecipeID) references RECIPE(RecipeID) on delete cascade
);
Create table USER_RATING(
UserID int not null,
RecipeID int not null,
Rating int default 0 check(Rating >=0),
Primary Key(UserID, RecipeID),
Foreign Key(UserID) REFERENCES USERS(UserID ) on delete cascade,
Foreign Key(RecipeID) REFERENCES RECIPE(RecipeID) on delete cascade
);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!