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 → Relational Model 28

What is the formal definition of functional dependency?
A constraint X determines Y where for any two tuples with the same X value they must also have the same Y value (X functionally determines Y)
click to copy
What is an update anomaly in an unnormalized relation?
Changing a fact stored in multiple redundant rows requiring all rows to be updated simultaneously with inconsistency resulting if any update is missed
click to copy
What is domain-key normal form (DKNF) and why is it considered the ultimate normal form?
A normal form where every constraint is a logical consequence of domain constraints and key constraints guaranteeing freedom from all modification anomalies
click to copy
In relational algebra what does the division operator compute?
Given relations R(A,B) and S(B), produces tuples from R[A] that are associated with ALL tuples in S - used for for-all type queries
click to copy
What is BCNF and how is it stronger than 3NF?
BCNF requires that for every non-trivial FD X to Y, X must be a superkey (no exceptions) while 3NF allows Y to be a prime attribute as an exception
click to copy
What are Armstrongs Axioms and what are the three primary rules?
A set of sound and complete inference rules for FDs: Reflexivity (if Y is subset of X then X determines Y), Augmentation (if X determines Y then XZ determines YZ), and Transitivity (if X determines Y and Y determines Z then X determines Z)
click to copy
In relational algebra the natural join differs from equi-join in that:
Natural join automatically joins on all common attribute names and eliminates duplicate columns; equi-join requires explicit equality conditions and may keep duplicate columns
click to copy
What is a multivalued dependency (MVD) in the relational model?
In a relation R(X,Y,Z), X multidetermines Y means that for a given X value the set of Y values is independent of the Z values - used to define 4NF
click to copy
What is the attribute closure X+ of a set of attributes X under a set of functional dependencies F?
The set of ALL attributes that can be functionally determined by X using the FDs in F - used to test if X is a superkey (if X+ = all attributes)
click to copy
What is the lossless join decomposition property and why is it critical?
It ensures that when a relation is decomposed into smaller relations the original relation can be perfectly reconstructed by joining the decomposed relations with no spurious tuples
click to copy
What is join dependency and how does it relate to 5NF?
A constraint where a relation can be losslessly decomposed into n projections and reconstructed by joining them; a relation is in 5NF if every join dependency is implied by the candidate keys
click to copy
What is the difference between UNION and UNION ALL in SQL?
UNION removes duplicate rows from the combined result; UNION ALL keeps all rows including duplicates (and is faster since no deduplication is needed)
click to copy
What is the chase procedure (chase algorithm) used for in relational theory?
Testing whether a decomposition has the lossless join property and whether a set of functional dependencies is preserved by applying FDs to a canonical table (tableau)
click to copy
What is the semantic meaning of left outer join?
Returns all rows from the left table and matching rows from the right table; non-matching right-side columns contain NULL
click to copy
In the relational model what is the domain of an attribute?
The set of all permissible/valid values for an attribute defining the data type and any domain constraints
click to copy
What is the difference between theta join and equi-join in relational algebra?
Theta join allows any comparison operator (=, <, >, <=, >=, !=) as the join condition; equi-join is a special case of theta join using only equality (=)
click to copy
What is relational calculus and how does it differ from relational algebra?
Relational algebra is procedural (specifies how to retrieve data); relational calculus is declarative (specifies what data to retrieve without specifying how) - both are equivalent in expressive power (Codds theorem)
click to copy
What is a relation scheme vs a relation instance in formal relational model terms?
Relation scheme (schema) R(A1,A2,...An) is the structural definition with attribute names and their domains; relation instance r(R) is the actual set of tuples conforming to that schema at a point in time
click to copy
In relational algebra what is the difference between selection and projection?
Selection filters rows based on a condition (horizontal subset); projection selects specific columns (vertical subset) potentially eliminating duplicates
click to copy
What is generalized projection operation in extended relational algebra?
A projection that allows arithmetic expressions and renaming in the projection list e.g. pi_name, salary*1.1 AS new_salary (R)
click to copy
What is the aggregate function operation in extended relational algebra?
gamma_grouping-attributes, aggregate-function(attribute) (R) - groups tuples by specified attributes and applies aggregate functions (COUNT, SUM, AVG, MAX, MIN) to each group equivalent to SQL GROUP BY
click to copy
What is data redundancy in the relational model and why is it problematic?
Storing the same fact multiple times in different places causing wasted storage, inconsistency risk, insertion anomalies, and deletion anomalies
click to copy
What is the formal definition of referential integrity in the relational model?
A constraint that a foreign key value in a referencing relation must either be NULL or must match an existing primary key value in the referenced relation
click to copy
What happens to the cardinality when you perform a CROSS PRODUCT of relations R (with r tuples) and S (with s tuples)?
The result has r times s tuples (every tuple of R paired with every tuple of S)
click to copy
What is the semi-join operation in relational algebra and why is it useful in distributed databases?
R semi-join S returns only the tuples from R that have a matching tuple in S - useful in distributed databases because only tuples from S that match need to be transferred to the site holding R reducing network communication
click to copy
What is the relational division operation and how is it used?
Given R(A,B) and S(B) the division R / S returns tuples of R[A] that appear paired with every tuple in S - used for queries with for-all semantics such as Find employees who worked on all projects
click to copy
What is the difference between 5NF and BCNF?
BCNF eliminates all functional dependency violations; 5NF additionally eliminates join dependency violations that are not implied by candidate keys requiring a lossless decomposition into 3 or more projections
click to copy
What is the connection between the relational model and set theory?
The relational model is founded on mathematical set theory: relations are sets of tuples (no duplicates), operations (union, intersection, difference) follow set semantics and relational algebra is based on set operations
click to copy

