This advanced SQL exercise is part of the book: Advanced SQL – Practical Techniques and Use-Cases, which includes 100 day-to-day SQL challenges (and solutions), need-to-know advanced features, and key concepts.

Given a table that displays the office maintenance costs of a certain company. The table specifies the city where the office is located, the monthly billing date, and the various costs (cleaning, equipment, and electricity).

 CREATE TABLE OfficeCosts    
     OfficeCity     VARCHAR(100)    
    ,BillDate       DATETIME    
    ,Cleaning       DECIMAL(8,3)    
    ,Equipment      DECIMAL(8,3)    
    ,Electricity    DECIMAL(8,3)    

Would you like to read more?