- 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: Aggregates & NULL
Aggregate functions quietly skip NULL, which can change an average or turn a total into NULL. This SQL quiz tests those rules, the empty-result case and how COALESCE gives you the numbers you expect.
Domanda di esempio
Domanda 1 di 10What does this query return?
CREATE TABLE scores (student TEXT, points INTEGER);
INSERT INTO scores VALUES ('Ana', 10), ('Ben', NULL), ('Cy', 20), ('Dee', NULL);
SELECT AVG(points) FROM scores;
Mostra la risposta
B. 15.0 AVG ignores NULLs, so it averages only 10 and 20: 30 / 2 = 15. SQLite prints it as 15.0. If the missing scores should count as 0, the answer would be 7.5.
Cosa copre questo quiz
SUM,AVG,MINandMAXignoreNULL- Why
AVG(points)can differ fromSUM(points) / COUNT(*) SUMof no rows isNULL,COUNTof no rows is 0- Treating missing values as zero with
COALESCE - How
GROUP BYhandlesNULLkeys
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.