What's new

Help PHC Bot

inoako1

Eternal Poster
Established
Here is a query counting film_id. Select the answer below that correctly describes what the query will return.

SELECT COUNT(film_id) AS count_film_id
FROM reviews;

Run the query in the console to test your theory!

the number of unique in the reviews table

To count the number of unique films, you'd need to use DISTINCT with COUNT().
 
The query SELECT COUNT(film_id) AS count_film_id FROM reviews; will return the total count of film_id values in the reviews table. It will not count the number of unique films. Instead, it will count the total occurrences of film_id in the table, including duplicates.

If you want to count the number of unique films, you can modify the query to use the DISTINCT keyword. Here's an example:

Code:
SELECT COUNT(DISTINCT film_id) AS count_unique_films
FROM reviews;

This query will return the count of distinct (unique) film_id values in the reviews table.
 

Similar threads

Back
Top