Database Questions and Answers – Estimating Statistics of Expression Results

This set of Database Questions and Answers for Campus interviews 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

Answer: c
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

Answer: c
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

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

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

Answer: c
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

Answer: a
Explanation: Default is ascending order.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

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

Answer: d
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

Answer: c
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.
advertisement

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

Answer: a
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

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

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

Answer: b
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.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.