Oracle Certification

1Z0-931 — MySQL Database Admin Study Guide

60 practice questions with correct answers and detailed explanations. Use this guide to review concepts before taking the practice exam.

▶ Take Practice Exam 60 questions  ·  Free  ·  No registration

About the 1Z0-931 Exam

The Oracle MySQL Database Admin (1Z0-931) certification validates professional expertise in Oracle technologies. This study guide covers all 60 practice questions from our 1Z0-931 practice test, complete with correct answers and explanations to help you understand each concept thoroughly.

Review each question and explanation below, then test yourself with the full interactive practice exam to measure your readiness.

60 Practice Questions & Answers

Q1 Easy

Which MySQL storage engine is optimized for read-heavy workloads and provides in-memory performance with persistence?

  • A InnoDB ✓ Correct
  • B MyISAM
  • C Memory
  • D NDB
Explanation

InnoDB is the default MySQL storage engine that offers ACID compliance, row-level locking, and excellent performance for both read and write operations while maintaining data persistence.

Q2 Medium

What is the primary advantage of using MySQL replication for a production database environment?

  • A It guarantees zero-latency data synchronization between servers
  • B It eliminates the need for backups entirely
  • C It provides high availability and distributes read workloads across replicas ✓ Correct
  • D It automatically partitions data across multiple servers
Explanation

MySQL replication creates copies of data on replica servers, enabling load distribution for reads and providing failover capabilities for high availability scenarios.

Q3 Medium

When configuring a MySQL master-slave replication topology, which parameter must be set identically on both the master and slave servers?

  • A bind-address should match the master's IP address on the slave
  • B server-id must be unique on each server, not identical
  • C relay-log-index must reference the same file on both servers
  • D The binary log format should be compatible between master and slave ✓ Correct
Explanation

The binary log format (STATEMENT, ROW, or MIXED) must be compatible between master and slave to ensure proper replication of changes. While server-id must be unique, log format should align.

Q4 Medium

Which command is used to promote a MySQL slave to become the new master in a replication topology?

  • A RESET SLAVE ALL;
  • B STOP SLAVE; RESET SLAVE ALL; ✓ Correct
  • C PROMOTE SLAVE TO MASTER;
  • D SET GLOBAL READ_ONLY = OFF;
Explanation

To promote a slave, you must first stop replication with STOP SLAVE, then execute RESET SLAVE ALL to clear replication metadata, allowing it to function as an independent master.

Q5 Medium

What is the purpose of the mysql_upgrade utility in MySQL administration?

  • A It automatically upgrades MySQL binary files to the latest version
  • B It migrates user data from one storage engine to another
  • C It checks and upgrades the system tables and performs compatibility checks after a MySQL version upgrade ✓ Correct
  • D It optimizes table structures to improve query performance significantly
Explanation

mysql_upgrade is a post-upgrade tool that checks system table compatibility, updates privilege tables, and ensures the new MySQL version can properly read existing data structures.

Q6 Medium

In a MySQL backup scenario, what is the key limitation of using mysqldump for large databases?

  • A It requires significantly more disk space than the original database size
  • B It cannot backup InnoDB tables with compression enabled
  • C It cannot preserve stored procedures or triggers without additional parameters
  • D It locks tables during the backup process, potentially causing downtime for write operations ✓ Correct
Explanation

mysqldump can lock tables during backup unless the --single-transaction option is used for InnoDB, which may impact availability. This is a key limitation for large, active databases.

Q7 Hard

Which backup method provides a physical, file-level copy of the entire MySQL data directory while maintaining consistency?

  • A Physical backup using MySQL Enterprise Backup or Percona XtraBackup with incremental capabilities ✓ Correct
  • B Logical backup with mysqldump using --all-databases
  • C CSV export using SELECT INTO OUTFILE statement
  • D Binary log replication synchronization to a standby server
Explanation

Physical backups like MySQL Enterprise Backup copy actual data files while maintaining consistency, offering faster restoration and incremental backup capabilities compared to logical methods.

Q8 Medium

How does the innodb_buffer_pool_size parameter affect MySQL performance?

  • A It determines the maximum number of concurrent database connections allowed
  • B It controls the size of the in-memory cache for InnoDB data and indexes, with larger values reducing disk I/O ✓ Correct
  • C It limits the amount of RAM used for query result caching
  • D It sets the threshold for automatic table optimization operations
