Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using the following Schema provide SQL queries and relational expressions for these statements. For the one who asked what NY and SF are, they are
Using the following Schema provide SQL queries and relational expressions for these statements.
For the one who asked what NY and SF are, they are cities.
CREATE TABLE Supplier ( SID bigserial 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) primary key, supplier id CREATE TABLE Part PID bigserial PName varchar(10) NOT NULL, part name Color char 10 NOT NULL, -part color Weight real price real primary key, part id NOT NULL, part weight n bs) NOT NULL-part price (in $) CREATE TABLE Shipment SID bigint FOREIGN KEY REFERENCES Supplier(SID),-, supplier id PID bigint FOREIGN KEY REFERENCES Part(PID),-part id Qty int NOT NULL, quantity shipped PRIMARY KEY (SID, PID) CREATE TABLE Customer CID bigseria primary key, -customer id 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) 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 int NOT NULL, - quantity of parts purchased by customer from supplier PRIMARY KEY (SID, PID, CIDStep 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