Answered step by step
Verified Expert Solution
Question
1 Approved Answer
People have the following ER model Movies have the following ER model Aliases for movies have the following ER model The above entities are linked
People have the following ER model Movies have the following ER model Aliases for movies have the following ER model The above entities are linked together as follows Write a PLpgSQL function that, given (part of) a person's name, displays that person's "filmography" Task Create the function Q12(partial_name text) returning SETOF text. Notes - A filmography is a list of films + character(s) played in each film - The result of this function is a sequence of text lines (setof text) - The first line of output should be person's name and year of birth/death - Order the list of films chronologically and then by title - If the person has not acted in any films, return "Has not acted" - Include the year along with the movie's title - Use ilike to match the person's name - If no matching name is found, return the string "No matching name" - If > 1 matching name exists, return the string "Ambiguous name" - If there is no entry for what role the person Plays, show "Actor" - If a person has played multiple roles in a movie, give a comma-separated list of roles - The roles in such a list should be in alphabetical order Sample output postgres-\# select \# from q12('xxyyzz'); q12 No matching name (1 row) postgres-\# select * from q12(xyz); q12 Alexyz Danine Kemp () Has not acted ( 2 rows) postgres-\# select * from q12 ('smith'); q12 Ambiguous name (1 row)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started