Counting values
You suspect some customer records are incomplete. Rather than counting all records, you want to know how many customers have a value in the country field.
Count only customers that include country data to check data completeness.
This exercise is part of the course
Introduction to SQL with AI
Exercise instructions
- Describe what you want to see so the AI generates a query that counts only customers who have a value in the country field.
- Include a label for the result using the alias
country_count
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
SELECT COUNT(*) AS total_count
FROM customers;