Symbols Relational Schema

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/25

encourage image

There's no tags or description

Looks like no tags are added yet.

26 Terms

1
New cards

σ (sigma)

Selection: keeps only the ROWS that satisfy a condition. | π_MODEL( ____ CPU>1.5 (PC) )

2
New cards

π (pi)

Projection: keeps only the listed COLUMNS and removes duplicate rows. | ____ MODEL( σ_CPU>1.5 (PC) )

3
New cards

× (times)

Cartesian product: pairs every row of R with every row of S. Result has n_r · n_s rows. | Answer = Left ____ Right

4
New cards

⋈ (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) )

5
New cards

⋈_θ (theta join)

Join with any condition (=, ≠,

6
New cards

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

7
New cards

θ (theta)

The condition of a join or a selection, for example R.B = S.B or CPU > 3. | R ⋈( ____ ) S = σ( ____ )(R × S)

8
New cards

∪ (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)

9
New cards

∩ (intersection)

Rows that are in R AND in S. Both relations must have the same columns. Used for "both". | Answer = π_Man( L ____ P )

10
New cards

− (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

11
New cards

÷ (division / quotient)

The tuples that are combined in R with EVERY tuple of S. Used for "every / all". | LIKES ____ π_MEAL(SELLS)

12
New cards

ρ (rho)

Rename: gives a new name to a relation or to its attributes, so the same table can be used twice. | U₁ = ____ U₁ (StarUniversity)

13
New cards

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 ( _ × __ ) )

14
New cards

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₂)

15
New cards

∧ (and)

Logical connective inside a condition: both parts must be true. | σ_( F₁.Man = F₂.Man ____ F₁.MODEL ≠ F₂.MODEL )(F₁ × F₂)

16
New cards

∨ (or)

Logical connective inside a condition: at least one part must be true. | σ_( City='Budapest' ____ City='London' )(Person)

17
New cards

¬ (not)

Logical connective inside a condition: the part after it must be false. | σ_( ____ (City='Budapest') )(Person)

18
New cards

≠ (not equal)

Comparison "different from". With two copies of a table it expresses "two distinct …". | S₁.Program = S₂.Program ∧ S₁.University ____ S₂.University

19
New cards

R(A, B)

Relation schema: the name of the relation followed by its attributes. | ________ and S(B, C) are joined on B

20
New cards

r

An instance of a schema: the actual set of rows stored at one moment. | ____ has 3 rows with A = 1, 2, 3

21
New cards

n_r

Number of rows (records) in relation r. | A key of R, B key of S: the join has at most ____ rows

22
New cards

V(A, r)

Number of distinct values of attribute A in r. | A cannot be a key of r when ________ < n_r

23
New cards

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

24
New cards

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

25
New cards

'B', 'Budapest' (quoted value)

A constant: a fixed value written inside a condition. | σ_City= ________ (Person)

26
New cards

All − Bad (double difference)

Pattern for "every": build the bad cases with a difference, then subtract them from all cases. | π_MEAL( SELLS ____ B )