Design a method that takes a genre, calls a (paginated) API returning movie titles and ratings for that genre, and returns the top-rated movie; on ties return the lexicographically smallest title. Asked in the Round 2 coding stage. The SQL data represents all pages already fetched. Rows with a NULL rating are ignored.
title and rating.Action genre.| Column | Type | Description |
|---|---|---|
| genre_idPK | INT | Unique genre identifier |
| genre_name | VARCHAR(100) | Genre name returned by the API request |
| Column | Type | Description |
|---|---|---|
| result_idPK | INT | Unique result row identifier |
| genre_id | INT | Genre associated with the API result |
| api_page | INT | Page number from the paginated API response |
| title | VARCHAR(200) | Movie title |
| rating | NUMERIC(3,1) | Movie rating on a ten-point scale |