250+ TOP MCQs on Estimating Statistics of Expression Results and Answers

Database Questions and Answers for Campus interviews on “Estimating Statistics of Expression Results”.

1. Which feature converts row data to a column for better analytical view?
a) Views
b) Join
c) Pivot
d) Trigger

Answer: c
Clarification: Pivot table is very powerful and very easy to use.

2. Which of the following statements is/are not true for SQL profiler?
a) Enables you to monitor events
b) Check if rows are being inserted properly
c) Check the performance of a stored procedure
d) None of the mentioned

Answer: c
Clarification: Stored procedures are like functions which do not return values.

3. Which global variables can be used to determine if a transaction is still open?
a) @@NESTLEVEL
b) @@FETCH_STATUS
c) @@TRANCOUNT
d) @@CONNECTIONS

Answer: c
Clarification: PRINT @@TRANCOUNT — The BEGIN TRAN statement will increment the — transaction count by 1.

4. Which statement is used to define a cursor?
a) OPEN
b) FETCH
c) DECLARE CURSOR
d) @@FETCH_STATUS

Answer: c
Clarification: A database cursor is a control structure that enables traversal over the records in a database.

5. What is the default “SORT” order for a SQL?
a) Ascending
b) Descending
c) As specified by the user
d) None of the mentioned

Answer: a
Clarification: Default is ascending order.

6. Capabilities of RAISERROR
a) It can be logged in the error log
b) It can print a message to the application
c) It can assign an error number, state and severity
d) All of the mentioned

Answer: d
Clarification: A relational database table is often described as “normalized” if it is in the Third Normal Form because most of the 3NF tables are free of insertion, update, and deletion anomalies.

7. How inserting data through stored procedure do reduces network traffic and increase database performance?
a) Stored procedure can accept parameter
b) Permission check is not required
c) The execution plan is stored in the cache after it was executed the first time
d) None of the mentioned

Answer: c
Clarification: A relational database table is often described as “normalized” if it is in the Third Normal Form because most of the 3NF tables are free of insertion, update, and deletion anomalies.

8. Stored procedures are safe from SQL injection attacks
a) True
b) False
c) Depends on the result
d) Always safe

Answer: a
Clarification: Injection attack is not possible in SP.

9. Which of the following connection type supports application role permissions and password encryption?
a) OLE DB
b) DBLib
c) ODBC
d) OLE DB and ODBC

Answer: d
Clarification: Open Database Connectivity (ODBC) is Microsoft’s strategic interface for accessing data in a heterogeneous environment of relational.

10. Cursor that reflects the changes made to the database table even after the result set is returned
a) Static
b) Dynamic
c) FORWARD_ONLY
d) Keyset

Answer: b
Clarification: A database cursor is a control structure that enables traversal over the records in a database.

Leave a Reply

Your email address will not be published. Required fields are marked *