Documente Academic
Documente Profesional
Documente Cultură
updated
o Neither “Ramesh” will be updated to “Mahesh”, nor the salary of
engineers will be updated.
o “Ramesh” will be updated to “Mahesh” and salary of engineers will also
be
updated.
7. Which of the following constraints can be used to enforce the uniqueness of rows
in a table?
o DEFAULT and NOT NULL constraints
o FOREIGN KEY constraints
o PRIMARY KEY and UNIQUE constraints
o IDENTITY columns
o CHECK constraints
8. Which of the following are not date parts?
o quarter
o dayofweek
o dayofyear
o weekday
9. The IF UPDATE (column_name) parameter in a trigger definition will return
TRUE in case of an INSERT statement being executed on the triggered table:
o Yes
o No
o It returns TRUE only if an UPDATE query is executed
o Both b and c
10. Which one of the following must be specified in every DELETE statement?
o Table Name
o Database name
o LIMIT clause
o WHERE clause
o Column Names
11. Which one of the following correctly selects rows from the table myTable that
have null in column column1?
o SELECT * FROM myTable WHERE column1 is null
o SELECT * FROM myTable WHERE column1 = null
o SELECT * FROM myTable WHERE column1 EQUALS null
o SELECT * FROM myTable WHERE column1 NOT null
o SELECT * FROM myTable WHERE column1 CONTAINS null
12. Is this statement true or false:
A cursor is a pointer that identifies a specific working row within a set
o True
o False
13. Which of the following commands is used to change the structure of table?
o CHANGE TABLE
o MODIFY TABLE
o ALTER TABLE
o UPDATE TABLE
14. 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
o 1 is true and 2 is false
o 1 is false and 2 is true
o Both 1 and 2 are true
o Both 1 and 2 are false
15. What is the correct SQL syntax for returning all the columns from a table named
“Persons” sorted REVERSE alphabetically by “FirstName”?
o SELECT * FROM Persons WHERE FirstName ORDER BY FirstName
DESC
o SELECT * FROM Persons SORT REVERSE ‘FirstName’
16. What is the maximum value that can be stored for a datetime field?
o Dec 31, 9999
o Jun 6, 2079
o Jan 1, 2753
o Jan 1, 2100
17. 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:
o Query 2 will return an error
o Both the queries will return the same set of records
o Query 2 is perfectly correct
o Query 2 would return one record less than Query 1
18. How can you view the structure of a table named “myTable” in SQL Server?
o desc myTable
o desc table myTable
o sp_columns myTable
o None of the above
o Using either option a or c
19. What does referential integrity (also called relational integrity) prevent?
o Loss of data from employee sabotage
o Loss of data from any one corrupted table
o Recursive joins
o One-to-many or many-to-many relationships between columns in a table
o Data redundancy
20. Which of the following is not a global variable?
o @@colcount
o @@error
o @@rowcount
o @@version
o All are valid global variables
21. Consider the following two tables:
Ans. VARTEXT
Begin Transaction
Update names_table set employee_name = “Ramesh” where employee_name =
“Mahesh”
Save Transaction SAVE_POINT
Update salaries set salary=salary + 900 where employee_job = “Engineer”
Rollback transaction
Commit transaction
What will be the result produced by this transaction?
Ans. “Ramesh” will be updated to “Mahesh”, but salaries of engineers will not be
updated.
Ans. dayofweek
10. Which one of the following must be specified in every DELETE statement?
Ans. Table Name
11. Which one of the following correctly selects rows from the table myTable that
have null in column column1?
Ans. True
13. Which of the following commands is used to change the structure of table?
14. 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
15. What is the correct SQL syntax for returning all the columns from a table
named “Persons” sorted REVERSE alphabetically by “FirstName”?
16. What is the maximum value that can be stored for a datetime field?
18. How can you view the structure of a table named “myTable” in SQL Server?
Ans.@@colcount
Ans. if exists
23. Which of the following is not a valid Numeric datatypes in SQL Server?
Ans.
Ans. Logical
25. What will the output be if you try to perform arithmetic on NULL values?
Ans.NULL
26. What will the output be if you try to perform arithmetic on NULL values?
Ans. It returns a signed integer value equal to first date part minus second date
part
29. Which of the following is not a valid binary datatype in SQL Server?
Ans. TESTAMP
Thanks.
33. When designing a database table, how do you avoid missing column values for
non-primary key columns?
Use DEFAULT and NOT NULL constraints
Begin Transaction
Update names_table set employee_name = “Ramesh” where employee_name =
“Mahesh”
Save Transaction SAVE_POINT
Update salaries set salary=salary + 900 where employee_job = “Engineer”
Rollback transaction
Commit transaction
What will be the result produced by this transaction?
Neither “Ramesh” will be updated to “Mahesh”, nor the salary of engineers will
be updated.
Which of the following constraints can be used to enforce the uniqueness of rows
in a table?
PRIMARY KEY and UNIQUE constraints
Which one of the following correctly selects rows from the table myTable that
have null in column column1?
SELECT * FROM myTable WHERE column1 is null
What is the correct SQL syntax for returning all the columns from a table named
“Persons” sorted REVERSE alphabetically by “FirstName”?
SELECT * FROM Persons WHERE FirstName ORDER BY FirstName DESC
What is the maximum value that can be stored for a datetime field?
Dec 31, 9999
How can you view the structure of a table named “myTable” in SQL Server?
None of the above
It will return an error since * is used alone for one table only
What will the output be if you try to perform arithmetic on NULL values?
NULL
Which of the following options is not correct about the DATEDIFF() function?
It returns the difference between parts of two specified dates
It takes three arguments
It returns a signed integer value equal to second date part minus first date part
Please send me the comments by mail if you are not agree with me.
Thank you very much for your passion.
Rajesh
34. 18. How can you view the structure of a table named “myTable” in SQL Server?
a.desc myTable
b.desc table myTable
c.sp_columns myTable
d.None of the above
e.Using either option a or c
38. 18. How can you view the structure of a table named “myTable” in SQL Server?
a.desc myTable
b.desc table myTable
c.sp_columns myTable
d.None of the above
e.Using either option a or c