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 10

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 28

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
For R(StudentID,CourseID,InstructorID) where each course has exactly one instructor and each instructor teaches only one course what NF issues arise?
FDs: CourseID to InstructorID and InstructorID to CourseID; candidate keys: StudentID,CourseID and StudentID,InstructorID; CourseID to InstructorID violates BCNF since CourseID is not a superkey yet 3NF holds because InstructorID is a prime attribute
click to copy
What is the deletion anomaly and provide an example?
Deleting a row to remove one piece of information inadvertently destroys other valid information stored in the same row - e.g. deleting the last employee in a department also deletes all information about that department
click to copy
What does it mean for two sets of FDs F and G to be equivalent?
F can derive all FDs in G AND G can derive all FDs in F - meaning they generate the same closure F+ = G+
click to copy
In the context of 2NF what exactly is a prime attribute?
An attribute that is a member of at least one candidate key of the relation
click to copy
Consider normalization of R(A,B,C,D,E,F) with F={A to BCDEF}. This relation is in which normal form?
BCNF and all higher normal forms
click to copy
A relation R has MVDs CourseID multidetermines InstructorID and CourseID multidetermines TextbookID. What does 4NF require?
For each course instructors and textbooks are independent; 4NF requires decomposing into R1(CourseID,InstructorID) and R2(CourseID,TextbookID) to eliminate the cartesian product redundancy
click to copy
What characterizes a transitive dependency in the context of 3NF with a concrete example?
A non-prime attribute Y depending on another non-prime attribute Z which in turn depends on the key X: X to Z to Y where Z is not a superkey - e.g. EmpID to DeptID to DeptName
click to copy
When normalizing to BCNF what algorithm is used and what is the termination condition?
Decomposition algorithm: find a violating FD X to Y (X not a superkey), decompose into R1(X union Y) and R2(R-Y+X), recursively apply until all relations are in BCNF
click to copy
What is a non-trivial functional dependency in formal terms?
X to Y where Y is NOT a subset of X - i.e. Y contains at least one attribute not already in X making the FD actually informative
click to copy
Given FDs A to B, B to A, A to C, B to C - what is the minimal cover?
Fc = A to B, B to A, A to C (since B to C is redundant: B to A to C is derivable so B to C can be removed)
click to copy
What is the practical significance of checking lossless join property when decomposing a relation?
It guarantees that when decomposed relations are joined back together the result is exactly the original relation with no spurious tuples and no missing tuples
click to copy
What is the complementation rule for MVDs?
If X multidetermines Y in relation R(X,Y,Z) where Z=R-X-Y then X multidetermines Z also holds; also every FD X to Y implies X multidetermines Y
click to copy
What does it mean for FD X to Y to be implied by a set of FDs F?
X to Y holds in every relation that satisfies all FDs in F - equivalently X to Y is derivable from F using Armstrong axioms
click to copy
Given R(A,B,C,D) with F={A to B, BC to D, A to C}. Is this in 3NF?
No: candidate key is A (A+ = ABCD). FD BC to D: BC is not a superkey and D is not a prime attribute. This violates 3NF. The relation is in 2NF (PK is single attribute so no partial dependencies) but NOT in 3NF
click to copy
In normalization what is the purpose of the prime attribute exception in 3NF compared to BCNF?
The prime attribute exception allows 3NF to always guarantee a dependency-preserving decomposition even when BCNF cannot; it permits FDs where the RHS is a prime attribute even if the LHS is not a superkey - trading some redundancy for dependency preservation
click to copy
What is the functional dependency graph and how is it used in normalization analysis?
A directed graph where nodes are attributes and directed edges represent FDs (X to Y is an edge from each attribute in X to each attribute in Y); used to identify transitive chains, key derivations, and find canonical covers
click to copy
What is a lossless decomposition test for binary decomposition using FDs?
A binary decomposition of R into R1 and R2 is lossless if and only if (R1 intersect R2) determines (R1 minus R2) OR (R1 intersect R2) determines (R2 minus R1) holds in F
click to copy

DBMS → Functional Dependency 1

Using Armstrongs axioms prove that if X to Y and X to Z then X to YZ (Union rule). Which axioms are used?
Augmentation and Transitivity: X to Y gives XZ to YZ; X to Z gives X to XZ (by reflexivity and augmentation); then XZ to YZ by augmentation gives X to YZ by transitivity
click to copy