WEEK 3 Flashcards
(22 cards)
Theoretical way of manipulating table contents using relational operators
Relational Algebra
Relvar: Variable that holds a relation
Heading contains the names of the attributes and the body contains the relation
Relvar: Variable that holds a relation
Heading contains the names of the attributes and the body contains the relation
Relational operators have the property of closure
Closure: Use of relational algebra operators on existing relations produces new relations
Relational operators have the property of closure
Closure: Use of relational algebra operators on existing relations produces new relations
Relational operators have the property of closure
Closure: Use of relational algebra operators on existing relations produces new relations
relational algebra = language to get the data / it is a procedural language
relational algebra = language to get the data / it is a procedural language
Relational Set Operators
Select (Restrict)
Unary operator that yields a horizontal subset of a table
Project
Unary operator that yields a vertical subset of a table
Union
Combines all rows from two tables, excluding duplicate rows
Union-compatible: Tables share the same number of columns, and their corresponding columns share compatible domains
Intersect
Yields only the rows that appear in both tables
Tables must be union-compatible to yield valid results
Relational Set Operators
Select (Restrict)
Unary operator that yields a horizontal subset of a table
Project
Unary operator that yields a vertical subset of a table
Union
Combines all rows from two tables, excluding duplicate rows
Union-compatible: Tables share the same number of columns, and their corresponding columns share compatible domains
Intersect
Yields only the rows that appear in both tables
Tables must be union-compatible to yield valid results
Unary operator that yields a horizontal subset of a table
Select (Restrict)
Unary operator that yields a vertical subset of a table
Project
Combines all rows from two tables, excluding duplicate rows
Union-compatible: Tables share the same number of columns, and their corresponding columns share compatible domains
Union
Yields only the rows that appear in both tables
Tables must be union-compatible to yield valid results
Intersect
Yields all rows in one table that are not found in the other table
Tables must be union-compatible to yield valid results
like the difference in set minus (-) / like how you minus in set
Difference
Tables share the same number of columns, and their corresponding columns share compatible domains
Union-compatible:
Yields all possible pairs of rows from two tables
Product
Uses one 2-column table as the dividend and one single-column table as the divisor
Output is a single column that contains all values from the second column of the dividend that are associated with every row in the divisor
Divide
Allows information to be intelligently combined from two or more tables
Join
Links tables by selecting only the rows with common values in their common attributes
Join columns: Common columns
Natural join:
Links tables on the basis of an equality condition that compares specified columns of each table
Equijoin:
Extension of natural join, denoted by adding a theta subscript after the JOIN symbol (using any comparison except equality)
Theta join:
Only returns matched records from the tables that are being joined
Inner join:
Matched pairs are retained and unmatched values in the other table are left null
Outer join:
Yields all of the rows in the first table, including those that do not have a matching value in the second table
Left outer join:
Yields all of the rows in the second table, including those that do not have matching values in the first table
Right outer join: