Question: Construct a SQL Data Definition Language (DDL) for the following statement: a) Define the ORDERS relation which has the following constraints. (5 Marks) b) Modify

 Construct a SQL Data Definition Language (DDL) for the following statement:

Construct a SQL Data Definition Language (DDL) for the following statement: a) Define the ORDERS relation which has the following constraints. (5 Marks) b) Modify the ORDERS relation such that the attribute orderNo holds the same data type as prodNo in PRODUCT relation. (2 Marks) c) Add a new attribute named totalPrice in the ORDERS relation that reflects the total sum of money to be paid for the order. (2 Marks) d) Add a constraint to the totalPrice attribute in the ORDERS relation where the default value is set to NOT NULL. (2 Marks) e) Create a new relation named NEWORDERS that has the same structure as ORDERS. (2 Marks) f) Delete the ORDERS relation from your database. (1 Mark) g) Recover the deleted ORDERS relation to your database and rename the relation to OLDORDERS

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 Databases Questions!