Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
- Counting Results 4:41
- Counting Results 2 objectives
- Counting Groups of Rows 2:21
- Counting Groups 2 objectives
- Getting the Grand Total 5:31
- Summing Values 1 objective
- Calculating Averages 2:01
- Averaging Values 1 objective
- Getting Minimum and Maximum Values 2:08
- Calculating the Minimum and Maximum Values 1 objective
- Performing Math on Numeric Types 4:35
- Performing Math 1 objective
- Practice Session 2:31
- Review: Aggregate and Numeric Functions 5 questions
Start a free Courses trial
to watch this video
![](https://videos.teamtreehouse.com/stills/TH-ReportingWithSQL-Stage3-Video1-stills-0.jpg?token=6991db06_3a47f485ecaaa22316e98641468a99a7a9f5ebf3)
- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
Counting the number of rows is great for answering questions such as "How many users do we have?" and "How many sales happened this week?".
To count rows you can use the COUNT()
function.
SELECT COUNT(*) FROM <table>;
To count unique entries use the DISTINCT
keyword too:
SELECT COUNT(DISTINCT <column>) FROM <table>;
Cheat Sheets
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
PLUS
Rushabha Jain
Front End Web Development Techdegree Student 9,859 Points1 Answer
-
Atul Varma
4,285 Points2 Answers
-
james white
78,399 Points0 Answers
-
james white
78,399 Points6 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up