The Suppliers relation describes suppliers of parts. The

The Suppliers relation describes suppliers of parts. The Parts relation contains information about each part. The Catalog relation lists the prices in dollars charged for parts by suppliers. (The keys are underlined: sid is a key for Suppliers, (sid,pid) is a key for Catalog, and pid is a key for Parts.)

Write the following queries. For each query, it is stated in which query language you should express the query.

Find the sids of suppliers who supply all blue parts. Write this query in relational algebra without using the division operator. (4 points)

Find the names of the most expensive parts supplied by suppliers named `Santa Claus’. Write this query in relational algebra; you can use any relational algebra operator.

For each supplier that supplies at least two different parts, print its name and the cost of the least expensive part that the supplier carries. Write this query in SQL.

Find the names of suppliers who supply exactly three parts. Write this query in SQL without using aggregates or “group by” key words.

 

Find the names and pids of parts that are supplied by every supplier at a price of strictly less than 200 dollars. (If a supplier does not supply the part or if a supplier charges more than 200 dollars for it, the part should not be output.) Write this query in SQL;

Find the name of the part(s) with the second highest price. Write this query in SQL without using the LIMIT or OFFSET keyword.

Can you pose a query such that the information in the database is sufficient to answer the query (e.g., you can use the contents of the Suppliers, Parts, and Catalog relation to somehow compute the answer to the query), but you cannot express the query in SQL? 

 

Leave a Comment

Your email address will not be published. Required fields are marked *

GradeEssays.com
We are GradeEssays.com, the best college essay writing service. We offer educational and research assistance to assist our customers in managing their academic work. At GradeEssays.com, we promise quality and 100% original essays written from scratch.
Contact Us

Enjoy 24/7 customer support for any queries or concerns you have.

Phone: +1 213 3772458

Email: support@gradeessays.com

© 2024 - GradeEssays.com. All rights reserved.

WE HAVE A GIFT FOR YOU!

15% OFF 🎁

Get 15% OFF on your order with us

Scroll to Top