March 2001
Intermediate to advanced
640 pages
14h 9m
English
| 1: | Put the following keywords in order to make a SELECT statement work properly:
|
| A1: | Answer:
|
| 2: | What is the difference between COUNT(*) and COUNT(expression)? |
| A2: | COUNT(expression) evaluates the expression in each row. Only non-null values are counted. COUNT(*) counts every row. It does not examine any columns. |
| 3: | Is the following query permitted? If not, how would you correct it?select ProductID, ProductName from Products where UnitPrice > avg(UnitPrice) |
| A3: | The query is not permitted. An aggregate function (AVG) cannot appear in a WHERE clause unless it is part of a subquery. Here is the corrected query:select ProductID, ProductName ... |
Read now
Unlock full access