Explanation

innodb_buffer_pool_size is the most critical InnoDB performance parameter, caching both data pages and index pages to minimize expensive disk reads. It should typically be 50-75% of available RAM.

Q9 Hard

What is the relationship between the max_connections parameter and the number of open_files_limit in MySQL?

  • A open_files_limit must be set lower than max_connections to prevent resource exhaustion
  • B Each connection may require multiple file descriptors, so open_files_limit should be higher than max_connections ✓ Correct
  • C max_connections has no relationship to open_files_limit and can be set independently
  • D They must always be set to identical values for optimal performance and stability
Explanation

MySQL connections require multiple file descriptors for tables, temporary files, and connections. open_files_limit should be significantly higher than max_connections to accommodate additional overhead.

Q10 Hard

Which of the following is the correct approach to safely modify the innodb_buffer_pool_size parameter on a running MySQL production server?

  • A Use the online buffer pool resizing feature available in MySQL 5.7+ by setting the parameter dynamically ✓ Correct
  • B Change the value in my.cnf and execute FLUSH TABLES; RESTART to apply changes
  • C Execute SET GLOBAL innodb_buffer_pool_size = <new_value>; without restarting
  • D Schedule downtime and modify the parameter, then restart MySQL immediately
Explanation

MySQL 5.7 and later support dynamic innodb_buffer_pool_size resizing, allowing adjustments without restart. For earlier versions, a restart is required to apply changes.

Q11 Medium

What does the sync_binlog parameter control in MySQL?

  • A The frequency at which binary logs are synchronized to disk to ensure durability and crash safety ✓ Correct
  • B The automatic rotation schedule of binary log files based on time intervals
  • C The network replication delay between master and slave servers
  • D The compression rate applied to binary log files to save storage space
Explanation

sync_binlog=1 ensures that every transaction is synced to disk before being acknowledged, providing crash safety. Setting it to 0 improves performance but risks data loss.

Q12 Medium

In MySQL, what is the purpose of the relay log in a replication slave?

  • A To maintain a secondary index structure for improved query performance
  • B To cache query results for faster client retrieval without database lookups
  • C To temporarily store binary log events from the master before applying them locally ✓ Correct
  • D To backup the master's data periodically to the slave for disaster recovery
Explanation

The relay log on a slave stores events retrieved from the master's binary log via the IO thread, allowing the SQL thread to apply changes asynchronously and independently.

Q13 Hard

Which monitoring metric is most critical for identifying InnoDB table lock contention issues?

  • A High values in the Innodb_buffer_pool_read_requests status variable
  • B Increasing value of Innodb_row_lock_waits in SHOW ENGINE INNODB STATUS ✓ Correct
  • C Thread state 'Waiting for table metadata lock' in SHOW PROCESSLIST output
  • D Slow query log entries with execution time exceeding long_query_time threshold
Explanation

Innodb_row_lock_waits counts lock waits due to row conflicts. Increasing values indicate lock contention. SHOW ENGINE INNODB STATUS provides detailed lock wait information for analysis.

Q14 Hard

How should you handle a scenario where a MySQL replication slave has fallen significantly behind the master due to slow query execution?

  • A Immediately skip the problematic event using SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
  • B Restart the replication slave to reset the lag counter and resume normal replication speed
  • C Analyze slow queries on the slave, optimize them, or increase slave hardware resources; consider parallel replication if available ✓ Correct
  • D Disable binary logging on the slave to reduce processing overhead and catch up faster
Explanation

Replication lag should be addressed by identifying bottlenecks (slow queries, inadequate resources) and optimizing the slave. MySQL 5.7+ supports parallel replication with slave_parallel_workers.

Q15 Hard

Which statement correctly describes the impact of using READ COMMITTED isolation level in InnoDB?

  • A It allows dirty reads and unrepeatable reads but provides better concurrency than SERIALIZABLE isolation ✓ Correct
  • B It provides a balance between consistency and concurrency by locking only committed rows and indexes
  • C It is identical to REPEATABLE READ and offers no performance advantage for high-concurrency scenarios
  • D It prevents all phantom reads but may cause increased lock contention and reduced concurrency
Explanation

