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 specifies transactions in the bank account of various clients. Each row specifies the transaction date, client number, client name, transaction type (D indicates Deposit and W indicates Withdraw), and the transaction’s sum.


CREATE TABLE account_actions
(a_date date,
c_id int,
c_name varchar(25),
c_action varchar(1),
c_amount int)
GO

Would you like to read more?