Exam 1z0-071 All QuestionsBrowse all questions from this exam
Question 19

Examine the description of the MEMBERS table:

Examine the partial query:

SELECT city, last_name AS lname FROM members ...;

You want to display all cities that contain the string AN. The cities must be returned in ascending order, with the last names further sorted in descending order.

Which two clauses must you add to the query? (Choose two.)

    Correct Answer: B, E

    To filter the cities that contain the string 'AN', the correct clause to add is 'WHERE city LIKE '%AN%'', which ensures that only cities with the 'AN' substring are selected. To order the results with cities first in ascending order and then last names (aliased as lname) in descending order, the correct clause is 'ORDER BY 1, lname DESC'. This orders the results primarily by city (the first column in the SELECT statement) in ascending order and secondarily by lname in descending order.

Discussion
Lee_jong_sukOptions: BE

Option BE is right!

NelitaOptions: BE

B-E IS CORRECT.

leongkaonOptions: BE

lname is in the question SELECT city, last_name AS lname FROM members

randomArrowOptions: BE

EF cannot be right. As the question asks us to first sort by cities in the ascending order. Only then further the sorting requires for lastname is descending order. F does vice versa

alic_alexOptions: BE

BE is correct

aghakhanOptions: BE

BE is ok , but i think EF is also right

dexdinh91Options: BE

BE is correct

trex_fcsOptions: BE

lname is alias and can be used on order by

leongkaonOptions: BF

lname is in the question SELECT city, last_name AS lname FROM members

apolodor1Options: EF

LNAME doesn't exist

ninjax_m

LNAME is an alias for last_name and order by accepts aliases for sorting.