Share
Explore BrainMass

SQL Commands

I'm not grasping the full concept of these problems, I've completed most successfully. I've tried to get them, but I am have a hard time reworking these.

(This is the table referenced for the following questions)

INVENTORY (SKU, Description, QuantityOnHand, QuantityOnOrder, Warehouse)

1. Write a SQL statement to display the SKU and Description of all items stored in the Seattle, Chicago or New Jersey warhouse. Do not use IN.

2. Write a SQL statement to show SKU and Description for all products having a description starting with 'Half-Dome'.

3. Write a SQL expression to display the Warehouse and a count of QuantityOnHand, grouped by Warehouse. Name the count TotalItemsOnHand.

4. Write a SQL expression to display the Warehouse and a count of QuantityOnHand, grouped by Warehouse. Omit all items that have a count greater than 2. Name the count TotalItemsOnHand and display the reslults in descending order of TotalItemsOnHand.

The following table is for the next set of questions.

INVENTORY (SKU, Description, QuantityOnHand, QuantityOnOrder, Warehouse)

WAREHOUSE (Warehouse, Manager, SquareFeet)

5. Write a SQL statement to show the SKU ande Description of all items stored in a warehouse managed by 'Smith'. Use a subquery.

6. Write a SQL statement to show the Warehouse and average QuantityOnHand of all items stored in a warehouse managed by 'Smith'. Use subquery.

7. Write a SQL statement to show Warehouse, Manager, and QuantityOnHand of all items stored in a warehouse managed by 'Smith'. Use a join.

Solution Summary

This solution basically solves the SQL queries based on the Inventory table. It gives the SQL DML queries in order to solve the questions.

$2.19