Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems For Integration Of Media And User Environments 98

Authors: Yahiko Kambayashi, Akifumi Makinouchi, Shunsuke Uemura, Katsumi Tanaka, Yoshifumi Masunaga

1st Edition

9810234368, 978-9810234362

More Books

Students also viewed these Databases questions

Question

Explain the importance of nonverbal messages.

Answered: 1 week ago

Question

Describe the advantages of effective listening.

Answered: 1 week ago

Question

Prepare an employment application.

Answered: 1 week ago