READ COMMITTED isolation level prevents dirty reads but allows unrepeatable and phantom reads. It uses less locking than higher isolation levels, improving concurrency at the cost of less consistency.

Q16 Hard

What is the significance of the auto_increment_increment and auto_increment_offset parameters in a replication environment?

  • A They are automatic parameters that should not be manually configured in any replication scenario
  • B They control the rate at which the auto_increment value increases for better performance
  • C They determine how frequently auto_increment values are written to the binary log
  • D They prevent auto_increment value collisions when multiple masters generate IDs in circular replication topologies ✓ Correct
Explanation

In multi-master replication, these parameters ensure unique auto_increment values across masters by distributing ID ranges. For example, master1 generates 1,3,5... and master2 generates 2,4,6...

Q17 Medium

Which privilege is required for a user to execute SHOW ENGINE INNODB STATUS command?

  • A PROCESS privilege on the global level ✓ Correct
  • B SUPER or SYSTEM_VARIABLES_ADMIN privilege
  • C MONITOR privilege with REPLICATION CLIENT permissions
  • D SELECT privilege on the INFORMATION_SCHEMA database
Explanation

The PROCESS privilege allows users to view all threads and execute SHOW ENGINE INNODB STATUS. This privilege is essential for monitoring and troubleshooting database performance.

Q18 Hard

In MySQL, what does the innodb_autoinc_lock_mode parameter control?

  • A Whether AUTO_INCREMENT counters persist across server restarts
  • B The maximum number of auto_increment values that can be generated per second
  • C The locking strategy for generating AUTO_INCREMENT values, affecting concurrency and predictability ✓ Correct
  • D The storage engine used for tables with AUTO_INCREMENT columns
Explanation

innodb_autoinc_lock_mode (0=traditional, 1=consecutive, 2=interleaved) determines lock behavior during INSERT operations. Mode 2 provides best performance but may cause gaps in IDs.

Q19 Easy

Which of the following best describes the purpose of the slow query log in MySQL?

  • A It tracks replication events between master and slave servers in detail
  • B It records all DELETE and UPDATE operations for compliance and recovery purposes
  • C It captures all queries that exceed the long_query_time threshold, helping identify performance problems ✓ Correct
  • D It logs failed authentication attempts for security auditing purposes
Explanation

The slow query log records queries exceeding long_query_time, helping DBAs identify resource-intensive queries for optimization. Queries without index usage can be logged with log_queries_not_using_indexes.

Q20 Medium

What is the recommended approach for performing a point-in-time recovery (PITR) in MySQL?

  • A Perform a table scan using mysqlcheck to restore specific tables incrementally
  • B Immediately restore the most recent backup without replaying logs to minimize downtime
  • C Restore a full backup, then replay binary logs from before the failure point to the desired recovery time ✓ Correct
  • D Use the relay log files from a replication slave to recover to the exact point needed
Explanation

PITR requires restoring a full backup (from before the failure), then using binary logs with mysqlbinlog to replay events up to the desired timestamp, achieving precise recovery.

Q21 Hard

How does the binlog_format=ROW setting differ from binlog_format=STATEMENT in terms of replication implications?

  • A ROW format produces smaller binary logs and is more efficient for all workload types
  • B ROW format logs actual data changes and is safer for replication but may increase binary log size; STATEMENT is more compact but can cause issues with nondeterministic functions ✓ Correct
  • C STATEMENT format is always preferred for replication in production environments due to superior performance
  • D ROW format prevents all replication errors while STATEMENT format allows inconsistencies between master and slave
Explanation

ROW format logs actual row changes, ensuring consistency but using more space. STATEMENT logs SQL statements, risking issues with NOW(), RAND(), etc. Mixed format combines both approaches.

Q22 Medium

Which statement accurately describes the relationship between the general query log and performance impact?

  • A Enabling the general query log can significantly impact performance due to disk I/O overhead and should only be used for debugging ✓ Correct
  • B The general query log is automatically optimized to have no measurable performance impact in MySQL 5.7+
  • C The general query log only impacts performance when combined with binary logging enabled
  • D The general query log has negligible performance impact and should always be enabled
Explanation

The general query log logs all queries, causing substantial performance overhead. It should only be enabled temporarily for specific troubleshooting, not in normal production use.

Q23 Medium

