ads
Monday, February 23, 2015
#12. Write a SELECT statement that returns these column names and data from the OrderItems table
#2. 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 that’s calculated by multiplying the item price with the quantity
DiscountTotal A column that’s calculated by multiplying the discount amount with the quantity
ItemTotal A column that’s calculated by subtracting the discount amount from the item price and then multiplying by the quantity
Only return rows where the ItemTotal is greater than 500.
Sort the result set by item total in descending sequence.
ItemID The ItemID column
ItemPrice The ItemPrice column
DiscountAmount The DiscountAmount column
Quantity The Quantity column
PriceTotal A column that’s calculated by multiplying the item price with the quantity
DiscountTotal A column that’s calculated by multiplying the discount amount with the quantity
ItemTotal A column that’s calculated by subtracting the discount amount from the item price and then multiplying by the quantity
Only return rows where the ItemTotal is greater than 500.
Sort the result set by item total in descending sequence.
#11. Write a SELECT statement that returns one column from the Customers table named FullName that joins the LastName and FirstName columns.
#11. 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, John
Sort the result set by last name in ascending sequence.
Return only the contacts whose last name begins with letters from M to Z.
Format this column with the last name, a comma, a space, and the first name like this:
Doe, John
Sort the result set by last name in ascending sequence.
Return only the contacts whose last name begins with letters from M to Z.
Sunday, December 14, 2014
#10. Write a SELECT statement that returns these colums from the Orders table: A column that uses the CONVERT function to return the OrderDate
#10. Write a SELECT statement that returns these colums from the Orders table:
A column that uses the CONVERT function to return the OrderDate column in this format: MM/DD/YYYY. In other words, use two-digit months, days, and years and separate each date component with slashes
A column that uses the CONVERT function to return the OrderDate column with the date, and the hours and minutes on a 12-hour clock with an am/pm indicator
A column that uses the CONVERT function to return the OrderDate column with 2-digit hours, minutes, and seconds on a 24-hour clock. Use leading zeros for all date/time components.
#8. Write a SELECT statement that returns one row for each customer that has orders with these columns: The EmailAddress column from the Customers table
#8. Write a SELECT statement that returns one row for each customer that has orders with these columns:
The EmailAddress column from the Customers table
A count of the number of orders
The total amount for each order (Hint: First, subtract the discount amount from the price. Then, multiply by the quantity.)
Return only those rows where the customer has more than than 1 order.
Sort the result set in descending sequence by the sum of the line item amounts.
Sort the result set in descending sequence by the sum of the line item amounts.
#7. Write a SELECT statement that returns one row for each category that has products with these columns:
#7. Write a SELECT statement that returns one row for each category that has products with these columns:
The CategoryName column from the Categories table
The count of the products in the Products table
The list price of the most expensive product in the Products table
Sort the result set so the category with the most products appears first.
Subscribe to:
Posts (Atom)






