fbpx

76. Split Payments

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 invoices issued to different customers. For example, you can see that invoice no.1, which was issued on January 15th, totals 350 ILS, and its payment due date is no later than February 3rd. In addition, it is given that the maximal difference between the invoice issue date and the payment due date is 30 days.


CREATE TABLE Invoices
(invoiceID int identity(1,1),
invoiceAmount int,
sdate date,
edate date)
GO

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…