Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Longest Shift per Employee

Return each employee's longest shift in hours rounded to one decimal. Order by employee.

Table schema

Shifts(id INT PRIMARY KEY, employee VARCHAR(10), start_time TIMESTAMP, end_time TIMESTAMP)

Sample data

id | employee | start_time | end_time
1 | Amy | 2026-10-01 09:00 | 2026-10-01 17:00
2 | Amy | 2026-10-02 08:00 | 2026-10-02 12:00
3 | Ben | 2026-10-01 10:00 | 2026-10-01 18:30

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.