Total Server Fleet Uptime in Full Days
 

Using the 'playground.sessions' table, write a SQL query to calculate the total uptime of the server fleet in full days. The table records each server's start and stop times as separate entries. The total uptime ('total_uptime_days') is defined as the sum of all periods during which any server was running, represented as a single integer value for the total number of full days. Assume each 'start' session_status has a corresponding 'stop' status, and sessions do not overlap for the same server.

These are the tables to query for this question:
playground.sessions
  • session_id int
  • session_time date
  • session_status string
Your answer should include these columns:
  • total_uptime_days integer

Querying is only for logged in users!

Write Your Query Here (you can run selections by highlighting!)

Query Results

No queries have been run yet.