Server Fleet Utilization Analysis
A cloud provider tracks server uptime through a series of status logs. You are given a table
server_utilization with columns server_id (int), status_time (timestamp), and session_status (string, either 'start' or 'stop'). Each server can start and stop multiple times throughout the period. Calculate the total uptime for the entire fleet of servers. The result should be returned as the total number of full days (24-hour periods) of cumulative uptime across all servers, rounded down to the nearest integer. Ensure your solution accounts for the chronological order of events per server and correctly pairs start events with their subsequent stop events.SnowflakeWindow FunctionCTELEAD
00