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.

Using the query that was written to resolve the previous exercise, add the Pivot command to display the sum of expenses by year in each city.

Would you like to read more?