Quick Revision

GK One-Line Question & Answer

15541+ short questions with short answers, covering every category and sub-category on the site — no long articles to scroll through. Good for a fast recap before an exam, or a few minutes of daily practice.

DBMS → Introduction to DBMS 34

Which is NOT a NoSQL database type
Relational table store
click to copy
MongoDB is an example of
Document store
click to copy
Redis is an example of
Key-value store (in-memory)
click to copy
Apache Cassandra is an example of
Wide-column (column-family) store
click to copy
Neo4j is an example of
Graph database
click to copy
BASE vs ACID: BASE stands for
Basically Available Soft-state Eventually consistent
click to copy
Which database property is BASE designed to relax compared to ACID
Strong Consistency for better availability and performance
click to copy
CAP theorem P stands for
Partition tolerance: system continues operating despite network partitions
click to copy
MongoDB vs MySQL: key structural difference
MongoDB: schema-less documents; MySQL: fixed-schema tables
click to copy
Which SQL command imports a SQL dump file in MySQL command line
mysql -u user -p database < dump.sql
click to copy
mysqldump command creates
A SQL dump file with CREATE TABLE and INSERT statements
click to copy
Which SQL shows all indexes on the questions table in MySQL
SHOW INDEX FROM questions
click to copy
CHECK TABLE questions in MySQL performs
Checks table for errors or corruption
click to copy
OPTIMIZE TABLE questions in MySQL
Defragments the table and updates statistics for better performance
click to copy
ANALYZE TABLE questions in MySQL
Analyzes and stores key distribution statistics for the optimizer
click to copy
MyISAM vs InnoDB: key difference
InnoDB supports transactions and FK; MyISAM does not (faster for read-heavy workloads)
click to copy
Row-level locking in InnoDB vs table-level locking in MyISAM
Row-level allows higher concurrency for writes; table-level blocks entire table
click to copy
Which MySQL data type stores IPv4 addresses efficiently
INT UNSIGNED (use INET_ATON/INET_NTOA for conversion)
click to copy
ENUM vs SET in MySQL: difference
ENUM: stores one value from list; SET: stores one or more values from list
click to copy
Which stores multiple selected values in one column
SET
click to copy
JSON column in MySQL 5.7+ allows
Binary JSON with validation and JSON path queries
click to copy
MySQL -> operator on JSON column
Extracts a JSON value: col->'$.key'
click to copy
MySQL ->> operator on JSON column
Extracts JSON value as unquoted string (JSON_UNQUOTE(JSON_EXTRACT(...)))
click to copy
Which MySQL function checks if JSON value contains a path
JSON_CONTAINS_PATH(json,'one','$.path')
click to copy
Generated/Computed column in MySQL is
A virtual or stored column whose value derived from an expression
click to copy
Which SQL creates a virtual generated column for full name
ALTER TABLE emp ADD full_name VARCHAR(100) AS (CONCAT(first_name,' ',last_name)) VIRTUAL
click to copy
Common Table Expression (CTE) scope
Only within the single query that defines it
click to copy
SQL:2003 MERGE statement equivalent in MySQL
INSERT ... ON DUPLICATE KEY UPDATE
click to copy
INSERT IGNORE in MySQL
Silently skips rows that would cause unique constraint violations
click to copy
REPLACE INTO in MySQL
Deletes existing row then inserts new one if PK/unique key conflicts
click to copy
Which SQL checks if a table exists before creating it
CREATE TABLE IF NOT EXISTS questions (...)
click to copy
Which MySQL function returns the last auto-increment ID inserted
LAST_INSERT_ID()
click to copy
PHP PDO lastInsertId() in Laravel context (DB::getPdo()->lastInsertId()) returns
The auto-increment ID of the last inserted row
click to copy
DB::table('questions')->insertGetId(['question'=>'Q?',...]) returns
The auto-increment ID of the newly inserted row
click to copy

DBMS → Transactions 4

Which MySQL engine supports ACID transactions
InnoDB
click to copy
Which Laravel method handles database transactions
DB::transaction(callback)
click to copy
DB::beginTransaction() followed by DB::commit() vs DB::rollBack()
beginTransaction starts explicit transaction; commit saves; rollBack undoes all changes
click to copy
Which Laravel method retries a transaction on deadlock
DB::transaction(callback,3) - second param is number of retry attempts
click to copy

DBMS → Joins 1

Lateral join (LATERAL keyword) allows
Subquery in FROM to reference columns from preceding FROM items in same query
click to copy

DBMS → DDL Commands 1

DROP TABLE IF EXISTS questions
Drops table only if it exists (no error if it doesn't exist)
click to copy