1/14
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Relational Algebra
Formal language for the relational model
defines the basic set of operations for the relational model for basic retrieval requests
SELECT, PROJECT, JOIN
Operations specifically developed for relational databases
UNION, INTERSECTION, SET DIFFERENCE, CARTESIAN PRODUCT
Mathematical Operations on Sets
Unary Relational Operations
applied to a single relation
SELECT
select a subset of the tuples from a relation that satisfies a selection condition
a boolean expression specified on the attributes of relation R
PROJECT
selects certain columns from the table and discards the other columns; used if we are interested only in certain attributes of a relation
UNION
relation that includes all tuples that are either in R or in S or in both R and S
Duplicate tuples are eliminated
INTERSECTION
relation that includes all tuples that are in both R and S
MINUS (SET DIFFERENCE)
relation that includes all tuples that are in R but not in S
Union compatibility
Relations should have same degree (same number of attributes) and each corresponding pair of attributes have same domain
CARTESIAN PRODUCT
Combines every tuple from one relation with every tuple from another relation
not union compatible
CARTESIAN PRODUCT
will have a degree of n+m attributes
will have one tuple for each combination of tuples, one from R and one from S
will have nR * nS tuples
Binary Relational Operations
applied to two sets of tuples
JOIN
used to combine related tuples from 2 relations into a single tuple
JOIN
has one tuple for each combination of tuples --- one from R and one from S --- whenever the combination satisfies the join condition.