Your question is SQL Ranking by Salary. 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.
Intuit wants a compensation view for employees supporting TurboTax, QuickBooks, and Credit Karma. Write a PostgreSQL query that joins employee records to salary records and ranks employees by salary within each company.
employee_id and include only employees with a non-null salary record.RANK(), with the highest salary receiving rank 1. Employees with equal salaries must share the same rank.| Column | Type | Description |
|---|---|---|
| employee_idPK | INTEGER | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee's full name |
| company_name | VARCHAR(50) | Intuit product company or business unit |
| Column | Type | Description |
|---|---|---|
| salary_idPK | INTEGER | Unique salary record identifier |
| employee_id | INTEGER | Employee associated with the salary record |
| annual_salary | NUMERIC(12,2) | Annual salary amount in US dollars |