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.
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 PKStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started