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 company that markets its products online, is using the following table to store all sales that took place in the years 2001-2002. As you can see, this table is composed of two columns – purchase date and the purchase amount.
CREATE TABLE Purchases (PurchaseDate varchar(25), SoldAmount int) GO