Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

image text in transcribed

image text in transcribed

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, CID

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

Database Design Application Development And Administration

Authors: Michael V. Mannino

3rd Edition

0071107010, 978-0071107013

More Books

Students also viewed these Databases questions