Your question is Top Weekly Error Codes. Start with the requirements and the one table on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
NovaCare wants a quick view of which application errors are happening most often in recent customer logs. Write a SQL query to find the most common error_code values from the last 7 days.
log_time.error_code is NULL.error_code and its occurrence count as error_count.error_count descending, then error_code ascending.| Column | Type | Description |
|---|---|---|
| log_idPK | INT | Primary key for each log entry |
| customer_id | INT | Customer associated with the log |
| log_time | TIMESTAMP | Timestamp when the log was recorded |
| log_level | VARCHAR(20) | Severity level of the log event |
| error_code | VARCHAR(20) | Application error code if present |
| message | TEXT | Raw log message |