How often do you use SQL in your current job?
Asked in the HR Phone Screen stage. The recruiter is checking the candidate's technical skill set. For the practical follow-up, use the supplied employee and SQL activity tables to summarize SQL usage for current employees.
Write a SQL query that counts each current employee's SQL activity records and assigns a frequency category.
employee_name, sql_usage_count, and usage_frequencyemployee_nameemployee_name values produce separate rows.usage_id values, producing 0 when none exist.Never to 0, Rarely to counts 1 through 2, Sometimes to 3 through 7, and Frequently to counts 8 or higher.employee_name in ascending order without an additional tie-breaker for duplicate names.| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee's full name |
| department | VARCHAR(100) | Employee department |
| is_current | BOOLEAN | Whether the employee currently holds the job |
| Column | Type | Description |
|---|---|---|
| usage_idPK | INT | Unique SQL activity record identifier |
| employee_id | INT | Employee associated with the SQL activity |
| usage_date | DATE | Date of the SQL activity |
| tool_name | VARCHAR(100) | Tool used for the SQL activity |