Database Test Part-02

 

11. Which of the following commands is used to change the structure of table?

  1. CHANGE TABLE
  2. MODIFY TABLE
  3. ALTER TABLE
  4. UPDATE TABLE

12. Consider the following statements and pick the correct answer:

1. ceiling() – returns the smallest integer greater than or equal to the specified value

2. floor() – returns the largest integer less than or equal to the specified value

  1. 1 is true and 2 is false
  2. 1 is false and 2 is true
  3. Both 1 and 2 are true
  4. Both 1 and 2 are false

13. What is the maximum value that can be stored for a datetime field?

  1. Dec 31, 9999
  2. Jun 6, 2079
  3. Jan 1, 2753
  4. Jan 1, 2100

14. Consider the following queries:

1. select * from employee where department LIKE “[^F-M]%”;

2. select * from employee where department = “[^F-M]%”;

Select the correct option:

  1. Query 2 will return an error
  2. Both the queries will return the same set of records
  3. Query 2 is perfectly correct
  4. Query 2 would return one record less than Query 1

15. How can you view the structure of a table named “myTable” in SQL Server?

  1. desc myTable
  2. desc table myTable
  3. sp_columns myTable
  4. None of the above
  5. Using either option a or c

16. What does referential integrity (also called relational integrity) prevent?

  1. Loss of data from employee sabotage
  2. Loss of data from any one corrupted table
  3. Recursive joins
  4. One-to-many or many-to-many relationships between columns in a table
  5. Data redundancy

17. Which of the following is not a global variable?

  1. @@colcount
  2. @@error
  3. @@rowcount
  4. @@version
  5. All are valid global variables

18. Which of the following is not a control statement?

  1. if…else
  2. if exists
  3. do…while
  4. while
  5. begin…end

19. Which of the following is not a valid Numeric datatypes in SQL Server?

  1. INT
  2. SMALLINT
  3. TINYINT
  4. BIGINT
  5. MONEY

20. Which of the following datatypes is not supported by SQL-Server?

  1. Character
  2. Binary
  3. Logical
  4. Date
  5. Numeric
  6. All are supported

Comments

comments

Leave a Comment

Time limit is exhausted. Please reload CAPTCHA.