1/25
Looks like no tags are added yet.
σ (sigma)
Selection: keeps only the ROWS that satisfy a condition. | π_MODEL( ____ CPU>1.5 (PC) )
π (pi)
Projection: keeps only the listed COLUMNS and removes duplicate rows. | ____ MODEL( σ_CPU>1.5 (PC) )
× (times)
Cartesian product: pairs every row of R with every row of S. Result has n_r · n_s rows. | Answer = Left ____ Right
⋈ (bowtie)
Natural join: joins rows of R and S that are equal on ALL attributes with the same name; each common attribute appears once. | π_Man( PRODUCT ____ σ_DISK>1000 (LAPTOP) )
⋈_θ (theta join)
Join with any condition (=, ≠,
Equi-join
A join whose condition contains only equalities (=). Both copies of the compared attributes stay in the result. | σ_R.B=S.B (R × S) is the ____ of R and S on B
θ (theta)
The condition of a join or a selection, for example R.B = S.B or CPU > 3. | R ⋈( ____ ) S = σ( ____ )(R × S)
∪ (union)
Rows that are in R OR in S. Both relations must have the same columns. Used for "or". | π_Name(σ_Year<2005 (Student)) ____ π_Name(Student ⋈ N)
∩ (intersection)
Rows that are in R AND in S. Both relations must have the same columns. Used for "both". | Answer = π_Man( L ____ P )
− (difference)
Rows that are in R but NOT in S. Both relations must have the same columns. Used for "not", "only", "non-". | Answer = LaptopMakers ____ PcMakers
÷ (division / quotient)
The tuples that are combined in R with EVERY tuple of S. Used for "every / all". | LIKES ____ π_MEAL(SELLS)
ρ (rho)
Rename: gives a new name to a relation or to its attributes, so the same table can be used twice. | U₁ = ____ U₁ (StarUniversity)
R₁, R₂ (indexed copies)
Two copies of the same relation, used to compare a table with itself: "at least two", "oldest", "smallest". | Bigger = π( _ ).A ( σ( _ ).A > ( _ ).A ( _ × __ ) )
R.A (dot notation)
Says which relation an attribute belongs to. Needed when two relations in a product have an attribute with the same name. | σ_( ________ > ________ )(U₁ × U₂)
∧ (and)
Logical connective inside a condition: both parts must be true. | σ_( F₁.Man = F₂.Man ____ F₁.MODEL ≠ F₂.MODEL )(F₁ × F₂)
∨ (or)
Logical connective inside a condition: at least one part must be true. | σ_( City='Budapest' ____ City='London' )(Person)
¬ (not)
Logical connective inside a condition: the part after it must be false. | σ_( ____ (City='Budapest') )(Person)
≠ (not equal)
Comparison "different from". With two copies of a table it expresses "two distinct …". | S₁.Program = S₂.Program ∧ S₁.University ____ S₂.University
R(A, B)
Relation schema: the name of the relation followed by its attributes. | ________ and S(B, C) are joined on B
r
An instance of a schema: the actual set of rows stored at one moment. | ____ has 3 rows with A = 1, 2, 3
n_r
Number of rows (records) in relation r. | A key of R, B key of S: the join has at most ____ rows
V(A, r)
Number of distinct values of attribute A in r. | A cannot be a key of r when ________ < n_r
min(n_r, n_s)
The smaller of the two row counts. | B key of both R and S: the join has at most ________ rows
Key
Attribute (or set of attributes) whose value is never repeated in the relation, so it identifies one row. | B is a ____ of R, so each row of s finds at most one partner in r
'B', 'Budapest' (quoted value)
A constant: a fixed value written inside a condition. | σ_City= ________ (Person)
All − Bad (double difference)
Pattern for "every": build the bad cases with a difference, then subtract them from all cases. | π_MEAL( SELLS ____ B )