Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following schema: SUPPLIERS (SID: integer, SNAME: string, STREET: string, CITY: string, ZIP: string PARTS (PID:Integer, PNAME: string. COLOR: string) CATALOG (SID:integer. PID: integer.

image text in transcribed
image text in transcribed
Consider the following schema: SUPPLIERS (SID: integer, SNAME: string, STREET: string, CITY: string, ZIP: string PARTS (PID:Integer, PNAME: string. COLOR: string) CATALOG (SID:integer. PID: integer. COST: real) The primary key attributes are underlined, and the domain of each attribute is listed after the attribute name. Thus, SID is the primary key for SUPPLIERS, PID is the primary key for PARTS, and SID and PID together form the primary key for CATALOG. Attribute SID in CATALOG is a foreign key that refers to the primary key SID of SUPPLIERS and PID in CATALOG is a foreign key that refers to the primary key PID of PARTS, The CATALOG relation lists the prices charged for parts by suppliers. State what the following query computes. 0. rTY (TPID (0(OOR-prm. (PARTS) ) * cosm50 (CATALOG) * 1D, CITY (SUPPLIERS) ) Write the following queries in relational algebra. . Find the names of parts for which there is some supplier 2. Find the names of parts supplied by suppliers who are at 1 Central Ave. 3. Find the names of suppliers who supply some red part. . Find the SIDs of suppliers who supply some red or green part. 5. Find the SID of suppliers who supply some red part or whose address is '221 Packer Street 6. Find the SIDs of suppliers who supply some red part and some green part. 7. Find the PIDs of parts that are red or are supplied by a supplier who is at the city of Newark 8. Find the PIDs of parts supplied by a supplier who is at the city of Newark and by a supplier who is at the city of Trenton. 9. Find the 10. Find the PIDs of parts supplied by every supplier who supplies at least one part. 11. Find the SIDs of suppliers who supply at least two different parts (you are not allowed to usea PIDs of parts supplied by every supplier. grouping/aggregation operation for this query). 12. Find the SIDs of suppliers who supply at least two different parts (you have to use a grouping/aggregation operation for this query). 13. For every part, find its PID, its PNAME and the number of suppliers who sell it. 14. List the PID, PNAME and average cost of all parts. 15. Find the average cost of red parts 16. Find the average cost of parts supplied by suppliers named Yosemite Sham

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

The Power Of Numbers In Health Care A Students Journey In Data Analysis

Authors: Kaiden

1st Edition

8119747887, 978-8119747887

More Books

Students also viewed these Databases questions