- 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: COUNT(*) vs COUNT(column)
COUNT(*), COUNT(column) and COUNT(DISTINCT column) look alike but count different things. This SQL quiz tests how each one treats NULL, empty strings and duplicates, with a classic trap or two.
Domanda di esempio
Domanda 1 di 10What does this query return?
CREATE TABLE customers (name TEXT, email TEXT, phone TEXT);
INSERT INTO customers VALUES ('Ana', 'a@x.com', NULL), ('Ben', NULL, NULL), ('Cy', 'c@x.com', '555'), ('Dee', 'a@x.com', NULL);
SELECT COUNT(*), COUNT(email) FROM customers;
Mostra la risposta
D. 4|3 COUNT(*) counts all 4 rows. COUNT(email) skips the row where email is NULL, so it returns 3.
Cosa copre questo quiz
COUNT(*)counts rows,COUNT(column)counts non-NULL valuesCOUNT(DISTINCT column)and duplicatesCOUNT(1)is the same asCOUNT(*)- Finding missing values with
COUNT(*) - COUNT(column) - Empty strings are not
NULL
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.