Multisets and aggregation Flashcards
The multiplicity of an element describes its…
number of occurences
______ on bags keeps duplicates
projection
cartesian product on bags concatenates _______ as many times as they occur
tuples
selection takes all occurences of tuples satisfying the _______
condition
epsilon removes ______
duplicates
____ adds multiplicities
union
intersection takes the _______ multiplicity
minimum
difference ______ multiplicities up to zero
subtracts
SELECTα
πα(·)
SELECT DISTINCT α
ε(πα(·))
Q1 UNION ALL Q
Q1∪Q2
Q1 UNION Q2
ε(Q1∪Q2)
What are the 5 aggregate function in SQL?
COUNT, AVG, SUM, MIN, MAX
What does GROUP BY do?
groups all common entries
What is the order of evaluation in SQL (6 step)
FROM, WHERE, GROUP BY, AGGREGATES, HAVING, SELECT