QuestionQ56

VerifiedRestricting and Sorting Data

Refer to the exhibit and review the structure of the products table.

Question Image

Using the products table, you execute the following query to produce the product names, current list prices, and discounted list prices for products whose list price is less than $10 after a 25% discount is applied.

Question Image

The query returns an error. What causes the error?

Explanation

A column alias assigned in a SELECT list cannot be referenced by the WHERE clause of the same query block. The WHERE predicate must use the full discounted-price expression, or the alias must be referenced from an outer query.

Community Discussion

No comments yet. Be the first to start the discussion!