DBMS → Data Models 1

Which correctly distinguishes hierarchical from network data model?
Hierarchical allows only one parent per record (tree); network allows multiple parents (graph structure)
click to copy

DBMS → Normalization 11

A relation R(A,B,C,D) with FDs A to B, B to C, A to D is in which normal form?
2NF but not 3NF because B to C creates a transitive dependency
click to copy
What is partial dependency and in which normal form is it eliminated?
A functional dependency of a non-prime attribute on a PROPER SUBSET of a candidate key (occurs only when candidate key is composite); eliminated by achieving 2NF
click to copy
Consider R(EmpID,EmpName,DeptID,DeptName,Salary) with EmpID to EmpName,DeptID,Salary and DeptID to DeptName. What violation exists?
Transitive dependency DeptID to DeptName violates 3NF; decompose into R1(EmpID,EmpName,DeptID,Salary) and R2(DeptID,DeptName)
click to copy
What is the key difference between 3NF decomposition and BCNF decomposition in terms of guarantees?
3NF decomposition always guarantees both lossless join AND dependency preservation; BCNF decomposition guarantees lossless join but may NOT preserve all functional dependencies
click to copy
What is 4NF and what type of anomaly does it address beyond BCNF?
4NF addresses multivalued dependencies (MVDs): a relation is in 4NF if for every non-trivial MVD X multidetermines Y, X is a superkey. MVDs create redundancy even in BCNF relations with independent multi-valued facts
click to copy
What is a minimal cover (canonical cover) of a set of FDs F?
The smallest equivalent set Fc of FDs where all FDs have single attribute RHS, no FD is redundant, and no attribute in any LHS is redundant
click to copy
Consider R(A,B,C) with FDs A to B, B to C, C to A. The candidate keys are:
A, B, and C are all candidate keys (since each determines all others via transitivity forming an equivalence class)
click to copy
What is the synthesis algorithm for 3NF and what are its steps?
An algorithm that: (1) finds minimal cover Fc, (2) creates one relation for each FD in Fc (LHS union RHS), (3) adds a relation for any candidate key if none of the created relations contains one, (4) removes redundant relations
click to copy
What does it mean for a decomposition to be dependency-preserving?
The union of functional dependencies derivable from the projected FDs on each decomposed relation is equivalent to the original set of FDs - meaning all original constraints can be checked locally without joins
click to copy
What is denormalization and in what scenario is it a justified design decision?
Denormalization is the intentional introduction of redundancy by reversing normalization justified when the performance cost of joins in read-heavy workloads significantly outweighs the storage and update overhead
click to copy
What is the insertion anomaly in an unnormalized relation with an example?
The inability to insert a valid piece of information without also inserting other possibly unknown information - e.g. cannot add a new department unless at least one employee in that department exists
click to copy