In the context of MySQL user management, what is the primary security difference between host wildcards (%) and specific IP addresses?

  • A There is no security difference; both methods are equally secure when passwords are strong
  • B Specific IPs require additional authentication steps while wildcards bypass login requirements
  • C Using % allows any host to connect, while specific IPs restrict access to defined locations, implementing the principle of least privilege ✓ Correct
  • D Wildcards provide encryption while specific IPs do not
Explanation

Using specific IP addresses instead of % (wildcard) follows the principle of least privilege, restricting database access only to necessary hosts and reducing unauthorized access risk.

Q24 Hard

What is the impact of setting innodb_flush_log_at_trx_commit = 2 on data safety and performance?

  • A Offers good performance by flushing logs to OS cache at commit, but risks data loss if OS crashes; less safe than mode 1 ✓ Correct
  • B Provides the best performance with minimal durability guarantees suitable only for non-critical systems
  • C Is identical in behavior to mode 0 and provides no meaningful performance benefit
  • D Provides maximum durability with full ACID compliance but with maximum performance cost
Explanation

Mode 2 flushes logs to OS cache at commit, providing good performance. However, if the OS crashes before flushing cache to disk, committed transactions may be lost. Mode 1 is safest.

Q25 Hard

Which command combination is necessary to safely backup a running MySQL database while ensuring consistent snapshots for InnoDB tables?

  • A SELECT * FROM INFORMATION_SCHEMA.TABLES; FLUSH TABLES;
  • B LOCK TABLES; SHOW ENGINE INNODB STATUS; mysqlcheck --all-databases;
  • C mysqldump --all-databases --single-transaction --master-data ✓ Correct
  • D FLUSH LOGS; SHOW MASTER STATUS; cp -r /var/lib/mysql /backup/
Explanation

mysqldump with --single-transaction creates a consistent snapshot using REPEATABLE READ isolation without locking tables. The --master-data option records binary log position for PITR.

Q26 Medium

What is the purpose of the CHANGE MASTER TO command in MySQL replication setup?

  • A It backs up the master's binary logs for disaster recovery purposes
  • B It configures connection parameters on a slave to establish replication from a specific master ✓ Correct
  • C It synchronizes the slave's data with the master's current state immediately
  • D It permanently changes the master server's configuration to accept new slaves
Explanation

CHANGE MASTER TO on a slave configures the master's hostname, port, credentials, binary log file, and position, establishing the replication connection parameters without immediately starting replication.

Q27 Easy

Which MySQL storage engine is the default and provides ACID compliance?

  • A InnoDB ✓ Correct
  • B MyISAM
  • C Memory
  • D Archive
Explanation

InnoDB has been the default storage engine in MySQL since version 5.5 and provides full ACID (Atomicity, Consistency, Isolation, Durability) transaction support.

Q28 Medium

What is the maximum size of a single table in MySQL when using InnoDB storage engine with default settings?

  • A 64 GB
  • B 16 TB
  • C 2 GB
  • D Limited only by the file system ✓ Correct
Explanation

InnoDB tables can grow up to the limits imposed by the underlying file system, as each table is stored in separate files when using file-per-table settings.

Q29 Easy

Which command is used to display the current user and host connection information in MySQL?

  • A DISPLAY CURRENT USER;
  • B SHOW USER;
  • C SELECT CURRENT_USER();
  • D SELECT USER(); ✓ Correct
Explanation

Both SELECT USER() and SELECT CURRENT_USER() work, but USER() is the most commonly used function to display the current connected user and host.

Q30 Easy

What is the primary purpose of the mysql_secure_installation script?

  • A To optimize query performance and indexing strategies
  • B To automatically backup all databases to an external storage system
  • C To improve MySQL security by removing default test databases and anonymous accounts ✓ Correct
  • D To encrypt all database communications using SSL/TLS certificates
Explanation

The mysql_secure_installation script helps secure a MySQL installation by removing anonymous users, disabling remote root login, removing test databases, and setting a root password.

Q31 Medium

In MySQL, which of the following best describes the purpose of the innodb_buffer_pool_size parameter?

  • A Specifies the amount of memory allocated for temporary tables and sorting operations
  • B Sets the maximum query result size that can be returned to clients
  • C Defines the size of the memory pool used to cache InnoDB table data and index pages ✓ Correct
  • D Controls the maximum number of simultaneous client connections allowed
