Company: Quicksell_13nov
Difficulty: medium
Problem Description You are managing a maintenance log for various devices in a facility. Each log entry records a device ID, the type of issue encountered, and the timestamp of when the issue was reported. Write an SQL query to find the most frequently occurring Issue_Type for each Device_ID . Schema The database contains a single table named Maintenance_Logs : CREATE TABLE Maintenance_Logs ( Log_ID INT, Device_ID INT, Issue_Type VARCHAR(255), Log_Time DATETIME ); Required Output The output must contain exactly 3 columns in the following order: Device_ID : The identifier of the device. Issue_Type : The most frequent issue type for that device. Issue_Count : The number of times this specific issue type occurred for the device. Constraints or Notes Only one row should be returned per Device_ID . If a device has multiple issue types with the same highest frequency (a tie), return the Issue_Type that comes first alphabetically. The final output must be ordered by Device_ID in ascending or