Have you ever worked on an SQL server? What do you know about this database system? We have here this "SQL server quiz questions and answers" for you. Microsoft SQL Server is a DBMS developed by Microsoft for storing and retrieving data. In this SQL quiz, we will test your knowledge and understanding of various SQL concepts and terminologies. You can easily crack this quiz if you consider yourself a true database administrator. Want to check your memory for the same? Take this test, then!
Gives an error.
Returns all Professions which has not null values.
<> is not an operator in SQL Server.
None of the above.
DOT
OTN
OT
None of the above.
It protects against phantom reads.
It causes the highest level of contention.
It causes the highest level of blocking.
All of the above.
0
1
-1
2
DELETE FROM EMP OUTPUT deleted.* INTO EmpCompress FROM Emp JOIN deptON EMP.DeptId = Dept.DeptId WHERE DeptName='IT';
DELETE FROM EMP OUTPUT deleted.* INTO EmpCompress FROM Emp JOIN Dept ON EMP.DeptId = Dept.DeptId ;
DELETE FROM EMP OUT PUT deleted.* INTO EmpCompress FROM Emp JOIN deptON EMP.DeptId = Dept.DeptId WHERE DeptName='IT';
None of the above.
SELECT clause
FROM clause
Both A and B.
None of the above.
BUILT-IN functions in SQL Server are Nondeterministic.
ISNULL function in SQL Server is Deterministic.
All of the above.
None of the above.
NULL values are ignored for all the aggregate functions.
NULL values are included for all the aggregate functions.
When an aggregate function is included in the SELECT clause, all other expressions in the SELECT clause must either be aggregate functions or included in a GROUP BY clause.
Both A and C.
Both B and C.
Displays Users with Profession as 'engineer' with PKUserId > 12 as well as the users with PKUserId of 1.
Displays Users with Profession as 'engineer' with PKUserId > 12 only.
Displays Users with Profession as 'engineer' with PKUserId of 1 only.
None of the above.
The data is rolled back to the transaction starting on line1.
The inserted row does not exist in the table.
All of the above.
None of the above.
Only B.
Only inserts a new record into the Emp table.
OUTPUT clause cannot be used in the INSERT command.
Adds a new row to the Emp table, and also adds a corresponding row with the current date and time and the EmpId for the new employee into the Audit table.
None of the above.
1
2
3
128
SELECT PKUserId, UserName FROM UserProfile WHERE (UserName LIKE '[vz]%')
SELECT PKUserId, UserName FROM UserProfile WHERE (UserName LIKE '[v-z]%')
SELECT PKUserId, UserName FROM UserProfile WHERE (UserName LIKE '[v-z%]')
None of the above.
We can use SQL Profiler to capture lock and blocking information.
We can use the System Monitor that is part of the performance console to capture statistics on lock wait times, locks per second, and so on.
We can use the Activity Monitor in SSMS to see information on blocking processes.
We can use the sys.dm_tran_locks dynamic management view to gather information on locks being held by transactions.
All of the above.
DBCC LOGGING statement
DBC LOG statement
DBCC LOG statement
None of the above.
Sys.dm_active_transactions
Sys.dm_tran_transactions
Sys.dm_tran_active_transactions
None of the above
Clustered index
Non-Clustered index
Both A and B
None of the above.
Savepoints
Checkpoints
Transactions
None of the above.
11/12/31
31/12/11
31/12/2011
2011/12/31
Access resources in the same order whenever possible within transactions
Collect and verify input data from users before opening a transaction
Keep transactions long.
All of the above.
Only A and B.
LEFT OUTER JOIN
RIGHT OUTER JOIN
SELF JOIN
INNER JOIN
1
0
2
-1
The DELETE statement logs information on each row deleted.
The TRUNCATE TABLE statement logs information on each row deleted.
The TRUNCATE TABLE statement executes fast and requires fewer resources on the server.
All of the above.
Only A and C.
Returns records which has values in profession column
Gives an error.
Does not retrieve any records even if profession column contains values.
None of the above.
-8
8
0
-1
Wait!
Here's an interesting quiz for you.