Your question is Top Error Sources in Coforge Logs. 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.
You are given a single PostgreSQL table that stores Coforge data pipeline log events. Write a query to return the top 3 source_system values with the highest number of rows where status = 'ERROR'. Show the source system and its error count, ordered by error count descending and then by source system ascending.
| Column | Type | Description |
|---|---|---|
| log_idPK | INT | Unique log row identifier |
| source_system | VARCHAR(50) | Upstream source system name |
| pipeline_name | VARCHAR(80) | Coforge pipeline name |
| status | VARCHAR(20) | Pipeline event status |
| records_processed | INT | Number of records processed in the event |
| event_date | DATE | Date of the pipeline event |