Each question below shows the correct answer with a full explanation. Use these to build conceptual understanding before attempting a timed quiz.
Relational Algebra & CalculusEasy
Q1. The selection operation in relational algebra:
- A.Selects tuples (rows) that satisfy a condition✓ Correct
- B.Selects specific columns from a given relation
- C.Renames a relation or its attribute identifiers
- D.Combines two relations into a single relation
Explanation
Selection (σ) filters tuples from a relation based on a given condition.
Report an error in this question
Relational Algebra & CalculusEasy
Q2. The projection operation in relational algebra:
- A.Deletes tuples from a stored relation
- B.Selects specific columns from a relation✓ Correct
- C.Joins two relations on common attributes
- D.Selects specific rows from a given relation
Explanation
Projection (π) selects specified attributes (columns) and removes duplicates.
Report an error in this question
Relational Algebra & CalculusEasy
Q3. The union of two relations R and S contains:
- A.Only tuples that are common to both R and S
- B.All tuples from both R and S without duplicates✓ Correct
- C.The Cartesian product of relations R and S
- D.Tuples in R but not present in relation S
Explanation
Union (R ∪ S) returns all tuples that are in R, in S, or in both, without duplicates.
Report an error in this question
Relational Algebra & CalculusEasy
Q4. Which relational algebra operation renames a relation or its attributes?
- A.Rename (ρ)✓ Correct
- B.Projection (π)
- C.Division (÷)
- D.Selection (σ)
Explanation
The rename operation (ρ) is used to rename relations or their attributes.
Report an error in this question
Relational Algebra & CalculusEasy
Q5. The Cartesian product of relations R and S is denoted as:
- A.R ∪ S
- B.R × S✓ Correct
- C.R ∩ S
- D.R − S
Explanation
The Cartesian product is denoted as R × S and pairs every tuple of R with every tuple of S.
Report an error in this question
Relational Algebra & CalculusEasy
Q6. Set difference (R − S) returns:
- A.Common tuples found in R and S
- B.Tuples in S that are not in R
- C.Tuples in R that are not in S✓ Correct
- D.All tuples from both R and S
Explanation
Set difference (R − S) returns tuples that are in R but not in S.
Report an error in this question
Relational Algebra & CalculusEasy
Q7. For union compatibility, two relations must have:
- A.The same number of attributes with compatible domains✓ Correct
- B.The same name for both relations being combined
- C.The same number of tuples stored in both relations
- D.Identical primary keys defined on both data relations
Explanation
Union compatibility requires the same number of attributes with corresponding domains being compatible.
Report an error in this question
Relational Algebra & CalculusEasy
Q8. The intersection of R and S (R ∩ S) returns:
- A.Tuples that are only in relation R
- B.Tuples that are only in relation S
- C.All tuples from relations R and S
- D.Tuples that are in both R and S✓ Correct
Explanation
Intersection returns tuples common to both relations R and S.
Report an error in this question
Relational Algebra & CalculusEasy
Q9. Which operation is fundamental in relational algebra (cannot be derived from others)?
- A.Intersection
- B.Division
- C.Selection✓ Correct
- D.Natural join
Explanation
Selection is one of the fundamental operations; intersection can be derived from other operations.
Report an error in this question
Relational Algebra & CalculusEasy
Q10. The natural join operation:
- A.Renames attributes within a relation for query convenience
- B.Returns all tuples from both relations regardless of matching
- C.Combines tuples from two relations based on common attributes✓ Correct
- D.Removes duplicates from a single relation without conditions
Explanation
Natural join combines tuples from two relations where the values of common attributes match.
Report an error in this question
Relational Algebra & CalculusMedium
Q11. The theta join of relations R and S is:
- A.A rename operation applied to change the relation name
- B.A Cartesian product followed by selection with a condition✓ Correct
- C.A set union combining all tuples from two given relations
- D.A simple projection on selected attributes from the relation
Explanation
Theta join (R ⋈θ S) is the Cartesian product of R and S followed by selection based on condition θ.
Report an error in this question
Relational Algebra & CalculusMedium
Q12. An equi-join is a special case of theta join where:
- A.No condition is applied to the join result
- B.The result of the join is always an empty set
- C.The condition uses only inequality comparisons
- D.The condition uses only equality comparisons✓ Correct
Explanation
An equi-join is a theta join where the join condition uses only the equality (=) operator.
Report an error in this question
Relational Algebra & CalculusMedium
Q13. The division operation R ÷ S returns:
- A.The Cartesian product of both relations R and S fully
- B.Tuples in R that are associated with every tuple in S✓ Correct
- C.All tuples from relation S regardless of the condition
- D.All tuples from relation R regardless of the condition
Explanation
Division R ÷ S returns tuples from R that are associated with all tuples in S.
Report an error in this question
Relational Algebra & CalculusMedium
Q14. Left outer join includes:
- A.All tuples from the right relation and matching from the left side
- B.Only tuples that have matching values in both of the joined tables
- C.No tuples at all if there is no matching condition between tables
- D.All tuples from the left relation and matching tuples from the right✓ Correct
Explanation
Left outer join preserves all tuples from the left relation, padding with NULLs where no match exists.
Report an error in this question
Relational Algebra & CalculusMedium
Q15. In relational algebra, which operation can be derived from the fundamental operations?
- A.Projection
- B.Intersection✓ Correct
- C.Division
- D.Selection
Explanation
Intersection can be derived: R ∩ S = R − (R − S).
Report an error in this question
Relational Algebra & CalculusMedium
Q16. The semi-join of R and S returns:
- A.All tuples from both relations R and S combined
- B.The complete Cartesian product of R and S result
- C.Only the tuples from relation S not in relation R
- D.Tuples from R that have matching tuples in S✓ Correct
Explanation
Semi-join returns only those tuples from R for which there is a matching tuple in S.
Report an error in this question
Relational Algebra & CalculusMedium
Q17. Anti-join of R and S returns:
- A.All tuples from R regardless of matching in S
- B.The complete Cartesian product of R and S both
- C.Tuples from R that have no matching tuples in S✓ Correct
- D.All tuples that match between relations R and S
Explanation
Anti-join returns tuples from R that do not have a matching tuple in S.
Report an error in this question
Relational Algebra & CalculusMedium
Q18. Relational calculus is:
- A.A procedural query language that specifies how to retrieve data
- B.A data definition language for creating tables and constraints
- C.A physical storage language for defining data file structures
- D.A non-procedural query language that describes what to retrieve✓ Correct
Explanation
Relational calculus is non-procedural; it specifies what to retrieve without specifying how.
Report an error in this question
Relational Algebra & CalculusMedium
Q19. Tuple relational calculus uses:
- A.Tuple variables that range over relations✓ Correct
- B.Domain variables that range over values
- C.Only table names without any variables
- D.No variables of any kind are required
Explanation
Tuple relational calculus uses tuple variables that range over tuples of a relation.
Report an error in this question
Relational Algebra & CalculusMedium
Q20. Domain relational calculus uses:
- A.SQL queries written in standard syntax format
- B.No variables of any kind within the expression
- C.Domain variables that range over attribute domains✓ Correct
- D.Tuple variables that range over entire relations
Explanation
Domain relational calculus uses domain variables that range over the domains of attributes.
Report an error in this question
Relational Algebra & CalculusHard
Q21. A query language is relationally complete if it can express:
- A.All queries expressible in relational calculus✓ Correct
- B.Only join operations between related tables
- C.Only aggregate functions on grouped data
- D.Only selection and projection operations used
Explanation
A relationally complete language can express any query that can be expressed in relational calculus.
Report an error in this question
Relational Algebra & CalculusHard
Q22. The aggregate operation in extended relational algebra:
- A.Performs Cartesian products between two unrelated relations
- B.Renames relations and their associated attributes in queries
- C.Selects individual tuples based on a simple filter condition
- D.Computes functions like SUM, AVG, COUNT on groups of tuples✓ Correct
Explanation
The aggregate operation applies aggregate functions (SUM, AVG, COUNT, etc.) to groups of tuples.
Report an error in this question
Relational Algebra & CalculusHard
Q23. Which of the following cannot be expressed in basic relational algebra?
- A.Projection of attributes from relations
- B.Selection with various filter conditions
- C.Recursive queries like transitive closure✓ Correct
- D.Natural join of two compatible relations
Explanation
Basic relational algebra cannot express recursive queries such as computing the transitive closure.
Report an error in this question
Relational Algebra & CalculusHard
Q24. The concept of safe expressions in relational calculus ensures:
- A.Queries always run faster than other approaches
- B.No NULL values appear in the query results
- C.All tuples in the relation are always selected
- D.The result of a query is a finite set of tuples✓ Correct
Explanation
Safe expressions guarantee that the result of a query is a finite relation, not an infinite set.
Report an error in this question
Relational Algebra & CalculusHard
Q25. In tuple relational calculus, the expression {t | P(t)} means:
- A.Update tuples in the relation where P is a false value
- B.Delete all tuples from the relation where P is true value
- C.The set of all tuples t such that predicate P(t) is true✓ Correct
- D.Insert tuples into the relation that satisfy predicate P
Explanation
The expression {t | P(t)} denotes the set of all tuples t for which predicate P is true.
Report an error in this question
Relational Algebra & CalculusHard
Q26. The outer union operation:
- A.Only works with relations that have identical schemas and matching attributes
- B.Is the same as regular union and produces exactly identical results every time
- C.Takes the union of relations that are not union-compatible by padding with NULLs✓ Correct
- D.Removes all NULL values from the result set after combining both relations
Explanation
Outer union combines partially compatible relations by padding missing attributes with NULLs.
Report an error in this question
Relational Algebra & CalculusHard
Q27. Full outer join preserves:
- A.Only tuples from the left relation with NULL for non-matching rows
- B.Only tuples from the right relation with NULL for non-matching rows
- C.All tuples from both relations, padding with NULLs where necessary✓ Correct
- D.Only tuples that have matching values in both of the joined tables
Explanation
Full outer join preserves all tuples from both relations, using NULLs for non-matching attributes.
Report an error in this question
Relational Algebra & CalculusHard
Q28. The multiset (bag) version of relational algebra differs from set-based algebra in that:
- A.It removes all duplicates
- B.It allows duplicate tuples✓ Correct
- C.It does not support joins
- D.It only supports selection
Explanation
Multiset relational algebra allows duplicate tuples, unlike set-based algebra which eliminates duplicates.
Report an error in this question
Relational Algebra & CalculusHard
Q29. Which algebraic equivalence rule is used for query optimization?
- A.Removing all joins from the query plan
- B.Pushing selections down the query tree✓ Correct
- C.Eliminating projections from the query
- D.Reversing the order of query operations
Explanation
Pushing selections down the query tree reduces the size of intermediate results, improving efficiency.
Report an error in this question
Relational Algebra & CalculusHard
Q30. The assignment operation in relational algebra is used to:
- A.Delete relations permanently from the database schema and storage system
- B.Assign the result of a relational algebra expression to a temporary variable✓ Correct
- C.Modify existing tuples by updating their attribute values in the table
- D.Create new databases and define their schema structure from scratch
Explanation
The assignment operation (←) stores the result of an expression in a temporary relation variable.
Report an error in this question