MCQ Single Best Answer Easy

QYou must fetch data from CustTable in ascending order based on City. CustTable contains a field named City. There is a non-unique cluster index named cityIdx on the City field. What are three possible statements that achieve the goal?

ID: #9398 Module 14: Database Manipulation 140 views
Question Info
#9398Q ID
EasyDifficulty
Module 14: Database ManipulationTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Select custTable index cityIdx;
  • B Select custTable order by city;
  • C Select custTable order by city ASC;
  • D All
Correct Answer: Option D

Explanation

Justification:

  1. This statement will select all records from the CustTable organized by the index titled cityIdx, which is configured on the custTable.
  2. This statement selects all records from the custTable and specifies the “city” field in the table to order by. The default direction order by is ascending order.
  3. This statement selects all records in the CustTable and specifies to order by the city field in ascending order. This is the same as the default order. The order by clause will default to ascending order if none is specified as well.
  4. This statement will not work because the index name is not city, but cityIdx.

Related Lesson: Data Retrieval

Share This Question

Challenge a friend or share with your study group.