Question: following SQL statements, some tables are created with different constraints. Give two foreign key constraints and specify in which table each is given? CREATE
following SQL statements, some tables are created with different constraints. Give two foreign key constraints and specify in which table each is given? CREATE TABLE Customer T (Customer D CustomerName Customer Address CustomerCity CustomerState NUMBER(11,0) VARCHAR2(25) CustomerPostalCode CONSTRAINT Customer_PK PRIMARY KEY (CustomerID)); CREATE TABLE Product T (ProductID Product Description ProductFinish Product Standard Price VARCHAR2(30), VARCHAR2(20), CHAR(2), VARCHAR2(9), CREATE TABLE Order T (OrderID OrderDate Customer D CONSTRAINT Order_PK PRIMARY KEY (OrderID), CONSTRAINT Order FK FOREIGN KEY (CustomerID) REFERENCES Customer T (CustomerID)); CREATE TABLE OrderLine T (OrderID ProductID NOT NULL, NOT NULL, NUMBER(11,0) DATE DEFAULT SYSDATE, NUMBER(11,0), NUMBER(11,0) VARCHAR2(50), VARCHAR2(20), DECIMAL (6,2), NUMBER(11,0), ProductLineID CONSTRAINT Product PK PRIMARY KEY (ProductID)); NOT NULL, NOT NULL, NUMBER(11,0) NUMBER(11,0) OrderedQuantity NUMBER(11,0), CONSTRAINT OrderLine PK PRIMARY KEY (OrderID, ProductID), CONSTRAINT OrderLine_FK1 FOREIGN KEY (OrderID) REFERENCES Order_T (OrderID), CONSTRAINT OrderLine FK2 FOREIGN KEY (ProductID) REFERENCES Product_T (ProductID)); NOT NULL, NOT NULL,
Step by Step Solution
3.53 Rating (160 Votes )
There are 3 Steps involved in it
Query to add artistid foreign key constraint ... View full answer
Get step-by-step solutions from verified subject matter experts