Explanation

innodb_buffer_pool_size is one of the most important InnoDB configuration parameters; it determines how much memory InnoDB uses to cache frequently accessed data and indexes.

Q32 Medium

Which privilege level in MySQL allows a user to perform operations on all databases?

  • A Database-level privileges
  • B Global privileges ✓ Correct
  • C Table-level privileges
  • D Column-level privileges
Explanation

Global privileges are the highest privilege level and grant permissions on all databases and tables in the MySQL server when assigned using the . syntax.

Q33 Medium

What does the FLUSH PRIVILEGES command do in MySQL?

  • A Encrypts all user passwords stored in the mysql.user table
  • B Reloads the grant tables from disk and updates user privileges in memory ✓ Correct
  • C Clears all cached query results from memory
  • D Removes all temporary privileges granted during the current session
Explanation

FLUSH PRIVILEGES reloads the privilege tables from disk, which is essential after directly modifying user permissions in the mysql database without using GRANT/REVOKE commands.

Q34 Medium

Which MySQL replication topology involves one master server replicating to multiple slave servers?

  • A One-to-many replication ✓ Correct
  • B Multi-source replication
  • C Circular replication
  • D Chain replication
Explanation

One-to-many (or master-to-slave) replication is the most common topology where a single master server replicates data to one or more slave servers.

Q35 Medium

What is the primary purpose of the MySQL binary log (binlog)?

  • A To store compressed versions of all database tables for space efficiency
  • B To record all data modification statements for replication and point-in-time recovery ✓ Correct
  • C To cache frequently executed queries to improve performance
  • D To maintain audit trails of all SELECT queries executed by users
Explanation

The binary log records all modifications to database data (INSERT, UPDATE, DELETE) and is essential for both replication and point-in-time recovery operations.

Q36 Hard

When performing a full backup using mysqldump with the --all-databases option, which of the following is NOT typically backed up?

  • A Triggers and views from all databases
  • B Stored procedures and functions
  • C User accounts and privileges from the mysql database
  • D Server-level configuration parameters from my.cnf ✓ Correct
Explanation

mysqldump backs up database objects but not server configuration files (my.cnf); configuration parameters must be backed up separately by copying the configuration files.

Q37 Medium

Which of the following describes the primary difference between a logical backup and a physical backup in MySQL?

  • A Physical backups are faster but require more storage space than logical backups
  • B Physical backups can only be restored to the same MySQL version while logical backups are version-agnostic
  • C Logical backups are point-in-time and physical backups are full snapshots only
  • D Logical backups use SQL statements while physical backups copy raw database files directly ✓ Correct
Explanation

Logical backups (like mysqldump output) contain SQL statements that recreate data, while physical backups copy the actual database files directly from disk.

Q38 Hard

What is the significance of the Master_Log_File and Read_Master_Log_Pos values in SHOW SLAVE STATUS output?

  • A They represent the current replication lag in seconds between master and slave
  • B They show which binary log file and position the slave has read up to from the master ✓ Correct
  • C They display the backup file and position used for slave initialization
  • D They indicate which binary log file and position the slave is currently writing to
Explanation

Master_Log_File and Read_Master_Log_Pos indicate the binary log file and position that the slave I/O thread has read from the master, not necessarily what has been applied yet.

Q39 Medium

In MySQL, which system variable controls the maximum allowed packet size for communication between client and server?

  • A max_connections
  • B max_packet_size
  • C net_buffer_length
  • D max_allowed_packet ✓ Correct
Explanation

The max_allowed_packet variable sets the maximum packet size for both client-to-server and server-to-client communication, and must match between server and clients.

Q40 Hard

What is the primary advantage of using partitioning on a large MySQL table?

  • A It eliminates the need for indexes on partitioned tables
  • B It provides automatic data compression and encryption across all partitions
  • C It automatically increases query performance for all SELECT statements without exception
  • D It allows distributing data across multiple physical files and improves query performance on large datasets through partition pruning ✓ Correct
Explanation

Table partitioning distributes data across multiple physical files based on a partition key and enables partition pruning, where the optimizer eliminates unnecessary partitions from query execution.

Q41 Medium

