Into Statement  «Prev  Next»

Using the ORDER BY clause - Quiz

Each question is worth one point. Select the best answer or answers for each question.
 

1. For this quiz, please refer to the following table, named Orders:
OrderNum ItemNum Date Qty CustID
4332 1001 12/31/97 5 0001
4321 1001 01/10/98 1 1231
4332 1002 12/31/97 1 0001
4333 1003 01/15/98 1 0002
4321 1010 01/10/98 10 1231
4334 1011 01/10/98 1 1231
4335 1231 01/15/98 1 4325
4335 1001 01/15/98 1 4325

Which statement below will return only the OrderNum and ItemNum columns from this table?
Please select the best answer.
  A. SELECT * FROM Orders WHERE COLUMN NAMES = 'OrderNum', 'ItemNum'
  B. SELECT * FROM Orders
  C. SELECT COLUMNS OrderNum, ItemNum FROM Orders
  D. SELECT OrderNum, ItemNum FROM Orders


2. Which statement below will return only those rows where customerID=0001?
Please select the best answer.
  A. SELECT CustID=0001 FROM Orders
  B. SELECT * FROM Orders WHERE CustID=0001
  C. SELECT * FROM Orders IF CustID=0001
  D. SELECT * FROM Orders ORDER BY CustID=0001

3. Which statement below will extract the OrderNum and ItemNum columns and place them into a new table, new_Orders?
Please select the best answer.
  A. SELECT OrderNum AND ItemNUm FROM Orders INTO new_Orders
  B. SELECT INTO new_Orders COLUMNS OrderNum, ItemNum FROM Orders
  C. SELECT OrderNum, ItemNum INTO new_Orders FROM Orders
  D. SELECT OrderNum, ItemNum INTO new_Orders

4. Select all rows and columns from the table, sorted by quantity. Make sure that the most significant line item, the one with the largest value, is at the top of the list, and those with smaller values come last. Which statement below will accomplish this?
Please select the best answer.
  A. SELECT * FROM Orders ORDER BY QTY
  B. SELECT * FROM Orders ORDER BY QTY DESC
  C. SELECT * FROM Orders SORT BY QTY DESC
  D. SELECT * FROM Orders DESC ORDER BY QTY