SQL Server - Quiz Explanation

The correct answers are indicated below, along with text that explains the correct answers.
 
1. Which of the following Transact-SQL statements is NOT an accurate variable declaration?
Please select the best answer.
  A. DECLARE @x varchar
  B. DECLARE @x int
  C. DECLARE @x myusertype
  D. DECLARE @@x int
  The correct answer is D. You cannot declare a variable by using @@. All variables are declared with @. A is correct because this is a valid declaration. B is also a valid declaration. C is correct because a variable can be declared by using a user-defined type.

2. John wants to return the database name for database ID 1. He decides to use the DB_NAME function and pass the ID. Which of the following statements could he use?
Please select the best answer.
  A. DB_NAME (1)
  B. DB_NAME 1
  C. SELECT DB_NAME (1)
  D. SELECT DB_NAME 1
  The correct answer is C.
To return data back to the calling application, use the SELECT statement. The value is passed within parentheses. A is incorrect because there is no SELECT statement. B is incorrect because there are no parentheses around the argument. D is incorrect because there are no parentheses around the argument.

3. What is wrong with the following Transact-SQL statement:
RAISERROR ('An error occurred', 19, 1)
Please select the best answer.
  A. Nothing is wrong. The statement will work correctly.
  B. You cannot specify text in the RAISERROR statement. You need to specify a number.
  C. The statement is missing the WITH LOG option.
  D. The severity is outside the range of allowable values.
  The correct answer is C.
The RAISERROR statement with a severity of 19 or greater requires the WITH LOG option. A is incorrect because the statement will not work correctly. B is incorrect because you can specify text dynamically. D is incorrect because severity can be between 0 and 25.