Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara How many? | Selecting
SQL Basics

book
How many?

What if you want to know the exact number of observations in your database? Counting manually sounds like a very very bad idea.

Fortunately, SQL has the built-in functionality of counting rows. To count the number of rows in the whole dataset use COUNT *. For example, we can count the total number of our website being visited by using the following query:

SELECT COUNT(*)
FROM visitors
12
SELECT COUNT(*) FROM visitors
copy

Please note, that for counting the total number of rows you must place * within parenthesis, like COUNT(*).

Compito

Swipe to start coding

Count number of Audi cars sold from audi_cars table.

Soluzione

SELECT COUNT(*)
FROM audi_cars

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 1. Capitolo 6

Query ResultQuery Result
No query executed yet...

Chieda ad AI

expand
ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

some-alt