select device_name,location_code,s_kwh as total_usage, case when s_kwh>=50 then 'High Load' else 'Normal' end as efficiency_level from (select new.device_id,device_name,upper(replace(location,' ','_')) location_code,s_kwh, avg(s_kwh) over(partition by category) avg_kwh from (select device_id,sum(...