PrepAway - Latest Free Exam Questions & Answers

Which of the following queries will return SALES information, sorted by SALES_PERSON, from A to Z, and SALES_D

Given the following table definition:
SALES

————————————–
INVOICE_NO CHAR(20) NOT NULL
SALES_DATE DATE
SALES_PERSON VARCHAR(25)
REGION CHAR(20)
SALES_AMT DECIMAL(9,2)
Which of the following queries will return SALES information, sorted by SALES_PERSON, from A
to Z, and SALES_DATE, from most recent to earliest?

PrepAway - Latest Free Exam Questions & Answers

A.
SELECTinvoice_no, sales_person, sales_date, sales_amt FROM sales SORT BY
sales_person, sales_date DESC

B.
SELECTinvoice_no, sales_person, sales_date, sales_amt FROM sales SORT BY
sales_person DESC, sales_date

C.
SELECTinvoice_no, sales_person, sales_date, sales_amt FROM sales ORDER BY
sales_person, sales_date DESC

D.
SELECTinvoice_no, sales_person, sales_date, sales_amt FROM sales ORDER BY
sales_person DESC, sales_date

One Comment on “Which of the following queries will return SALES information, sorted by SALES_PERSON, from A to Z, and SALES_D

  1. Ramchandra Shivaji Cheke says:

    Correct answer should be C.
    SELECTinvoice_no, sales_person, sales_date, sales_amt FROM sales ORDER BY
    sales_person, sales_date DESC

    As asked SALES_PERSON, from A to Z, it means ascending order, so no such suffix as data by default in ascending order
    and SALES_DATE, from most recent to earliest, it means Descending order, therefore suffix as DESC




    0



    0

Leave a Reply