Tag: databases

Questions Related to databases

  1. NOT operator is used in the predicate

  2. IN Operator is used in the predicate

  3. Expression and/or functions are used on the indexed columns

  4. Predicate is skipped. However, the SELECT clause has indexed columns

  5. ORDER BY clause has NULL columns. However, NON UNIQUE index exists


Correct Option: A,C,E

Which of the following conditions will you use in a WHERE clause to select all last names that start with S?

  1. WHERE LastName = 'S*'

  2. WHERE LastName = 'S%'

  3. WHERE LastName LIKE 'S*'

  4. WHERE LastName LIKE 'S%'


Correct Option: D

AI Explanation

To select all last names that start with 'S', you would use the LIKE operator in the WHERE clause. The correct condition to use would be:

D. WHERE LastName LIKE 'S%'

Explanation:

  • Option A: WHERE LastName = 'S*' - This condition will only select last names that are exactly 'S*'. It will not select any last names that start with 'S'.
  • Option B: WHERE LastName = 'S%' - This condition will only select last names that are exactly 'S%' (where '%' is a wildcard that represents any number of characters). It will not select any last names that start with 'S' followed by more characters.
  • Option C: WHERE LastName LIKE 'S*' - This condition is similar to Option A and will only select last names that are exactly 'S*'. It will not select any last names that start with 'S'.
  • Option D: WHERE LastName LIKE 'S%' - This condition will select last names that start with 'S' followed by any number of characters. The '%' wildcard represents any number of characters, so this condition will select all last names that begin with 'S'.

Therefore, the correct answer is D. WHERE LastName LIKE 'S%'.

  1. The public role captures all default permissions for users in a database.

  2. The public role cannot be dropped.

  3. The public role is contained in every database, including msdb, tempdb, model, and all user databases except in the master database for security purposes.

  4. The public role cannot have users, groups, or roles assigned to it.


Correct Option: C
  1. 2,147,483,647

  2. 2,147,483,648

  3. 4,294,967,295

  4. 4,294,967,296


Correct Option: A

What will be the result of the following SELECT statement SELECT 2000/02/25 + 4

  1. 2000/02/29

  2. 2000/03/01

  3. 44

  4. An error is generated. A DATETIME value and an INT value cannot be added together. Use the DATEADD function for this purpose.


Correct Option: C
  1. January 1, 1643

  2. January 1, 1753

  3. January 1, 1863

  4. January 1, 1700

  5. January 1, 1800

  6. January 1, 1900


Correct Option: B
  1. db_accessadmin

  2. db_securityadmin

  3. db_setupadmin

  4. db_sysadmin


Correct Option: A

What's the maximum number of parameters can a SQL Server 2000 stored procedure have?

  1. 128

  2. 256

  3. 512

  4. 1,024


Correct Option: D