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 → ER Model 7

In Crow Foot notation how is zero or one relationship cardinality represented?
A circle (zero) and a vertical line (one) on the same end of the relationship line
click to copy
What problem does fan trap represent in ER modeling and how is it resolved?
A modeling error where a many-to-one and one-to-many relationship from a single entity incorrectly suggests a path between entities leading to incorrect query results - resolved by restructuring the relationships
click to copy
What is a chasm trap in ER modeling?
A gap in a relationship path where a minimum cardinality of zero means some entities have no corresponding connected entities causing data to be missed in queries
click to copy
How should overlapping subtypes be handled in ER-to-relational mapping?
Various strategies: single table with type indicators and nullable columns, separate subtype tables with FK to supertype, or a type membership table allowing multiple type memberships
click to copy
In an ER diagram for Student ENROLLS_IN Course with attribute grade - what does placing grade on the relationship signify?
Grade is a property of the specific enrollment instance (the combination of a particular student in a particular course) not of Student alone or Course alone
click to copy
When is a direct ternary relationship better than decomposed binary relationships?
A relationship simultaneously associating three entity types used when decomposition into binary relationships would lose information about the three-way association
click to copy
What is the entity resolution problem in ER modeling?
The challenge of determining whether two references to entities represent the same real-world entity (deduplication/record linkage) crucial in data integration and federated database design
click to copy

DBMS → Relational Model 29

What is the difference between a superkey, candidate key, and primary key?
Superkey: any set of attributes uniquely identifying tuples; Candidate key: a minimal superkey (no subset is also a superkey); Primary key: one chosen candidate key for the table
click to copy
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 3

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