SQLConfiguration SQLConfiguration


SQL-Query Basics  «Prev  Next»

SQL-Server Query Basics - Quiz<

Each question is worth one point. Select the best answer or answers for each question.
 
1. What will happen if Fred executes the following Transact-SQL code and the value of @x is 35?
SELECT @y = 0
SELECT @z = 0
IF @x >= 40
 
SELECT @y = 5
SELECT @z = 10

Please select the best answer.
  A. @y will be equal to 5 and @z will be equal to 10
  B. @y will be equal to 0 and @z will be equal to 10
  C. @y will be equal to 0 and @z will be equal to 0
  D. @y will be equal to 5 and @z will be equal to 0

2. What tool comes with SQL Server 2000 that allows you to issue interactive queries and view results of those queries?
Please select the best answer.
  A. Enterprise Manager
  B. Service Manager
  C. Query Analyzer
  D. Query Manager

3. What keyword would you use to separate, or delimit, Transact-SQL batches?
Please select the best answer.
  A. CONTINUE
  B. GO
  C. BEGIN BATCH
  D. GO BATCH

4. What will be the result of the following Transact-SQL?
DECLARE @TableName varchar(20)
DECLARE @SQL varchar(1000)
SET @TableName = 'Employee'
SET @SQL = 'SELECT * FROM + @TableName’
EXEC @SQL

NOTE: Pay close attention to the syntax.

Please select the best answer.
  A. The correct data will be selected from the Employee table.
  B. The correct data will be selected from the @TableName table.
  C. A syntax error will result when SQL Server checks the syntax of the batch.
  D. A syntax error will result when SQL Server executes the EXEC line in the batch.
Correct answers:

Your Score: 0