Your question is SQL Seventh Row Query. Start with the requirements and the two tables 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.
Jefferies' trade surveillance reporting needs to inspect the seventh completed execution in a deterministic sequence. Write a PostgreSQL query that returns the seventh eligible execution ordered by execution time, with the execution ID as a tie-breaker.
status = 'COMPLETED'.ROW_NUMBER() ordered by executed_at ASC, execution_id ASC.| Column | Type | Description |
|---|---|---|
| execution_idPK | BIGINT | Unique execution identifier |
| executed_at | TIMESTAMP | Execution timestamp |
| symbol | VARCHAR(20) | Traded security symbol |
| quantity | INTEGER | Number of shares executed |
| trader_id | INTEGER | Trader identifier |
| status | VARCHAR(20) | Execution status |
| Column | Type | Description |
|---|---|---|
| trader_idPK | INTEGER | Unique trader identifier |
| trader_name | VARCHAR(100) | Trader's name |
| desk | VARCHAR(50) | Jefferies trading desk |