Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
You could trivially create a view that wraps the media table and includes a column that indicates if the media entry has more than one file associated with it. CREATE VIEW IF NOT EXISTS "media_rea...
Answer
#1: Initial revision
You could trivially create a view that wraps the `media` table and includes a column that indicates if the media entry has more than one file associated with it. ```sql CREATE VIEW IF NOT EXISTS "media_read" AS SELECT "media".*, count("file"."uuid") > 1 AS "is_multifile" FROM "media" LEFT JOIN "file" ON "media_uuid" = "media"."uuid" GROUP BY "media"."uuid"; ```