❓ Help PHC Bot

inoako1

Elite
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.
 

About this Thread

  • 1
    Replies
  • 228
    Views
  • 1
    Participants
Last reply from:
Unknown user

Trending Topics

Online now

Members online
1,171
Guests online
905
Total visitors
2,076

Forum statistics

Threads
2,273,762
Posts
28,951,397
Members
1,234,947
Latest member
brixxxxxx
Back
Top