3.9 Relational Algebra Flashcards
What is the equivalent of a relational algebra expression?
An SQL query defining a single result table.
- What operation does the symbol
σ
represent in relational algebra? - What is the operation written as?
Select
Greek Letter: sigma
- What operation does the symbol
π
represent in relational algebra? - What is the operation written as?
Project
Greek Letter: Pi
- What operation does the symbol
×
represent in relational algebra? - What is the operation written as?
Product
- What operation does the symbol
⨝
represent in relational algebra? - What is the operation written as?
Join
- What operation does the symbol
∪
represent in relational algebra? - What is the operation written as?
Union
- What operation does the symbol
∩
represent in relational algebra? - What is the operation written as?
Intersect
- What operation does the symbol
−
represent in relational algebra? - What is the operation written as?
Difference
- What operation does the symbol
ρ
represent in relational algebra? - What is the operation written as?
Rename
Greek Letter: rho
- What operation does the symbol
γ
represent in relational algebra? - What si the operation written as?
Aggregate
Greek Letter: gamma
Fill in the blank: The symbol σ
corresponds to the operation _______ in relational algebra.
Select
Fill in the blank: The symbol π
corresponds to the operation _______ in relational algebra.
Project
Fill in the blank: The symbol ρ
corresponds to the operation _______ in relational algebra.
Rename
Fill in the blank: The symbol γ
corresponds to the operation _______ in relational algebra.
Aggregate
What is the operation equivalent to SQL SELECT
?
SELECT * FROM Table WHERE expression
This operation retrieves rows from a table that meet a specified condition.
What is the relational algebra operation equivalent to SQL PROJECT
?
SELECT Column1, Column2
This operation selects specific columns from a table.
What is the relational algebra operation equivalent to SQL PRODUCT
?
SELECT * FROM Table1 CROSS JOIN Table2
This operation combines all rows from Table1 with all rows from Table2.
What is the relational algebra operation equivalent to SQL JOIN
?
SELECT * FROM Table1 INNER JOIN Table2 ON expression
This operation combines rows from two tables based on a related column.
What is the relational algebra operation equivalent to SQL UNION
?
SELECT * FROM Table1 UNION SELECT * FROM Table2
This operation combines the results of two queries, removing duplicates.
What is the relational algebra operation equivalent to SQL INTERSECT
?
SELECT * FROM Table1 INTERSECT SELECT * FROM Table2
This operation retrieves rows that are common to both tables.
What is the relational algebra operation equivalent to SQL DIFFERENCE
?
SELECT * FROM Table1 MINUS SELECT * FROM Table2
This operation retrieves rows from Table1 that are not in Table2.
What is the relational algebra operation equivalent to SQL RENAME
?
No direct SQL syntax; typically done by aliasing
This operation allows renaming tables and columns for clarity.
What is the relational algebra operation equivalent to SQL AGGREGATE
?
SELECT GroupColumn, Function(Column) FROM Table GROUP BY GroupColumn
aggregate functions is typically expressed using the Group By operation along with an Aggregation operation
Set operations in MYSQL
What operations are part of the SQL standard?
- The
UNION
,INTERSECT
, andMINUS
keywords are part of the SQL standard. - MySQL supports
UNION
but notINTERSECT
andMINUS
.