Relational Algebra and Relational Calculus MCQs Flashcards
(36 cards)
What is relational algebra?
o A) A language for database creation
o B) A procedural query language for relational databases
o C) A data modeling technique
o D) A type of normalization
A procedural query language for relational databases
Which of the following is NOT a fundamental operation in relational algebra?
o A) SELECT
o B) PROJECT
o C) JOIN
o D) INSERT
INSERT
What does the SELECT operation do in relational algebra?
o A) Chooses specific columns
o B) Chooses specific rows
o C) Combines two relations
o D) Divides relations
Chooses specific rows
What does the PROJECT operation do?
o A) Combines two tables
o B) Filters rows based on a condition
o C) Selects specific columns from a table
o D) Sorts the result set
Selects specific columns from a table
Which symbol represents the UNION operation in relational algebra?
o A) ∩
o B) ∪
o C) ∖
o D) ⊕
∪
Which type of JOIN returns all rows from both relations?
o A) INNER JOIN
o B) LEFT JOIN
o C) FULL OUTER JOIN
o D) CROSS JOIN
FULL OUTER JOIN
What is the purpose of the RENAME operation?
o A) To change the name of a relation
o B) To filter rows in a relation
o C) To sort the result
o D) To combine two relations
To change the name of a relation
What does the INTERSECT operation do?
o A) Returns rows that are in both relations
o B) Returns rows unique to each relation
o C) Combines rows from two relations
o D) Sorts the results of two relations
Returns rows that are in both relations
In relational calculus, what does the term “tuple” refer to?
o A) A database table
o B) A single row in a relation
o C) A column in a table
o D) A data type
A single row in a relation
What does the term “domain” refer to in relational calculus?
o A) The set of all possible values for an attribute
o B) A specific row in a relation
o C) A type of relationship
o D) A database schema
The set of all possible values for an attribute
Which of the following symbols represents the existential quantifier in relational
o A) ∀
o B) ∃
o C) ∈
o D) ⊆
∃
What is the purpose of the universal quantifier in relational calculus?
o A) To specify that a condition holds for at least one tuple
o B) To specify that a condition holds for all tuples
o C) To filter specific rows
o D) To project columns
To specify that a condition holds for all tuples
In tuple relational calculus, how is a query expressed?
o A) Using logical predicates
o B) Using algebraic expressions
o C) Using SQL syntax
o D) Using mathematical formulas
Using logical predicates
Which operation can be used to combine two relations with the same attributes?
o A) UNION
o B) INTERSECT
o C) JOIN
o D) PROJECT
UNION
What is the result of a CROSS JOIN?
o A) A combination of rows from two relations without conditions
o B) A filtered set of rows based on a condition
o C) A set of common rows from two relations
o D) None of the above
A combination of rows from two relations without conditions
Which of the following statements about relational calculus is true?
o A) It is a procedural language.
o B) It is a declarative language.
o C) It uses SQL syntax.
o D) It cannot express complex queries.
It is a declarative language.
What is the main advantage of relational algebra?
o A) It is easier to learn than SQL.
o B) It provides a clear procedural approach to queries.
o C) It can express complex queries.
o D) It is used for database design.
It provides a clear procedural approach to queries.
In relational algebra, what does the term “set difference” refer to?
o A) The result of removing common rows from two relations
o B) The combination of two relations
o C) The intersection of two relations
o D) The filtering of specific rows
The result of removing common rows from two relations
What type of queries can relational calculus express?
o A) Only simple queries
o B) Complex queries involving multiple relations
o C) Only updates and deletes
o D) None of the above
Complex queries involving multiple relations
Which of the following is a valid tuple relational calculus expression?
o A) {t | t ∈ Student ∧ t.Age > 20}
o B) SELECT * FROM Student WHERE Age > 20
o C) Student ∪ Graduate
o D) ALL OF THE ABOVE
{t | t ∈ Student ∧ t.Age > 20}
What does the term “result set” refer to in the context of relational algebra?
o A) The final output of a query
o B) A temporary table
o C) A set of rules for operations
o D) A representation of data types
The final output of a query
Which of the following is NOT a characteristic of relational algebra?
o A) It is procedural.
o B) It uses mathematical symbols.
o C) It is non-procedural.
o D) It combines relations.
It is non-procedural.
What is the main purpose of using the aggregate functions in relational algebra?
o A) To filter rows
o B) To perform calculations on a set of values
o C) To combine relations
o D) To project columns
To perform calculations on a set of values
What is the significance of the ORDER BY clause in SQL?
o A) To filter results
o B) To sort the output of a query
o C) To combine relations
o D) To group results
To sort the output of a query