What is the reason for the error?

View the Exhibit and examine the structure of the products table.

Using the products table, you issue the following query to generate the names, current list price,
and discounted list price for all those products whose list price falls below $10 after a discount of
25% is applied on it.

The query generates an error. What is the reason for the error?

View the Exhibit and examine the structure of the products table.

Using the products table, you issue the following query to generate the names, current list price,
and discounted list price for all those products whose list price falls below $10 after a discount of
25% is applied on it.

The query generates an error. What is the reason for the error?

A.
The parenthesis should be added to enclose the entire expression.

B.
The double quotation marks should be removed from the column alias.

C.
The column alias should be replaced with the expression in the where clause.

D.
The column alias should be put in uppercase and enclosed within double quotation marks in the
where clause.

Explanation:



Leave a Reply 3

Your email address will not be published. Required fields are marked *


Azad

Azad

Answer is C and reason is :
“An alias can be used in a query select list to give a column a different name. You can use the alias in GROUP BY, ORDER BY, or HAVING clauses to refer to the column.

Standard SQL disallows references to column aliases in a WHERE clause. This restriction is imposed because when the WHERE clause is evaluated, the column value may not yet have been determined.”

Aniha

Aniha

I got this question in the exam today(11/16/2017)