Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn How many? | Selecting
SQL Basics
Sectionย 1. Chapterย 6
single

single

bookHow many?

Swipe to show menu

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:

12
SELECT COUNT(*) FROM visitors
copy

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

Task

Swipe to start coding

Count number of Audi cars sold from audi_cars table.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Sectionย 1. Chapterย 6
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt