Introduction to SQL with AI
Jasmin Ludolf
Senior Data Science Content Developer
Prompt: How many products do we have?
SELECT COUNT(*) AS total_count
FROM products;
|total_count|
|-----------|
|50 |
Prompt: How many products do we have?
SELECT COUNT(*)
FROM products;
|?count?|
|-------|
|50 |
Prompt: Count the number of rows in the products table
SELECT COUNT(*) AS total_count
FROM products;
|total_count|
|-----------|
|50 |
Prompt: How many products do we have?
SELECT COUNT(*) AS total_count
FROM products;
|total_count|
|-----------|
|50 |
Prompt: How many product names do we have?
SELECT COUNT(product_name) AS product_count
FROM products;
|product_count|
|-------------|
|49 |
Prompt: How many different categories do we sell?
SELECT COUNT(DISTINCT category) AS unique_categories
FROM products;
|unique_categories|
|-----------------|
|9 |
$$
COUNT(*)
:COUNT(field)
:DISTINCT
Introduction to SQL with AI