84. Calculating Profit

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)    

To read more

UpScale Analytics is one of the largest platforms in the world for learning SQL by doing, consisting over 300 SQL exercises at different levels (including solutions), by topics, across over 100 different datasets. More…