Which of the following is NOT a valid partitioning type in MySQL?

  • A RANGE partitioning
  • B HASH partitioning
  • C SEQUENTIAL partitioning ✓ Correct
  • D KEY partitioning
Explanation

MySQL supports RANGE, HASH, KEY, and LIST partitioning types; SEQUENTIAL partitioning does not exist in MySQL partitioning mechanisms.

Q42 Hard

What does the innodb_flush_log_at_trx_commit parameter control?

  • A The compression level applied to transaction logs before they are archived
  • B The size of the InnoDB redo log files before automatic rotation happens
  • C The number of concurrent transactions that can be active before forced flushing occurs
  • D The frequency at which the InnoDB redo log is flushed to disk in relation to transaction commits ✓ Correct
Explanation

innodb_flush_log_at_trx_commit determines when the InnoDB redo log is flushed to disk: value 0 flushes every second, 1 flushes at each commit, and 2 flushes every second but not on commit.

Q43 Easy

Which MySQL user account is created by default and typically has unrestricted privileges on the server?

  • A operator
  • B guest
  • C admin
  • D root ✓ Correct
Explanation

The root user is the default administrative account created during MySQL installation with full privileges on all databases; this account should be secured with a strong password.

Q44 Medium

What is the purpose of the slow query log in MySQL?

  • A To record all queries that take longer than a specified threshold for performance analysis ✓ Correct
  • B To prevent slow queries from executing on the server automatically
  • C To encrypt all database communications and slow down insecure connections
  • D To cache slow queries and serve results from cache on subsequent requests
Explanation

The slow query log records queries that exceed the time specified in long_query_time, helping administrators identify and optimize inefficient queries.

Q45 Hard

In MySQL replication, what does the Relay_Log_Pos value in SHOW SLAVE STATUS represent?

  • A The number of bytes transferred through the replication channel in the current session
  • B The position in the slave's relay log that the SQL thread has executed up to ✓ Correct
  • C The binary log position on the slave server used for cascading replication
  • D The current position in the master's binary log that the slave is reading
Explanation

Relay_Log_Pos shows how far the SQL thread has progressed in executing the relay log, indicating which events have been applied to the slave database.

Q46 Medium

Which command is used to create a new user account in MySQL with specific database privileges?

  • A CREATE USER followed by GRANT
  • B GRANT can be used directly to create a user if it doesn't exist
  • C INSERT INTO mysql.user followed by FLUSH PRIVILEGES
  • D Both CREATE USER followed by GRANT and using GRANT directly are valid methods ✓ Correct
Explanation

While CREATE USER followed by GRANT is the modern approach, GRANT can also implicitly create a user in some MySQL configurations, making both methods valid.

Q47 Hard

What is the primary function of the innodb_autoinc_lock_mode parameter?

  • A It manages the cache size for storing auto-increment values in memory
  • B It controls the automatic locking of tables during INSERT operations
  • C It sets the starting value for auto-increment sequences in new tables
  • D It determines the locking mechanism used for AUTO_INCREMENT column generation ✓ Correct
Explanation

innodb_autoinc_lock_mode controls how InnoDB locks and generates AUTO_INCREMENT values: 0 (traditional), 1 (consecutive), or 2 (interleaved) modes.

Q48 Hard

Which of the following best describes the purpose of the MySQL GTID (Global Transaction ID)?

  • A To encrypt sensitive transactions and prevent unauthorized replication
  • B To compress transaction logs and reduce storage requirements
  • C To automatically balance query load across multiple slave servers
  • D To identify and track each transaction globally across replication topology enabling easier troubleshooting ✓ Correct
Explanation

GTID provides a unique identifier for each transaction across the entire replication topology, simplifying replication management and enabling safe failover scenarios.

Q49 Medium

In MySQL, which of the following statements about the information_schema database is correct?

  • A It contains user data and should be backed up regularly like other databases
  • B It is a virtual database that provides metadata about all other databases and tables without storing persistent data ✓ Correct
  • C It is specific to InnoDB storage engine and not available for MyISAM tables
  • D It stores all server configuration parameters and cannot be modified directly
Explanation

information_schema is a virtual database that provides real-time metadata about database objects; it doesn't store persistent data and is generated dynamically.

Q50 Hard

