Into Statement  «Prev  Next»

Using the SQL 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. All four questions reference this table.
OrderNumItemNumDateQtyCustID
4332100112/31/9750001
4321100101/10/9811231
4332100212/31/9710001
4333100301/15/9810002
4321101001/10/98101231
4334101101/10/9811231
4335123101/15/9814325
4335100101/15/9814325
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. Using the Orders table above, which statement will return only those rows where CustID = 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. Using the Orders table above, which statement will extract the OrderNum and ItemNum columns and place them into a new table named 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. Using the Orders table above, select all rows and columns sorted by Qty so that the largest value appears first and smaller values come last. Which statement 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