19. Videos Without Comment Count
Solution ↗Tables: video_stats
+-------------------------+-------------+ | Column Name | Type | +-------------------------+-------------+ | video_id | varchar | | view_count | bigint | | like_count | bigint | | comment_count | bigint | +-------------------------+-------------+ video_stats contains performance metrics for each video. video_id is the primary key for this table and references videos.video_id.
Write a SQL query to count how many videos have a missing comment_count in video_stats.
Hint
Tip: IS NULL checks missing values.
Input:
video_stats table: +----------+------------+------------+---------------+ | video_id | view_count | like_count | comment_count | +----------+------------+------------+---------------+ | V1 | 1500000 | 91000 | 4200 | | V2 | 2500000 | 135000 | 6100 | | V3 | 3000000 | 150000 | 8000 | | V4 | 1000000 | 47000 | 2500 | | V5 | 800000 | 36000 | 1400 | +----------+------------+------------+---------------+
Output:
Output: +-------------------------+ | videos_without_comments | +-------------------------+ | 0 | +-------------------------+
Explanation:
All sample videos have comment counts, so the count is 0.