- Esecutori
-
Impara
Impara Python Esempi eseguibili, NumPy, pandas e altro Impara l'IA / Machine LearningReti neurali, ML e LLM da zero Impara C e C++ Puntatori, memoria, STL e C++ moderno Impara C#Fondamenti, OOP, LINQ, async ed esercizi .NET Impara MatplotlibGrafici a linee, barre, dispersione e torta con visualizzatori Impara RustOwnership, trait, gestione degli errori e thread Impara GoSlice, interfacce, goroutine e canali Algoritmi Python Ricerca, ordinamento, ricorsione e visualizzazioni O(n) Algoritmi C e C++ Confronta le implementazioni in C e C++ Programmazione per bambini Impara a programmare giocando!
- QuizNuovo
- SfideNuovo
- Per docentiNuovo
- Aggiornamenti
- Offrimi un caffè
Quiz di SQL: HAVING
This SQL quiz is about HAVING, the filter that runs after rows are grouped. You will predict which groups survive, combine WHERE and HAVING in one query and learn when to use which.
Domanda di esempio
Domanda 1 di 10What does this query return?
CREATE TABLE sales (region TEXT, rep TEXT, amount INTEGER);
INSERT INTO sales VALUES ('North', 'Ana', 100), ('South', 'Ben', 200), ('North', 'Cy', 50), ('South', 'Ana', 70), ('East', 'Dee', 30);
SELECT region FROM sales GROUP BY region HAVING SUM(amount) > 100 ORDER BY region;
Mostra la risposta
B. North
South The totals are East 30, North 150 and South 270. HAVING keeps only groups whose total is over 100: North and South. Note that North passes even though none of its single rows is over 100.
Cosa copre questo quiz
- Filtering groups with
HAVING WHERE(rows, before grouping) vsHAVING(groups, after)- Using
WHEREandHAVINGin the same query - Conditions on aggregates that are not in the
SELECTlist - Portable
HAVINGwithout column aliases
Domande frequenti
Serve un account?
No. Chiunque può giocare. Accedi per salvare XP, serie, badge e cronologia.
Posso rifarlo?
Sì. Il tuo miglior punteggio resta salvato, e domande e risposte vengono mescolate ogni volta.