What is the main difference between using WHERE clause filtering versus partition pruning for query optimization?

  • A Partition pruning only works on numeric columns while WHERE filtering works on all data types
  • B Partition pruning requires indexes but WHERE filtering does not
  • C WHERE filtering is applied on the client side while partition pruning happens on the server
  • D WHERE filtering happens after all data is read while partition pruning eliminates partitions before reading data ✓ Correct
Explanation

Partition pruning is a query optimization technique where the optimizer determines which partitions contain relevant data and eliminates others before execution, while WHERE filtering processes rows after retrieval.

Q51 Medium

You are tasked with improving query performance on a large table with millions of rows. After analyzing slow query logs, you notice that a frequently executed query is performing a full table scan. What is the MOST appropriate first step to address this issue?

  • A Enable query result caching to avoid redundant executions
  • B Create a composite index on the columns used in the WHERE clause and JOIN conditions ✓ Correct
  • C Increase the innodb_buffer_pool_size to cache more data in memory
  • D Rewrite the query to use subqueries instead of JOINs
Explanation

Creating appropriate indexes on columns used in WHERE clauses and JOINs is the fundamental technique to avoid full table scans. While buffer pool size and query caching can help, they do not address the root cause of inefficient query execution plans.

Q52 Easy

A MySQL instance is running with the default storage engine. You need to ensure ACID compliance and support for foreign keys. Which storage engine should you verify is being used for your tables?

  • A MyISAM
  • B Memory
  • C InnoDB ✓ Correct
  • D CSV
Explanation

InnoDB is the only standard MySQL storage engine that provides ACID compliance and enforces foreign key constraints. MyISAM does not support transactions or foreign keys, while Memory and CSV have other significant limitations.

Q53 Hard

You are implementing a backup strategy for a business-critical MySQL database. The requirements state that recovery point objective (RPO) must be less than 5 minutes. Which backup approach would BEST meet this requirement while maintaining reasonable backup storage costs?

  • A Weekly full backups with daily incremental backups and binary log retention
  • B Daily full backups combined with continuous binary log archival and point-in-time recovery capability ✓ Correct
  • C Real-time replication to a standby server with binary logs disabled for performance
  • D Hourly full backups stored to local disk with no binary logs
Explanation

Combining daily full backups with binary log archival allows recovery to any point within the last 5 minutes (or longer depending on log retention), meeting the RPO requirement cost-effectively. Weekly backups cannot meet a 5-minute RPO, hourly full backups are expensive, and disabling binary logs eliminates point-in-time recovery.

Q54 Medium

During a security audit, you discover that user accounts are created with overly permissive global privileges. You need to restrict a user named 'webapp' to only SELECT and INSERT operations on the 'sales' database. What is the correct approach?

  • A ALTER USER 'webapp'@'localhost' REQUIRE SSL; GRANT SELECT, INSERT ON sales.* TO 'webapp'@'localhost';
  • B REVOKE ALL PRIVILEGES ON *.* FROM 'webapp'@'localhost'; GRANT SELECT, INSERT ON sales.* TO 'webapp'@'localhost'; ✓ Correct
  • C GRANT SELECT, INSERT ON sales.* TO 'webapp'@'localhost'; REVOKE ALL PRIVILEGES ON *.* FROM 'webapp'@'localhost';
  • D DROP USER 'webapp'@'localhost'; CREATE USER 'webapp'@'localhost' IDENTIFIED BY 'password'; GRANT SELECT, INSERT ON sales.* TO 'webapp'@'localhost';
Explanation

The correct approach is to first REVOKE all global privileges, then GRANT only the specific privileges needed on the specific database. Option B reverses the order, which is less effective, while options C and D are either unnecessary or incomplete.

Q55 Medium

A production database experiences unpredictable latency spikes every few hours. Monitoring shows that InnoDB buffer pool usage remains high and stable. Which diagnostic step would MOST likely identify the root cause?

  • A Review SHOW PROCESSLIST output to examine table locks and long-running transactions during baseline and spike periods
  • B Increase innodb_buffer_pool_size by 50% and monitor whether spikes continue
  • C All of the above are equally important and should be performed simultaneously
  • D Check the slow query log to identify patterns in query execution times during spike periods ✓ Correct
Explanation

