CSci 241.AL: Database Management Systems
Department of Computer Science
The George Washington University, Fall 2010
- How many different kinds of parts are there. Disregard color differences.
- How many colors is each kind of part available in? List part name and count.
- How many suppliers have names starting with 'A'?
- What are the names and costs of the most expensive and cheapest items in the catalog? List all items that match the criteria, disregarding color differences. Do this with one query. Bonus: format the costs with a '$' and commas every three digits (starting from the decimal).
The Main Event
- Find the names of parts for which there is some supplier.
- Find the names of suppliers who supply every part.
- Find the names of suppliers who supply every red part.
- Find the names of parts supplied by Acme Widget Suppliers and no one else.
- Find the sids of suppliers who charge more for some part then the average cost of that part (average over all suppliers who supply that part).
- For each part, find the name of the supplier who charges the most for that part.
- Find the sids of suppliers who do not sell any non-red parts.
- Find the sids of suppliers who sell a red part and a green part.
- Find the sids of suppliers who sell a red part or a green part.
- For every supplier that only supplies green parts, print the name of the supplier and the total number of parts that she supplies.
- For every supplier that supplies a green part and a red part, print the name and price of the most expensive part that she supplies.
Modified: Tue Oct 5 22:06:46 EDT 2010