Question: For the following assignment use the GuitarShop database 1 . Write a SELECT statement that returns four columns from the Products table: * ProductCode *

For the following assignment use the GuitarShop database
1. Write a SELECT statement that returns four columns from the Products table:* ProductCode* ProductName* ListPrice* DiscountPercent.Then, run this statement to make sure it works correctly.Add an ORDER BY clause to this statement that sorts the result set by list price in descending sequence. Then, run this statement again to make sure it works correctly. This is a good way to build and test a statement, one clause at a time.
2. Write a SELECT statement that returns one column from the Customers table named FullName that joins the LastName and FirstName columns. Format this column with the last name, a comma, a space, and the first name like this:Doe, JohnSort the result set by last name in ascending sequence. Return only the contacts whose last name begins with a letter from M to Z.
3. Write a SELECT statement that returns these column names and data from the Products table:* ProductName The ProductName column* ListPrice The ListPrice column* DateAdded The DateAdded columnReturn only the rows with a list price thats greater than 500 and less than 2000.Sort the result set in descending sequence by the DateAdded column.
4. Write a SELECT statement that returns these column names and data from the Products table:* ProductName The ProductName column* ListPrice The ListPrice column* DiscountPercent The DiscountPercent column* DiscountAmount A column thats calculated from the previous two columns* DiscountPrice A column thats calculated from the previous three columnsSort the result set by discount price in descending sequence.
5. Write a SELECT statement that returns these column names and data from the OrderItems table:* ItemID The ItemID column* ItemPrice The ItemPrice column* DiscountAmount The DiscountAmount column* Quantity The Quantity column* PriceTotal A column thats calculated by multiplying the item price by the quantity* DiscountTotal A column thats calculated by multiplying the discount amount by the quantity* ItemTotal A column thats calculated by subtracting the discount amount from the item price and then multiplying by the quantityOnly return rows where the ItemTotal is greater than 500.Sort the result set by item total in descending sequence.
6. Write a SELECT statement that returns these columns from the Orders table:* OrderID The OrderID column* OrderDate The OrderDate column* ShipDate The ShipDate columnReturn only the rows where the ShipDate column contains a null value.
7. Write a SELECT statement without a FROM clause that creates a row with these columns:* Price 100(dollars)* TaxRate .07(7 percent)* TaxAmount The price multiplied by the tax rate* Total The price plus taxTo calculate the fourth column, add the expressions you used for the first and third columns.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!