Term
How must you modify this query to sort customers by City? SELECT CustName, City, State FROM Customer ORDER BY CustID
A. Add a WHERE clause to the query
B. Specify either ASC or DESC in the SELECT clause after city.
C. List City first in the SELECT list.
D. Add an ORDER BY clause. |
|
Definition
D. Add an ORDER BY clause. |
|
|
Term
The AnnualBonus table includes the following columns: -EmpID -Year -Amount EmpID and Year are character type conlums. You want to run a query that returns EmpID and the bonus amount for the year 2001. The largest bonuses should be listed first. Which query should you use?
A. SELECT EmpID, Amount FROM AnnualBonus WHERE Year='2001'
B. SELECT Amount, EmpID FROM Annual Bonus WHERE Year='2001'
C. SELECT EmpID, Amount FROM AnnualBonus WHERE Year='2001' ORDER BY AnnualBonus DESC
D. SELECT EmpID, Amount FROM AnnualBonus WHERE Year='2001' ORDER BY AnnualBonus ASC |
|
Definition
C. SELECT EmpID, Amount FROM AnnualBonus WHERE Year='2001' ORDER BY AnnualBonus DESC |
|
|
Term
Unless otherwise specified, columns listed in an ORDER BY clause sort in ascending order.
A. True
B. False |
|
Definition
|
|
Term
The CurrentContact table contains the following data: ID ConID TakenBy 1 1334 FM22 2 2343 JS10 3 1001 MS01 4 1454 MS01 5 0989 JS10 6 0989 MS10 You execute the following query: SELECT * FROM CurrentContact where ID <=2 OR ID >=5 How many rows should the result return?
A. 0 B. 2 C. 4 D. 6 |
|
Definition
|
|
Term
The CurrentContact table contains the following data: ID ConID TakenBy 1 1334 FM22 2 2343 JS10 3 1001 MS01 4 1454 MS01 5 0989 JS10 6 0989 MS10 You execute the following query: SELECT * FROM CurrentContact where ID <=2 AND ID>=5 How many rows should the result return?
A. 0 B. 2 C. 4 D. 6 |
|
Definition
|
|
Term
You need to return a list of students from the Student table where the student's email address ends in "edu." Which query would return this information?
A. SELECT Email, LastName, FirstName from STUDENT WHERE Email like '*edu'
B. SELECT Email, LastName, FirstName from STUDENT WHERE Email like '%edu'
C. SELECT Email, LastName, FirstName from STUDENT WHERE Email ='*edu'
D. SELECT Email, LastName, FirstName from STUDENT WHERE Email ='%edu' |
|
Definition
B. SELECT Email, LastName, FirstName from STUDENT WHERE Email like '%edu' |
|
|