Question: Write SQLs to create three tables based on given relational schemas and directions below. Based in Oracle DBMS, follow standard syntax. In addition of the

Write SQLs to create three tables based on given relational schemas and directions below. Based in Oracle DBMS, follow standard syntax.

Write SQLs to create three tables based on given relational schemas and

In addition of the relational schema above, include the following specifications in the table creation. i. The OrderDate column of ORDERS table has a default value as a current system date, SYSDATE. ii. The value of OrderQuantity of ORDERINE table should be greater than 0. iii. The value of ProductType of PRODUCT table should be a value in this list {Books,Electronics, Home, Clothing} iv. When an order record in ORDERS table is deleted, all ORDERINE records associated with the OrderID of the deleted record are also deleted. v. When a CUSTOMER record is deleted, its associated ORDERS records CustomerID is changed to NULL.

ORDERS ORDERLINE PK OrderlD number(11) PK | | FK OrderID number(11) | FK | [F] ProductiD number(11) CustomerID number(11) OrderDate date OrderQuantity number(11) CUSTEROMER CustomerlD number(11) CustomerName varchar2125) CustomerAddr varchar2(30) PRODUCT ProductID number(11) ProductType varchar2130 PK

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!