一、原题
View the Exhibit and examine the structure of the CUSTOMERS table.
You have been asked to produce a report on the CUSTOMERS table showing the customers details sorted in descending order of the city and in the descending order of their income level in each city.
Which query would accomplish this task?
A. SELECT cust_city, cust_income_level, cust_last_name
FROM customers
ORDER BY cust_city desc, cust_income_level DESC ;
B. SELECT cust_city, cust_income_level, cust_last_name
FROM customers
ORDER BY cust_income_level desc, cust_city DESC;
C. SELECT cust_city, cust_income_level, cust_last_name
FROM customers
ORDER BY (cust_city, cust_income_level) DESC;
D. SELECT cust_city, cust_income_level, cust_last_name
FROM customers
ORDER BY cust_city, cust_income_level DESC;
答案:A
二、题目翻译You have been asked to produce a report on the CUSTOMERS table showing the customers details sorted in descending order of the city and in the descending order of their income level in each city.
Which query would accomplish this task?
A. SELECT cust_city, cust_income_level, cust_last_name
FROM customers
ORDER BY cust_city desc, cust_income_level DESC ;
B. SELECT cust_city, cust_income_level, cust_last_name
FROM customers
ORDER BY cust_income_level desc, cust_city DESC;
C. SELECT cust_city, cust_income_level, cust_last_name
FROM customers
ORDER BY (cust_city, cust_income_level) DESC;
D. SELECT cust_city, cust_income_level, cust_last_name
FROM customers
ORDER BY cust_city, cust_income_level DESC;
答案:A
查看 CUSTOMERS表的结构
要根据CUSTOMERS表生成一个报表,显示员工信息,按city降序排列,并且每个city中员工的income level也降序排列显示。
哪一个查询能完成这个任务?
三、题目解析要根据CUSTOMERS表生成一个报表,显示员工信息,按city降序排列,并且每个city中员工的income level也降序排列显示。
哪一个查询能完成这个任务?
B选项不正确,顺序错误,不是按city降序,再按income level降序排列。
C选项不正确,语法错误
D选项不正确,不是按city的降序排列,不写desc,默认是ASC升序排列。
C选项不正确,语法错误
D选项不正确,不是按city的降序排列,不写desc,默认是ASC升序排列。