Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following schema. Write the following five queries based on your choice in QBE: Suppliers ( sid: integer, sname: string, city: string ) Parts

Consider the following schema. Write the following five queries based
on your choice in QBE:
Suppliers(sid: integer, sname: string, city: string)
Parts(pid: integer, pname: string, color: string)
Orders(sid: integer, pid: integer, quantity: integer)
1. For each supplier from whom all of the following things have been ordered in quantities of at
least 150, print the name and city of the supplier: a blue gear, a red crankshaft, and a yellow
bumper.
2. Print the names of the purple part3. Print the names and cities of suppliers who have an order for more than 150 units of a yellow
or purple part.
4. Print the pids of parts that have been ordered from a supplier named American but have also
been ordered from some supplier with a different name in a quantity that is greater than the
American order by at least 100 units.
5. Print the names of the suppliers located in Madison. Could there be any duplicates in the
answer?
6. Print all available information about suppliers that supply green parts.
7. For each order of a red part, print the quantity and the name of the part.
8. Print the names of the parts that come in both blue and green. (Assume that no two distinct
parts can have the same name and color.)
9. Print (in ascending order alphabetically) the names of parts supplied both by a Madison
supplier and by a Berkeley supplier.
10. Print the names of parts supplied by a Madison supplier, but not supplied by any Berkeley
supplier. Could there be any duplicates in the answer?
11. Print the total number of orders.
12. Print the largest quantity per order for each sid such that the minimum quantity per order for
that supplier is greater than 100.
13. Print the average quantity per order of red parts.
14. Can you write this query in QBE? If so, how? Print the sids of suppliers from whom every
part has been ordered

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_2

Step: 3

blur-text-image_3

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

Mastering Apache Cassandra 3 X An Expert Guide To Improving Database Scalability And Availability Without Compromising Performance

Authors: Aaron Ploetz ,Tejaswi Malepati ,Nishant Neeraj

3rd Edition

1789131499, 978-1789131499

More Books

Students also viewed these Databases questions

Question

d. What language(s) did they speak?

Answered: 1 week ago