Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CREATE TABLE Products ( ProductID NUMBER NOT NULL, ProductName VARCHAR2(40) NOT NULL, QuantityPerUnit VARCHAR2(20), UnitPrice NUMBER, UnitsInStock NUMBER, UnitsOnOrder NUMBER, ReorderLevel NUMBER, Discontinued NUMBER(1) NOT

CREATE TABLE Products

(

ProductID NUMBER NOT NULL,

ProductName VARCHAR2(40) NOT NULL,

QuantityPerUnit VARCHAR2(20),

UnitPrice NUMBER,

UnitsInStock NUMBER,

UnitsOnOrder NUMBER,

ReorderLevel NUMBER,

Discontinued NUMBER(1) NOT NULL,

CONSTRAINT PK_Products

PRIMARY KEY (ProductID),

CONSTRAINT CK_Products_UnitPrice CHECK ((UnitPrice >= 0)),

CONSTRAINT CK_ReorderLevel CHECK ((ReorderLevel >= 0)),

CONSTRAINT CK_UnitsInStock CHECK ((UnitsInStock >= 0)),

CONSTRAINT CK_UnitsOnOrder CHECK ((UnitsOnOrder >= 0)))

/

I have provided SQL code to create all tables and insert all data. There is an error in setting referential integrity: one of the tables is missing references. Read the code and identify the problem. You can either modify create table statement or add alter table statement to include missing references

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

=+4 Develop and deliver the CCT program.

Answered: 1 week ago