HomeSubjectsUniversityBlogAbout

Relational Algebra & Calculus

Topic in Databases

210 total MCQsShowing 30 with explanations10 Easy10 Medium10 Hard

About This Topic

Relational algebra is a procedural query language whose operators, such as selection, projection and join, take relations as input and produce new relations. Exam items check the six fundamental operators (select σ, project π, union, set difference, Cartesian product and rename ρ) and how derived ones are built from them, for example intersection as R − (R − S) and division through projection, product and difference. You will also see union compatibility rules, natural and theta joins, left, right and full outer joins, and questions on the size of a join result. Tuple and domain relational calculus appear as the declarative counterparts, together with the idea of safe expressions.

Below are 30 practice questions from a pool of 210 Relational Algebra & Calculus MCQs, one of 17 topics in Databases. Each shows the correct answer with an explanation; when you are ready, take a timed quiz to test recall under exam conditions.

Practice Questions

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:

  1. A.Selects tuples (rows) that satisfy a condition✓ Correct
  2. B.Selects specific columns from a given relation
  3. C.Renames a relation or its attribute identifiers
  4. 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:

  1. A.Deletes tuples from a stored relation
  2. B.Selects specific columns from a relation✓ Correct
  3. C.Joins two relations on common attributes
  4. 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:

  1. A.Only tuples that are common to both R and S
  2. B.All tuples from both R and S without duplicates✓ Correct
  3. C.The Cartesian product of relations R and S
  4. 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?

  1. A.Rename (ρ)✓ Correct
  2. B.Projection (π)
  3. C.Division (÷)
  4. 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:

  1. A.R ∪ S
  2. B.R × S✓ Correct
  3. C.R ∩ S
  4. 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:

  1. A.Common tuples found in R and S
  2. B.Tuples in S that are not in R
  3. C.Tuples in R that are not in S✓ Correct
  4. 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:

  1. A.The same number of attributes with compatible domains✓ Correct
  2. B.The same name for both relations being combined
  3. C.The same number of tuples stored in both relations
  4. 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:

  1. A.Tuples that are only in relation R
  2. B.Tuples that are only in relation S
  3. C.All tuples from relations R and S
  4. 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)?

  1. A.Intersection
  2. B.Division
  3. C.Selection✓ Correct
  4. 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:

  1. A.Renames attributes within a relation for query convenience
  2. B.Returns all tuples from both relations regardless of matching
  3. C.Combines tuples from two relations based on common attributes✓ Correct
  4. 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:

  1. A.A rename operation applied to change the relation name
  2. B.A Cartesian product followed by selection with a condition✓ Correct
  3. C.A set union combining all tuples from two given relations
  4. 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:

  1. A.No condition is applied to the join result
  2. B.The result of the join is always an empty set
  3. C.The condition uses only inequality comparisons
  4. 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:

  1. A.The Cartesian product of both relations R and S fully
  2. B.Tuples in R that are associated with every tuple in S✓ Correct
  3. C.All tuples from relation S regardless of the condition
  4. 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:

  1. A.All tuples from the right relation and matching from the left side
  2. B.Only tuples that have matching values in both of the joined tables
  3. C.No tuples at all if there is no matching condition between tables
  4. 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?

  1. A.Projection
  2. B.Intersection✓ Correct
  3. C.Division
  4. 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:

  1. A.All tuples from both relations R and S combined
  2. B.The complete Cartesian product of R and S result
  3. C.Only the tuples from relation S not in relation R
  4. 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:

  1. A.All tuples from R regardless of matching in S
  2. B.The complete Cartesian product of R and S both
  3. C.Tuples from R that have no matching tuples in S✓ Correct
  4. 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:

  1. A.A procedural query language that specifies how to retrieve data
  2. B.A data definition language for creating tables and constraints
  3. C.A physical storage language for defining data file structures
  4. 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:

  1. A.Tuple variables that range over relations✓ Correct
  2. B.Domain variables that range over values
  3. C.Only table names without any variables
  4. 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:

  1. A.SQL queries written in standard syntax format
  2. B.No variables of any kind within the expression
  3. C.Domain variables that range over attribute domains✓ Correct
  4. 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:

  1. A.All queries expressible in relational calculus✓ Correct
  2. B.Only join operations between related tables
  3. C.Only aggregate functions on grouped data
  4. 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:

  1. A.Performs Cartesian products between two unrelated relations
  2. B.Renames relations and their associated attributes in queries
  3. C.Selects individual tuples based on a simple filter condition
  4. 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?

  1. A.Projection of attributes from relations
  2. B.Selection with various filter conditions
  3. C.Recursive queries like transitive closure✓ Correct
  4. 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:

  1. A.Queries always run faster than other approaches
  2. B.No NULL values appear in the query results
  3. C.All tuples in the relation are always selected
  4. 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:

  1. A.Update tuples in the relation where P is a false value
  2. B.Delete all tuples from the relation where P is true value
  3. C.The set of all tuples t such that predicate P(t) is true✓ Correct
  4. 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:

  1. A.Only works with relations that have identical schemas and matching attributes
  2. B.Is the same as regular union and produces exactly identical results every time
  3. C.Takes the union of relations that are not union-compatible by padding with NULLs✓ Correct
  4. 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:

  1. A.Only tuples from the left relation with NULL for non-matching rows
  2. B.Only tuples from the right relation with NULL for non-matching rows
  3. C.All tuples from both relations, padding with NULLs where necessary✓ Correct
  4. 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:

  1. A.It removes all duplicates
  2. B.It allows duplicate tuples✓ Correct
  3. C.It does not support joins
  4. 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?

  1. A.Removing all joins from the query plan
  2. B.Pushing selections down the query tree✓ Correct
  3. C.Eliminating projections from the query
  4. 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:

  1. A.Delete relations permanently from the database schema and storage system
  2. B.Assign the result of a relational algebra expression to a temporary variable✓ Correct
  3. C.Modify existing tuples by updating their attribute values in the table
  4. 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

Ready to test yourself on Relational Algebra & Calculus?

Take a timed quiz drawn from 210+ questions on this topic. No signup required — your progress saves in your browser.

Start Relational Algebra & Calculus Quiz