Pick a topic — languages & databases — 100+ questions and answers in the center column.
MySQL
InnoDB, replication, binlog, JSON, and ops topics.
102 questions
Question 1
Popular open-source relational database (Oracle-owned). Known for InnoDB storage engine, replication, and wide hosting support—common LAMP stack component.
Example code
SELECT VERSION()Question 2
InnoDB is default: ACID transactions, row locks, foreign keys, crash recovery. MyISAM is table-level locks, no FK—legacy; avoid for new apps.
Example code
SHOW ENGINESQuestion 3
InnoDB caches data and index pages in memory—tune innodb_buffer_pool_size to fit hot working set on dedicated DB servers.
Example code
SHOW VARIABLES LIKE 'innodb_buffer_pool_size'Question 4
Primary key defines clustered index order; secondary indexes leaf nodes store PK values—choose short selective PKs (often surrogate int or UUID strategy).
Example code
CREATE TABLE t (id INT PRIMARY KEY) ENGINE=InnoDBQuestion 5
Monotonic per table; gaps after rollback/insert failure are normal; LAST_INSERT_ID() for connection-scoped last value.
Example code
SELECT LAST_INSERT_ID()Question 6
Source writes binary log (row or statement format); replicas apply relay logs—async by default; replication lag is real.
Example code
SHOW BINARY LOG STATUSQuestion 7
Global transaction IDs simplify failover and consistency tracking across topology—recommended for managed HA setups.
Example code
SELECT @@gtid_modeQuestion 8
Source waits for at least one replica ack before commit—reduces data loss risk vs pure async at latency cost.
Example code
SET rpl_semi_sync_master_enabled = 1Question 9
Logical change log for replication and PITR—row-based safer for non-deterministic statements; statement-based can be smaller.
Example code
SHOW BINLOG EVENTS LIMIT 5Question 10
Redo replays committed changes after crash; undo powers rollback and MVCC consistent reads—both central to InnoDB durability.
Example code
-- redo/undo handled by InnoDB internallyQuestion 11
Consistent non-locking reads use snapshot—READ COMMITTED vs REPEATABLE READ differ in what snapshot you see; phantom reads handled with next-key locks in RR.
Example code
SELECT @@transaction_isolationQuestion 12
REPEATABLE READ default in InnoDB—gap/next-key locking can cause unexpected lock waits vs READ COMMITTED tradeoffs.
Example code
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTEDQuestion 13
innodb_lock_wait_timeout—tune and handle errors; investigate slow queries and lock order to reduce deadlocks.
Example code
SHOW ENGINE INNODB STATUSQuestion 14
EXPLAIN ANALYZE executes query (8.0.18+)—shows actual vs estimated rows; traditional EXPLAIN for plan shape.
Example code
EXPLAIN FORMAT=TREE SELECT * FROM t WHERE id=1Question 15
Extra Using index in EXPLAIN—index alone satisfies query; watch select * defeating covering.
Example code
EXPLAIN SELECT * FROM t WHERE a=1 AND b=2Question 16
JSON type with functions JSON_EXTRACT, -> operator—functional indexes on expressions (8.0+) help filter paths.
Example code
SELECT JSON_EXTRACT(doc,'$.x') FROM tQuestion 17
FULLTEXT index with MATCH…AGAINST—InnoDB supported; tune ft_min_word_len; not a Google-scale search engine.
Example code
SELECT * FROM articles WHERE MATCH(title) AGAINST('sql')Question 18
Strictness flags—ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES affect silent truncation and GROUP BY compliance.
Example code
SET sql_mode = 'STRICT_TRANS_TABLES'Question 19
utf8mb4 for full Unicode including emoji; collation affects sort/compare—consistency across columns and connections.
Example code
SET NAMES utf8mb4Question 20
Server-side prepares reduce parse cost; drivers use them for injection safety—watch prepare threshold in pools.
Example code
PREPARE s FROM 'SELECT * FROM t WHERE id=?'Question 21
Each connection uses memory—size pool * instances below server limit; monitor Threads_connected.
Example code
SHOW STATUS LIKE 'Threads_connected'Question 22
Log queries exceeding long_query_time—feed to pt-query-digest or performance_schema for tuning.
Example code
SET GLOBAL slow_query_log = ONQuestion 23
Low-level instrumentation—consumer tables for waits, stages, statements; overhead manageable with selective enabling.
Example code
SELECT * FROM performance_schema.events_statements_summaryQuestion 24
8.0+ transactional DD in InnoDB tables—atomic DDL; backup tools must understand new metadata layout.
Example code
SELECT * FROM information_schema.tablesQuestion 25
ALGORITHM=INPLACE, LOCK=NONE where supported—still can stall; test on clones; some ops require rebuild.
Example code
ALTER TABLE t ALGORITHM=INPLACE, LOCK=NONE ADD COLUMN x INTQuestion 26
RANGE/LIST/HASH/KEY—partition pruning helps scans; many restrictions on FKs and unique keys across partitions.
Example code
ALTER TABLE t PARTITION BY RANGE (YEAR(d)) (...)Question 27
PROCEDURE/FUNCTION with SQL or pluggable languages—version in source control; harder to test than app code.
Example code
DELIMITER //
CREATE PROCEDURE p() BEGIN END//Question 28
BEFORE/AFTER insert/update/delete—hidden logic; replication implications with statement vs row binlog.
Example code
CREATE TRIGGER tr BEFORE INSERT ON t FOR EACH ROW SET NEW.x=1Question 29
Two-phase commit across resources—rare in app code; understand timeout and recovery stories.
Example code
XA START 'xid'; XA END 'xid'; XA PREPARE 'xid'Question 30
Built-in multi-primary or single-primary cluster with consensus—InnoDB Cluster tooling wraps it.
Example code
SELECT * FROM performance_schema.replication_group_membersQuestion 31
Admin CLI for provisioning HA—alternative to external orchestrators for many teams.
Example code
mysqlsh --jsQuestion 32
mysqldump logical portable slow restore; Percona XtraBackup physical fast—need consistent snapshots for InnoDB.
Example code
mysqldump --single-transaction db > dump.sqlQuestion 33
Restore full backup then mysqlbinlog apply events to target time—requires intact binlog chain.
Example code
mysqlbinlog binlog.000001 | headQuestion 34
CREATE USER + GRANT—roles (8.0) simplify bundles; principle of least privilege.
Example code
CREATE USER 'app'@'%' IDENTIFIED BY '***'Question 35
caching_sha2_password default in 8.0—clients must support; mysql_native_password legacy.
Example code
ALTER USER 'u' IDENTIFIED WITH caching_sha2_password BY '***'Question 36
8.0 CPU affinity for threads—advanced tuning for mixed workloads.
Example code
CREATE RESOURCE GROUP rg TYPE = USER VCPU = 0-1Question 37
8.0 columns skipped for SELECT * unless named—migration helper patterns.
Example code
ALTER TABLE t ADD COLUMN opt INT INVISIBLEQuestion 38
HeatWave is Oracle analytics acceleration; Aurora/RDS are managed deployments—operational features differ from vanilla.
Example code
-- HeatWave / Aurora: managed deployment notesQuestion 39
Low-level ISAM-style row API—niche; prefer normal SQL.
Example code
-- MySQL: HANDLER interface
SELECT 1Question 40
Remote table proxy—legacy; not for production HA.
Example code
-- MySQL: Federated engine
SELECT 1Question 41
Accepts writes discards data—useful for replication filter testing only.
Example code
-- MySQL: Blackhole engine
SELECT 1Question 42
Compressed append-only—warehouse niche, not general OLTP.
Example code
-- MySQL: Archive engine
SELECT 1Question 43
MySQL Cluster distributed engine—different operational model from InnoDB replicas.
Example code
-- MySQL: NDB Cluster
SELECT 1Question 44
Drop-in fork with extra instrumentation and features—check compatibility with your version.
Example code
-- MySQL: Percona Server
SELECT 1Question 45
Fork with different optimizers and features—test migrations both directions.
Example code
-- MySQL: MariaDB divergence
SELECT 1Question 46
/*+ INDEX() */ comment style—use sparingly when stats cannot be fixed.
Example code
-- MySQL: Optimizer hints
SELECT 1Question 47
Union/intersect multiple indexes—sometimes planner choice; composite index may be better.
Example code
-- MySQL: Index merge
SELECT 1Question 48
Filters applied in storage layer using index—reduces row lookups.
Example code
-- MySQL: ICP (index condition pushdown)
SELECT 1Question 49
Batches random PK lookups into ordered ranges—reduces disk seeks.
Example code
-- MySQL: MRR (multi-range read)
SELECT 1Question 50
Join optimization using MRR—EXPLAIN may show BKA.
Example code
-- MySQL: Batched key access
SELECT 1Question 51
Optimizer flattens subqueries into joins—behavior version-dependent.
Example code
-- MySQL: Derived merge
SELECT 1Question 52
MEMORY limit exceeded or BLOB columns—watch Created_tmp_disk_tables status.
Example code
-- MySQL: Temp table on disk
SELECT 1Question 53
ORDER BY without suitable index may filesort—limit sort sizes.
Example code
-- MySQL: Sort merge vs filesort
SELECT 1Question 54
Block nested loop uses join_buffer_size when no index—can hide missing indexes temporarily.
Example code
-- MySQL: Join buffer
SELECT 1Question 55
Large inserts or blobs need limit raised consistently client and server.
Example code
-- MySQL: max_allowed_packet
SELECT 1Question 56
Idle connection kill—align with pool idle eviction.
Example code
-- MySQL: wait_timeout
SELECT 1Question 57
Separate timeout for interactive clients—session tools vs apps.
Example code
-- MySQL: interactive_timeout
SELECT 1Question 58
Durability vs performance knob—=1 safest sync redo each commit; =2 OS buffer risk on power loss.
Example code
-- MySQL: innodb_flush_log_at_trx_commit
SELECT 1Question 59
Binlog durability frequency—1 safest for crash; higher throughput with risk.
Example code
-- MySQL: sync_binlog
SELECT 1Question 60
InnoDB torn page protection—disable only expert benchmarking.
Example code
-- MySQL: doublewrite buffer
SELECT 1Question 61
Caches secondary index changes when pages not in buffer pool—speeds mixed workloads.
Example code
-- MySQL: change buffer
SELECT 1Question 62
In-memory hash for hot B-tree pages—sometimes disable on high-contention benchmarks.
Example code
-- MySQL: adaptive hash index
SELECT 1Question 63
innodb_page_size rarely changed—plan at provisioning for large rows.
Example code
-- MySQL: page size
SELECT 1Question 64
Transparent page compression—CPU cost; test with realistic data entropy.
Example code
-- MySQL: compression
SELECT 1Question 65
Keyring plugins—manage key rotation and backups carefully.
Example code
-- MySQL: encryption at rest
SELECT 1Question 66
Enterprise or Percona audit—who changed what for compliance.
Example code
-- MySQL: audit plugin
SELECT 1Question 67
Query allowlists—defense in depth vs app bugs.
Example code
-- MySQL: Firewall / Enterprise proxy
SELECT 1Question 68
Connection multiplexing and query routing—sharding and read/write split helper.
Example code
-- MySQL: Router / ProxySQL
SELECT 1Question 69
Async replica lag—sticky sessions or version tokens for UX.
Example code
-- MySQL: Read-after-write consistency
SELECT 1Question 70
Multi-source topology risks conflicts—avoid without discipline.
Example code
-- MySQL: Circular replication
SELECT 1Question 71
Replicate-do-db rules—easy to misconfigure partial replication.
Example code
-- MySQL: Binlog filters
SELECT 1Question 72
Legacy lag metric—use performance_schema replication tables in 8.0.
Example code
-- MySQL: Seconds_behind_master
SELECT 1Question 73
8.0 fast physical clone for replicas—great for provisioning.
Example code
-- MySQL: Clone plugin
SELECT 1Question 74
SET PERSIST survives restart—document server config as code.
Example code
-- MySQL: Persisted variables
SELECT 1Question 75
8.0 modular logging/auth—replace some plugin architecture.
Example code
-- MySQL: Component services
SELECT 1Question 76
Apply threads must preserve commit order—throughput vs consistency settings.
Example code
-- MySQL: Replica parallel workers
SELECT 1Question 77
Reduce network IO replication—CPU tradeoff on both ends.
Example code
-- MySQL: Binlog transaction compression
SELECT 1Question 78
8.0 fine-grained privilege subtraction—layered security models.
Example code
-- MySQL: Partial revokes
SELECT 1Question 79
Rotate credentials without downtime—two active passwords transitional.
Example code
-- MySQL: Dual passwords
SELECT 1Question 80
Not a substitute for binding parameters—WAF last line.
Example code
-- MySQL: Firewall for SQL injection
SELECT 1Question 81
Integration tests with real engine—CI resource cost vs mocks.
Example code
-- MySQL: Testcontainers MySQL
SELECT 1Question 82
Bind mount data dir—watch file permissions and SELinux.
Example code
-- MySQL: Docker MySQL volume
SELECT 1Question 83
StatefulSet + PVC—pod identity and storage class matter for InnoDB.
Example code
-- MySQL: Kubernetes operator
SELECT 1Question 84
Built-in load generator—quick sanity benchmarks.
Example code
-- MySQL: mysqlslap
SELECT 1Question 85
8.0 helper views wrapping performance_schema—easier diagnostics.
Example code
-- MySQL: sys schema
SELECT 1Question 86
Prevent accidental writes on replicas—including SUPER users—during failover.
Example code
-- MySQL: super_read_only
SELECT 1Question 87
Server-level block non-SUPER writes—pair with replica promotion procedures.
Example code
-- MySQL: read_only mode
SELECT 1Question 88
Replica-side buffered binlog events—disk space and corruption recovery matter.
Example code
-- MySQL: relay log
SELECT 1Question 89
DATABASE vs LOGICAL_CLOCK—throughput vs ordering for parallel apply.
Example code
-- MySQL: slave_parallel_type
SELECT 1Question 90
Commits on replica match source order—needed for some consistency models.
Example code
-- MySQL: slave_preserve_commit_order
SELECT 1Question 91
FULL vs MINIMAL—storage and replication bandwidth tradeoffs.
Example code
-- MySQL: binlog_row_image
SELECT 1Question 92
ROW vs STATEMENT vs MIXED—consistency vs volume; ROW default modern best practice.
Example code
-- MySQL: binlog_format
SELECT 1Question 93
Historical throttle—usually 0 unlimited on modern InnoDB.
Example code
-- MySQL: innodb_thread_concurrency
SELECT 1Question 94
Flash vs HDD flush rates—tune for SSD write endurance and latency.
Example code
-- MySQL: innodb_io_capacity
SELECT 1Question 95
Large redo logs reduce checkpoint churn—balance recovery time.
Example code
-- MySQL: innodb_log_file_size
SELECT 1Question 96
SSD usually off—avoid extra writes on SSD media.
Example code
-- MySQL: innodb_flush_neighbors
SELECT 1Question 97
File descriptors for open tables—raise for many-table workloads.
Example code
-- MySQL: table_open_cache
SELECT 1Question 98
Cached table metadata—large schemas need bumps.
Example code
-- MySQL: table_definition_cache
SELECT 1Question 99
Avoid reverse DNS on connect—faster safer in LAN with IP grants.
Example code
-- MySQL: skip_name_resolve
SELECT 1Question 100
8.0 password policy plugin—enterprise compliance.
Example code
-- MySQL: validate_password component
SELECT 1Question 101
In-place server upgrade assist—follow Oracle upgrade docs.
Example code
-- MySQL: clone for upgrade
SELECT 1Question 102
Store login paths securely—less .my.cnf plaintext.
Example code
-- MySQL: mysql_config_editor
SELECT 1