The slow query log directly captures queries executing slower than the configured threshold, making it ideal for correlating performance spikes with specific queries. While PROCESSLIST and buffer pool analysis can be useful, the slow query log provides the most direct evidence of problematic query patterns during spikes.

Q56 Hard

You are implementing replication for a large MySQL database with multiple terabytes of data. The source server experiences significant load during binary log creation. Which replication feature could reduce the I/O impact on the source?

  • A Using binlog_row_image=MINIMAL to reduce binary log file sizes ✓ Correct
  • B Enabling parallel replication with slave_parallel_workers=8
  • C Configuring the replica with read_only=ON to prevent accidental writes
  • D Increasing binlog_cache_size to buffer more events before flushing to disk
Explanation

Setting binlog_row_image=MINIMAL reduces the amount of data written to binary logs by only recording columns that changed, decreasing I/O on the source. Parallel replication affects replica apply speed, not source load; read_only is a safety measure; and binlog_cache_size buffers in memory but doesn't reduce actual disk writes.

Q57 Medium

A DBA needs to maintain the data dictionary while performing maintenance on a production MySQL 8.0 instance. Which statement accurately describes the characteristics of the MySQL data dictionary?

  • A The data dictionary is stored in the InnoDB system tablespace and is automatically maintained as part of transaction logging ✓ Correct
  • B The data dictionary is stored in MyISAM tables and can be backed up separately from InnoDB tables
  • C The data dictionary requires manual synchronization with the file system using the REBUILD DICTIONARY command
  • D The data dictionary is a read-only resource that cannot be modified after initial database creation
Explanation

In MySQL 8.0+, the data dictionary is stored in the InnoDB system tablespace and is automatically maintained as changes occur. It is not in MyISAM, does not require manual rebuild commands, and is definitely modifiable when schema changes occur.

Q58 Hard

You are analyzing a database with mixed transaction sizes and notice that small, frequent transactions are performing poorly due to lock contention. Which MySQL feature is specifically designed to reduce lock contention for such workloads?

  • A InnoDB intrinsic locks which provide row-level locking without overhead of traditional locks ✓ Correct
  • B Using the READ UNCOMMITTED isolation level to minimize locking requirements
  • C Transaction isolation level SERIALIZABLE for explicit locking strategies
  • D Reducing innodb_lock_wait_timeout to fail fast on contention
Explanation

InnoDB intrinsic locks are optimized for scenarios with high lock contention by using efficient internal locking mechanisms. SERIALIZABLE increases contention, changing timeout settings doesn't reduce contention, and READ UNCOMMITTED creates consistency problems rather than solving performance issues.

Q59 Medium

During a capacity planning meeting, the team discusses implementing automated backups. One proposal suggests using mysqldump with the --single-transaction option. What is the primary advantage of this option for InnoDB tables?

  • A It allows parallel backup of multiple tables simultaneously to improve backup speed
  • B It creates a backup without needing to acquire table locks, using InnoDB's MVCC capability ✓ Correct
  • C It prevents other connections from performing INSERT and UPDATE operations during the backup
  • D It enables compression of the backup file to reduce storage requirements
Explanation

The --single-transaction option leverages InnoDB's Multi-Version Concurrency Control (MVCC) to create a consistent backup without acquiring locks, allowing normal operations to continue. It does not compress data, does not enable parallel backup natively, and specifically avoids blocking writes.

Q60 Medium

A MySQL database administrator suspects that connections are not being properly cleaned up, leading to resource exhaustion. The administrator needs to identify idle connections consuming resources. Which command or approach would be MOST appropriate for this diagnostic task?

  • A Execute KILL CONNECTION for all processes running longer than 60 seconds regardless of activity status
  • B Enable general query log and parse for gaps in activity to identify idle periods for each connection
  • C Use SHOW PROCESSLIST to identify connections with long idle time and review the Command column for 'Sleep' status ✓ Correct
  • D Configure max_connections to automatically terminate idle connections after a specified timeout period
Explanation

SHOW PROCESSLIST displays all connections with their status and idle time; connections showing 'Sleep' command are idle. Option B would kill active long-running queries; option C is inefficient; option D doesn't automatically terminate idle connections without additional configuration like the interactive_timeout variable.

Ready to test your knowledge?

You've reviewed all 60 questions. Take the interactive practice exam to simulate the real test environment.

▶ Start Practice Exam — Free