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.
 

A department store manages a table that contains the monthly profits of its various departments. Each row specifies the month, the department, and the total profit. The store manages 4 departments: Sports & Entertainment, Health & Beauty, Watches, and Toys & Hobbies.


CREATE TABLE store_revenues     
(sr_date date,     
sr_department varchar(50),    
sr_amount decimal)    
GO

Would you like to read more?