Company: Meesho_6aug
Difficulty: medium
Problem Description You are given a table named library that contains information about various books. Write a SQL query to determine the highest-rated book (or books) for every year. Schema Table: library id (INT): The unique identifier for the book. title (VARCHAR): The name of the book. rating (DECIMAL): The rating of the book (out of 5.00). years (INT): The publication year of the book. Required Output Your query should return the result set with the following columns in this exact order: id title rating years Ordering and Tie-Breaking Requirements: If there are multiple books tied for the highest rating in a given year, include all of them in the result. Order the final output by years in ascending order (oldest to latest). If there is a tie in the same year, order those tied records by id in ascending order. Constraints or Notes Assume rating and years are never NULL. Time Limit: 5 sec(s) for each input file Memory Limit: 256 MB Source Limit: 1024 KB Allowed Languages: MySQL, Pos