Back to problems

Server Utilization Time

SQL · Amazon · Medium

Problem You have access to a log table named server_utilization that records every time a server session begins or ends. Table: server_utilization There is no primary key on this table. Each row captures a single server status event. The column session_status holds exactly one of two values: 'start' or 'stop'. For every server, start and stop events are guaranteed to be properly paired. Your task is to write a SQL query that computes the total uptime of all servers in…

Checking your access…