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 37

External sort is needed when
Data too large for main memory - disk used for intermediate sorting
click to copy
Heap file stores records
In insertion order with no particular ordering
click to copy
Static hashing limitation is
Bucket overflow and degradation with data growth or shrinkage
click to copy
RAID 1 provides
Data mirroring full redundancy across two disks
click to copy
RAID 5 uses
Striping with distributed parity (can recover from one disk failure)
click to copy
A covering index
Satisfies query entirely from index without accessing base table
click to copy
Bitmap index is efficient for columns with
Low cardinality (few distinct values like gender, status)
click to copy
Function-based index allows
Indexing result of expression/function applied to columns
click to copy
Composite index on (A,B) benefits queries on
A alone OR A+B together (NOT B alone without A)
click to copy
REBUILD INDEX vs REORGANIZE: REBUILD
Drops and recreates the index completely eliminating all fragmentation
click to copy
Partial (filtered) index includes
Only rows satisfying a WHERE filter condition
click to copy
Sequential file organization
Stores records in sorted order based on key field
click to copy
Statistics in query optimizer are used to
Estimate data distribution and cardinality for cost estimation
click to copy
Pinning a buffer page means
Marking it as do-not-evict (currently in use)
click to copy
Multi-level index builds
Index on the index to reduce levels needed to find record
click to copy
Selectivity of a predicate is
Fraction of tuples satisfying the predicate (between 0 and 1)
click to copy
Equivalence rules in query optimization allow
Transforming one RA expression to another producing same result
click to copy
The iterator (volcano) model implements pipelining using
Open(), GetNext(), Close() interface on each operator
click to copy
Materialization in query processing
Fully computes and stores intermediate result before passing to next operator
click to copy
External sort complexity for n blocks, B buffer frames is approximately
O(n log_B n) passes
click to copy
ISAM supports
Both sequential access AND indexed access (but static overflow)
click to copy
Histogram in query optimizer stores
Distribution of attribute values for better cardinality estimation
click to copy
Why is sequential disk access faster than random?
No seek time or rotational latency between consecutive blocks
click to copy
Index seek vs index scan: index SEEK
Traverses B+tree to find specific key (fast for selective queries)
click to copy
Fill factor in index creation specifies
Percentage of each index page to fill leaving space for future inserts
click to copy
Linear hashing
Splits buckets incrementally in linear order without sudden doubling
click to copy
Extendible hashing solves static hashing by
Dynamically doubling directory size and splitting buckets as needed
click to copy
Double buffering allows
I/O of next block to overlap with CPU processing of current block
click to copy
The Selinger optimizer uses
Dynamic programming to find optimal join ordering with estimated costs
click to copy
Laravel Eloquent is
ORM using Active Record pattern mapping tables to PHP classes
click to copy
php artisan make:model Question creates
New Eloquent model class in app/Models
click to copy
Eloquent assumes table name is
Plural snake_case of model (User→users, Question→questions)
click to copy
To override Eloquent table name
Set protected $table = 'custom_name'
click to copy
Question::all() returns
Collection of all Question model instances
click to copy
Question::find(1) returns
Question with PK=1 or NULL if not found
click to copy
findOrFail($id) when ID not found
Throws ModelNotFoundException
click to copy
Eager loading with('posts') prevents
N+1 query problem by loading related models in 2 queries instead of N+1
click to copy

DBMS → Indexes 1

In B+ tree all data records are stored at
Leaf nodes
click to copy

DBMS → Joins 1

A left-deep join tree has
All inner (right) inputs as base tables
click to copy

DBMS → Relational Model 1

Primary key in MySQL InnoDB automatically creates
Clustered index
click to copy