Select Data  «Prev  Next»

Selecting Data using SQL Server - Quiz

Each question is worth one point. Select the best answer for each question.
 
1. Kevin wants to find out which employees in the Employees table exist in the Terminated table. What is the most efficient technique for him to do this with Transact-SQL?
Please select the best answer.
  A. Union
  B. Subquery
  C. Join
  D. Aggregate

2. Paul has a table named DistributedTransactionHistory. He needs to write a long query that references this table name many times. What is the best technique for dealing with long names such as this?
Please select the best answer.
  A. Alias the table name so that a shorter name can be referenced in the query
  B. Rename the table to something smaller
  C. Place the data into a table of a different name
  D. Simply reference the long table name in the query

3. Steve wants to write a Transact-SQL query to determine the minimum salary for each department in the company. He writes the following query:
SELECT Department, MIN(Salary)
FROM Employees

Please select the best answer.
  A. What is the most important reason why this query will receive an error?
  B. The Employees table does not exist
  C. MIN is not a valid aggregate
  D. The ORDER BY clause is missing

4. Barry issues this query:
SELECT SoftPartID AS ID
FROM Software
WHERE Cost < 150
UNION
SELECT HardPartID AS PartID
FROM Hardware
WHERE Cost < 1000

What will SQL Server 7 return as the name of the result column in the resultset?
Please select the best answer.
  A. SoftPartID
  B. ID
  C. HardPartID
  D. PartID

5. Marty issued a distributed query, but received an error. Although many things could cause an error, what would be the first thing he should check?
Please select the best answer.
  A. The desired servers are linked.
  B. The query contains correct column names.
  C. There is a WHERE clause.
  D. The WITH DISTRIBUTE keywords are specified.

Correct answers:

Your Score: 0