Database Security # MCQs Practice set

Q.1 Which of the following is a primary goal of database security?

Data storage
Data retrieval
Data confidentiality
Data formatting
Explanation - Database security aims to protect data from unauthorized access, ensuring confidentiality, integrity, and availability.
Correct answer is: Data confidentiality

Q.2 Which type of database attack involves an attacker injecting malicious SQL statements?

Phishing
SQL Injection
Man-in-the-middle
Denial of Service
Explanation - SQL Injection is a common attack where malicious SQL code is inserted into an input field to manipulate the database.
Correct answer is: SQL Injection

Q.3 What does the principle of least privilege in database security mean?

Users get all privileges
Users get only necessary privileges
Users can share privileges freely
Privileges are not required
Explanation - Least privilege means giving users only the access they need to perform their tasks, reducing potential damage from misuse or attacks.
Correct answer is: Users get only necessary privileges

Q.4 Which of the following is NOT a database access control mechanism?

Discretionary Access Control
Mandatory Access Control
Role-Based Access Control
Data Encryption Standard
Explanation - Data Encryption Standard (DES) is an encryption algorithm, not an access control mechanism.
Correct answer is: Data Encryption Standard

Q.5 Encryption in databases primarily provides protection against which type of threat?

SQL Injection
Unauthorized access
Data replication
Indexing errors
Explanation - Encryption converts data into unreadable form, protecting it from unauthorized access even if the database is compromised.
Correct answer is: Unauthorized access

Q.6 Which database security feature ensures that data cannot be altered or deleted by unauthorized users?

Authentication
Authorization
Integrity controls
Backup
Explanation - Integrity controls maintain the accuracy and consistency of data, preventing unauthorized modifications.
Correct answer is: Integrity controls

Q.7 Which of the following can help prevent SQL injection attacks?

Input validation
Data normalization
Indexing tables
Partitioning database
Explanation - Validating user input ensures malicious SQL commands cannot be executed through input fields.
Correct answer is: Input validation

Q.8 In database security, authentication refers to:

Verifying the identity of a user
Granting permissions to a user
Encrypting data
Backing up data
Explanation - Authentication is the process of confirming that a user is who they claim to be, often using passwords or tokens.
Correct answer is: Verifying the identity of a user

Q.9 Which of the following is a database auditing activity?

Monitoring access patterns
Normalizing tables
Partitioning tables
Creating views
Explanation - Database auditing tracks user activities and access patterns to detect unauthorized actions.
Correct answer is: Monitoring access patterns

Q.10 Two-factor authentication typically combines:

Password and encryption
Something you know and something you have
Password and username
Token and firewall
Explanation - Two-factor authentication enhances security by requiring two types of credentials, often a password and a physical token.
Correct answer is: Something you know and something you have

Q.11 What is the purpose of a database firewall?

Filter network traffic to prevent attacks
Backup the database
Encrypt sensitive data
Normalize data
Explanation - A database firewall monitors and filters incoming traffic to block malicious requests before they reach the database.
Correct answer is: Filter network traffic to prevent attacks

Q.12 Which of the following best describes role-based access control (RBAC)?

Users are granted access based on their role
All users have the same access
Users request privileges individually
Access is based on network location
Explanation - RBAC assigns permissions to roles rather than individuals, simplifying access management.
Correct answer is: Users are granted access based on their role

Q.13 Which of the following is a risk if database backups are not secured?

Data loss
Unauthorized data access
Data corruption
All of the above
Explanation - Unsecured backups can lead to data loss, unauthorized access, and corruption, compromising database security.
Correct answer is: All of the above

Q.14 Which type of attack tries to overload a database server with requests to make it unavailable?

Phishing
Denial-of-Service (DoS)
SQL Injection
Cross-Site Scripting
Explanation - DoS attacks flood the server with requests, preventing legitimate users from accessing the database.
Correct answer is: Denial-of-Service (DoS)

Q.15 What is the purpose of data masking in databases?

Encrypt data permanently
Hide sensitive data for testing or reporting
Increase database speed
Compress database size
Explanation - Data masking replaces sensitive data with fictional or scrambled data to protect privacy while using real database structures.
Correct answer is: Hide sensitive data for testing or reporting

Q.16 Which of the following ensures non-repudiation in database transactions?

Access control
Audit trails
Encryption
Input validation
Explanation - Audit trails record who did what and when, providing evidence to prevent denial of actions.
Correct answer is: Audit trails

Q.17 Which of the following is a preventive database security measure?

Audit trails
Encryption
Monitoring logs
Incident reporting
Explanation - Preventive measures aim to stop attacks before they occur, such as encrypting sensitive data.
Correct answer is: Encryption

Q.18 What is a common method to protect sensitive database fields like passwords?

Hashing with salt
Normalization
Indexing
Replication
Explanation - Hashing with a salt converts passwords into irreversible codes, adding security against brute-force attacks.
Correct answer is: Hashing with salt

Q.19 Which of the following is NOT a common database security threat?

SQL Injection
Privilege abuse
Backups
Malware
Explanation - Backups are a security measure, not a threat. Threats include SQL injection, privilege abuse, and malware.
Correct answer is: Backups

Q.20 What does database integrity refer to in security?

Data is available to all users
Data is accurate and consistent
Data is encrypted
Data is backed up regularly
Explanation - Integrity ensures that data is correct, reliable, and consistent across the database.
Correct answer is: Data is accurate and consistent

Q.21 Which protocol is commonly used to secure database connections over a network?

HTTP
HTTPS
SSL/TLS
FTP
Explanation - SSL/TLS encrypts data transmitted between clients and databases to prevent eavesdropping and tampering.
Correct answer is: SSL/TLS

Q.22 Which of the following is an example of a physical database security measure?

Biometric access to servers
Password policies
Role-based access control
Input validation
Explanation - Physical security measures protect hardware and storage locations from unauthorized access, such as biometric locks.
Correct answer is: Biometric access to servers

Q.23 Which attack exploits flaws in a database application to steal session information?

Session hijacking
Privilege escalation
SQL Injection
Denial-of-Service
Explanation - Session hijacking allows attackers to take over active sessions by stealing session tokens or cookies.
Correct answer is: Session hijacking

Q.24 Which of the following is a key concept in database security policies?

Data confidentiality, integrity, and availability
Data normalization, indexing, and partitioning
Data replication, sharding, and caching
Data backup, compression, and logging
Explanation - The CIA triad—confidentiality, integrity, and availability—is fundamental in database security.
Correct answer is: Data confidentiality, integrity, and availability

Q.25 Which of the following is an example of a logical database attack?

SQL Injection
Fire
Flooding
Server room break-in
Explanation - Logical attacks target software and data, such as SQL injection, while physical attacks target hardware.
Correct answer is: SQL Injection