Write a SQL query to find the most recent maintenance log entry for each aircraft in a fleet at Airbus.
Use the aircraft and maintenance log data provided. Include aircraft that have no maintenance log, and resolve multiple logs at the same timestamp by selecting the greatest log ID.
aircraft_id.aircraft_id, registration, maintenance_log_id, performed_at, maintenance_type, and notes.| Column | Type | Description |
|---|---|---|
| aircraft_idPK | INT | Unique identifier for the aircraft |
| registration | VARCHAR(20) | Aircraft registration identifier |
| aircraft_model | VARCHAR(50) | Aircraft model designation |
| Column | Type | Description |
|---|---|---|
| maintenance_log_idPK | INT | Unique maintenance log identifier |
| aircraft_id | INT | Aircraft associated with the maintenance log |
| performed_at | TIMESTAMP | Date and time when maintenance was performed |
| maintenance_type | VARCHAR(50) | Category of maintenance performed |
| notes | TEXT | Technician notes about the maintenance |