Courses
SQL for Beginners: Ask Your Data Straight Questions
Check Yourself: Summaries
Five scenario questions on count, average, NULL, integer division, GROUP BY and HAVING. If you miss more than one, reread the lessons in this section.
Course content
Join this Course
Sign in to save your progress.
-
Before You Write a Query
-
What a Relational Database Is and Why SQL Exists
-
Set Up PostgreSQL and Run Your First Query
-
-
-
Asking for Rows
-
SELECT, WHERE, ORDER BY and LIMIT
-
NULL Is Not a Value
-
-
-
Building and Changing Data
-
CREATE TABLE: Types and Constraints That Matter
-
INSERT, UPDATE and DELETE Without Regret
-
-
-
Summaries
-
COUNT, SUM and AVG
-
GROUP BY and HAVING
-
-
-
Combining Tables
-
Primary Keys, Foreign Keys and Why Tables Are Split
-
INNER JOIN and LEFT JOIN
-
When a Join Gives Too Many Rows or Too Few
-
-
- Final Check: SQL for Beginners
1.
The customers table has 8 rows, and 6 of them have a city. What do count(*) and count(city) return?
2.
Three scores are 10, 20 and NULL. What does avg(score) return?
3.
In PostgreSQL, what does SELECT 7 / 2 return?
4.
SELECT name, count(*) FROM customers fails with column customers.name must appear in the GROUP BY clause or be used in an aggregate function. Why?
5.
You want customers who have at least 3 orders, using a count of orders per customer. Where does the condition on the count belong?
About
Five scenario questions on count, average, NULL, integer division, GROUP BY and HAVING. If you miss more than one, reread the lessons in this section.
- Duration
- 5 min
- Last update
- 09/21/2026
Was this helpful?
0
0
Comments (0)
Sign in to commentNo comments yet.