Western Governors University (WGU) ITEC2116 D426 Data Management - Foundations Practice Exam

Session length

1 / 20

Which SQL command uses the correct syntax to select the name and salary columns from the Employee table where the salary is greater than 50000, and sort the results by salary in descending order?

SELECT name, salary FROM Employee WHERE salary > 50000 ORDER + BY salary DESC;

The correct answer is the one that accurately employs the standard SQL syntax for selecting data from a table, applying a condition, and ordering the results. In this scenario, the SQL command must start with the `SELECT` statement, which specifies the columns to retrieve, in this case, `name` and `salary`.

The `FROM` clause identifies the table from which to select the data, which is `Employee`. The `WHERE` clause is essential for filtering the results based on a specific criterion — here, it is used to ensure only those rows with a salary greater than 50,000 are included. Finally, the `ORDER BY` clause is used to arrange the results in a specified order; in this instance, `DESC` indicates that the results should be sorted in descending order based on the salary.

In option A, the syntax is correctly followed with `SELECT name, salary FROM Employee WHERE salary > 50000 ORDER BY salary DESC;`, meaning the command will successfully return the desired output.

Selecting a command that does not adhere to this structure would impede understanding or execution. For example, using incorrect keywords or commands, as seen in the other options, would lead to syntax errors or undesired outputs. The correct arrangement and choice

SELECT Employee.name, Employee.salary WHERE Employee.salary > 50000 SORT BY Employee.salary DESC;

SELECT name, salary FROM Employee SORT BY salary DESC WHERE salary > 50000;

SELECT name, salary FROM Employee WHERE salary > 50000 SORT BY salary ASC;

Next Question

Find the option that is right for you!

All options are one-time payments.

$25.99

30 day premium pass

All the basics to get you started

  • Ad-free experience
  • View your previous attempt history
  • Mobile app access
  • In-depth explanations
  • 30 day premium pass access
👑$59.99 $171.99 usd

6 month DELUXE pass (most popular)

Everything with the 30 day premium pass FOR 6 MONTHS! & the ultimate digital PDF study guide (BONUS)

  • Everything included in the premium pass
  • $171.99 usd value for $59.99! You save $106!
  • + Access to the ultimate digital PDF study guide
  • + 6 months of premium pass access
  • + Priority support
$15.99 $24.99

Ultimate digital PDF study guide

For those that prefer a more traditional form of learning

  • Available for instant download
  • Available offline
  • Hundreds of practice multiple choice questions
  • Comprehensive content
  • Detailed explanations
Image Description
Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy