Question: Use the following Schema to provide SQL queries and relational expressions for these statements. CREATE TABLE Supplier ( SID bigsera primary key, supplier id SName
CREATE TABLE Supplier ( SID bigsera primary key, supplier id SName varchar(10) NOT NULL, supplier name Status varchar(10) NOT NULL, -supplier status (a government designation) City varchar(10) NOT NULL supplier city (where it is located) CREATE TABLE Part PID bigseria primary key, part id PName varchar(10) NOT NULL, .. part name Color char(10) NOT NULL,--part color Weight real price real NOT NULL, part weight (in lbs) NOT NULL-part price (in S) CREATE TABLE Shipment ( SID bigint FOREIGN KEY REFERENCES Supplier(SID),-supplier id PID bigint FOREIGN KEY REFERENCES Part(PID),--part id Qty nt NOT NULL, quantity shipped PRIMARY KEY (SID, PID) CREATE TABLE Customer ( CID bigserial CName varchar(10) NOT NULL, customer name Phone varchar(10) NOT NULL, customer phone number City varchar(10) NOT NULL -customer city (where it is located) primary key, customer id CREATE TABLE PartPurchase ( SID bigint FOREIGN KEY REFERENCES Supplier(SID),-supplier id PID bigint FOREIGN KEY REFERENCES Part(PID), part id CID bigint FOREIGN KEY REFERENCES Customer (CID), customer id Qty n NOT NULL, -quantity of parts purchased by customer from supplier PRIMARY KEY (SID, PID, CID)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
