Incomplete Streaming Catalog Records

Incomplete Streaming Catalog Records

You own data quality for a streaming service catalog. Every night, movie, series, and episode records are sent to search indexes and partner storefronts. A missing required field can make a title disappear from search or land in the wrong section. Every record must have title, content_type, language_code, and owner_team. A field is missing when it is NULL or becomes empty after trimming leading and trailing spaces. Find every catalog item with at least one missing required field and count how many required fields are missing. Return columns: - content_id — catalog item identifier, integer; - title — original title without modification, text or NULL; - content_type — original content type without modification, text or NULL; - language_code — original language code without modification, text or NULL; - owner_team — original owning team without modification, text or NULL; - missing_fields_count — number of missing required fields, integer from 1 to 4. Sort by missing_fields_count descending, then by content_id ascending. No rounding is required. Do not replace NULL values or clean the original values in the output. Exclude fully complete records. Use content_id to break ties in the missing-field count.

Expected output sample

This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables. Your answer must use the same column names as this sample — alias them with AS if needed.

content_idtitlecontent_typelanguage_codeowner_teammissing_fields_count
9NULLNULLNULLNULL4
7NULLmovieNULLcinema2
8Open WateresNULL2
PostgreSQLv16

Your query result will appear here

Focus radio
Paused · SomaFM · Fluid