Friday, 22 May 2015

Weekend Challenge for software developer and SQL developer !!!! (Asked in Interview)

Hello All,
This is one of the interview question asked from me.
Hope this will help you to write some tricky query.Try this!!!


Fuel in ltr    |        Date
--------------------------------
11          | 10/01/15
--------------------------------
09          | 11/01/15
--------------------------------
15          | 12/01/15
--------------------------------
12          | 13/01/15
--------------------------------
08          | 14/01/15
--------------------------------
13          | 15/01/15
--------------------------------
10          | 16/01/15
--------------------------------
16          | 17/01/15



Above table shows quantity of fuel in car on date like 11 ltr on date 10, 9 ltr on date 11, 15 ltr on date 12 and so on.
See row 3rd,  fuel become 15 from 9, means car owner refill 6 ltr fuel on date 12.
Challenge is that you have to find all rows with date and quantity of refill fuel on that date.

Ans should be like that :


Fuel in ltr    |        Date
--------------------------------
06          | 12/01/15
--------------------------------
05          | 15/01/15
--------------------------------
06          | 17/01/15


Please comment your answer.



No comments:

Post a Comment