Problem
HR is preparing long-service awards and needs to know how long each employee has been with the company. Using the employees table, return name, hired_at, and tenure_years (complete years since hire), ordered from longest to shortest tenure.
Schema
employees
| column | type |
|---|
| id | INTEGER |
| name | TEXT |
| department | TEXT |
| salary | INTEGER |
| hired_at | DATE |
Sample Data
| id | name | department | salary | hired_at |
|---|
| 1 | Alice | Engineering | 120000 | 2018-03-15 |
| 2 | Bob | Marketing | 80000 | 2021-07-01 |
| 3 | Carol | HR | 65000 | 2015-11-20 |
Expected Output (as of 2026-04-20)
| name | hired_at | tenure_years |
|---|
| Carol | 2015-11-20 | 10 |
| Alice | 2018-03-15 | 8 |
| Bob | 2021-07-01 | 4 |