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 21

How is a many-to-many M:N relationship mapped to relational tables?
By creating a separate junction/cross-reference table with foreign keys referencing both entity tables plus any relationship attributes
click to copy
In EER modeling what is the difference between specialization and generalization?
Specialization is top-down (start with supertype, define subtypes); generalization is bottom-up (identify commonalities among existing entity types to create a supertype)
click to copy
What is the Chen notation for a multi-valued attribute in ER diagrams?
Double ellipse (ellipse within an ellipse)
click to copy
How would you record the hours each employee works on each project in M:N employee-project scenario?
Create a M:N relationship Works_On between Employee and Project with hours as a relationship attribute
click to copy
What is aggregation in ER modeling and when is it used?
Treating a relationship and its participating entities as a higher-level abstract entity to participate in another relationship used when a relationship itself needs to have a relationship
click to copy
When converting a 1:1 relationship to relational tables the preferred approach is:
Place the foreign key in the table with total participation or merge the two entities into one table if appropriate
click to copy
What is the purpose of the role name in an ER diagram relationship?
To clarify the role/function each entity plays in a relationship especially important in recursive (self-referential) relationships
click to copy
What is total specialization constraint in EER modeling?
Every supertype instance MUST be a member of at least one subtype contrasted with partial where supertype instances need not belong to any subtype
click to copy
How would you represent a category (UNION type) in EER modeling?
As a union of supertype entities where a subtype can be associated with instances from different supertype entity sets shown with a U symbol in EER diagrams
click to copy
When converting an ER model to relational schema a weak entity is mapped by:
Creating a table whose primary key is the combination of its partial key (discriminator) and the primary key of its identifying strong entity with a foreign key to the owner table
click to copy
What is the semantic difference between HasA and IsA relationships?
IsA represents inheritance/specialization (a Car IsA Vehicle); HasA represents composition/aggregation (a Car HasA Engine) - fundamentally different entity relationships
click to copy
In ER-to-relational mapping how is a multi-valued attribute converted?
Converted into a separate table with the parent entity PK as FK and the multi-valued attribute as part of the PK
click to copy
For the rule Every Department MUST have exactly one Manager what is the participation constraint?
Total participation of Department in Manages relationship with cardinality 1:1 where Department has total and Manager has partial participation
click to copy
What is schema evolution in ER modeling and why is it challenging?
The process of modifying the ER schema over time as requirements change challenging because it requires updating existing data, queries, application code, and possibly complex data migrations
click to copy
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 19

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