SQL MCQs – Database Administration and Security

11.) How can database performance be monitored?

A) Using performance monitoring tools
B) Analyzing query execution plans
C) Tracking server resource usage
D) All of the above

Answer: Option D

Explanation: Monitoring tools and techniques help identify and resolve performance issues.

12.) What is a disaster recovery plan in database management?

A) A plan to optimize database queries
B) A strategy to recover data in case of failure
C) A guide to install database software
D) A method to grant user permissions

Answer: Option B

Explanation: A disaster recovery plan ensures data and system restoration after unexpected events.

13.) What is SQL injection?

A) A database optimization technique
B) A method of creating backups
C) A security vulnerability allowing malicious SQL code execution
D) A way to encrypt database records

Answer: Option C

Explanation: SQL injection exploits vulnerabilities to execute harmful SQL commands.

14.) Which SQL function can identify the current user?

A) USER()
B) CURRENT_USER()
C) SESSION_USER()
D) All of the above

Answer: Option D

Explanation: These functions return information about the current database user.

15.) How is sensitive data protected in a database?

A) By limiting user access
B) By using encryption
C) By auditing and monitoring activities
D) All of the above

Answer: Option D

Explanation: A combination of these methods ensures robust data protection.

16.) What is the purpose of a database firewall?

A) To optimize query execution
B) To block unauthorized access
C) To monitor server performance
D) To manage user permissions

Answer: Option B

Explanation: A database firewall detects and prevents unauthorized or malicious activities.

17.) What is the difference between symmetric and asymmetric encryption in databases?

A) Symmetric uses one key; asymmetric uses two keys
B) Asymmetric is faster than symmetric
C) Symmetric encrypts only text; asymmetric encrypts all data
D) There is no difference

Answer: Option A

Explanation: Symmetric encryption uses a single key for encryption and decryption, while asymmetric uses a public-private key pair.

18.) What is the primary purpose of a database schema?

A) To define the structure of the database
B) To store backup files
C) To grant user permissions
D) To execute SQL queries

Answer: Option A

Explanation: A schema defines the organization and structure of database objects.

19.) What does “principle of least privilege” mean in database security?

A) Encrypting sensitive data
B) Allowing all users full database access
C) Removing unused tables and columns
D) Assigning minimum access necessary for users

Answer: Option D

Explanation: This principle minimizes security risks by restricting user permissions to only what is required.

20.) Which command is used to lock a table in SQL?

A) LOCK TABLE
B) BLOCK TABLE
C) SECURE TABLE
D) FREEZE TABLE

Answer: Option A

Explanation: LOCK TABLE is used to prevent concurrent access or modifications to a table.

Leave a Reply

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