This set of Database Questions and Answers focuses 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: A database cursor is a control structure that enables traversal over the records in a database.
Sanfoundry Global Education & Learning Series – Database Management System.
- Apply for Computer Science Internship
- Check DBMS Books
- Check Computer Science Books
- Check Programming Books
- Practice Computer Science MCQs