wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Briefly explain the set of SQL statements to produce the receipts side of a cash book for Model - I.

Open in App
Solution

The following series of SQL statement retrieve a record set for producing the receipts side of cash book for Model-I
(i) To find the total amount by which the cash account is debited.
In order to ascertain the total amount by which every transaction cash account has been debited, the following SQL statement is formed.
SELECT Credit AS Code, Amount, Date
FROM Vouchers
WHERE Debit Like "631"
This SQL Statement gives the code and amount from which cash is received. This SQL statement is saved as Query Cl.
(ii) To generate the total of Receipt side. The following SQL Statement is formed
SELECT Code Sum (Amount) AS Total
FROM Query Cl
GROUP BY Code
This SQL statement is save as Query C2
(iii) To find the record set which consist of account code, Name of account, credit amount and date. The following SQL Statement is formed.
SELECT a. code b. Name AS {Name of Account},. IIF (a=Total>0,a.Total, null AS Amount)
FROM Query C2 AS a Accounts AS b. Where a code = b code.

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Ordered Pair
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon