relational Flashcards
(36 cards)
What is relational algebra?
A procedural query language for relational databases
Relational algebra provides a formal foundation for querying and manipulating data in a relational database.
Which of the following is NOT a fundamental operation in relational algebra?
INSERT
Fundamental operations include SELECT, PROJECT, and JOIN.
What does the SELECT operation do in relational algebra?
Chooses specific rows
The SELECT operation filters rows based on a specified condition.
What does the PROJECT operation do?
Selects specific columns from a table
The PROJECT operation is used to retrieve specific attributes from a relation.
Which symbol represents the UNION operation in relational algebra?
∪
The UNION operation combines the results of two relations, removing duplicates.
Which type of JOIN returns all rows from both relations?
FULL OUTER JOIN
A FULL OUTER JOIN includes all records from both tables, matching where possible.
What is the purpose of the RENAME operation?
To change the name of a relation
The RENAME operation allows for the aliasing of relations for clarity in queries.
What does the INTERSECT operation do?
Returns rows that are in both relations
The INTERSECT operation yields the common rows from two relations.
In relational calculus, what does the term ‘tuple’ refer to?
A single row in a relation
A tuple represents a single entry in a table, corresponding to a record.
What does the term ‘domain’ refer to in relational calculus?
The set of all possible values for an attribute
The domain defines the permissible values that an attribute can take.
Which of the following symbols represents the existential quantifier in relational calculus?
∃
The existential quantifier indicates that there exists at least one tuple satisfying a condition.
What is the purpose of the universal quantifier in relational calculus?
To specify that a condition holds for all tuples
The universal quantifier is used to express conditions that must be true for every tuple in a relation.
In tuple relational calculus, how is a query expressed?
Using logical predicates
Queries in tuple relational calculus are formulated with logical conditions rather than procedural steps.
Which operation can be used to combine two relations with the same attributes?
UNION
The UNION operation merges two relations, eliminating duplicates.
What is the result of a CROSS JOIN?
A combination of rows from two relations without conditions
A CROSS JOIN produces a Cartesian product of the two relations.
Which of the following statements about relational calculus is true?
It is a declarative language.
Relational calculus specifies what to retrieve rather than how to retrieve it.
What is the main advantage of relational algebra?
It provides a clear procedural approach to queries
Relational algebra gives a structured way to express queries through defined operations.
In relational algebra, what does the term ‘set difference’ refer to?
The result of removing common rows from two relations
Set difference yields rows that are in one relation but not in another.
What type of queries can relational calculus express?
Complex queries involving multiple relations
Relational calculus supports intricate queries that may involve several relations and conditions.
Which of the following is a valid tuple relational calculus expression?
{t | t ∈ Student ∧ t.Age > 20}
This expression selects tuples from the Student relation where the Age attribute is greater than 20.
What does the term ‘result set’ refer to in the context of relational algebra?
The final output of a query
The result set is what is returned after the execution of a query.
Which of the following is NOT a characteristic of relational algebra?
It is non-procedural.
Relational algebra is procedural, specifying the steps to retrieve data.
What is the main purpose of using the aggregate functions in relational algebra?
To perform calculations on a set of values
Aggregate functions like SUM, COUNT, and AVG summarize data.
What is the significance of the ORDER BY clause in SQL?
To sort the output of a query
The ORDER BY clause organizes the results based on specified columns.