CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Explain the data base design for Model-I for producing the receipts the series of SQL statements for producing the payment side of cash book for Model-II.

Open in App
Solution

The following series of SQL statement retrieve a record set of producing the payment side of cash book of Model II.
(1) SELECT Narration, Acc-code As Code Amount
FROM vouchers As v, Details As D
WHERE tType=1 AND V.VNO=D.VNO
AND Acc-code like "141*".

(2) SELECT Narration, Code, Amount
FROM vouchers As v, Details As D
WHERE tType = 0 AND V.VNO = D.VNO
AND Code Like "141*".

(3) SELECT Narration, Acc-code As Code Amount
FROM vouchers As v, Details As D
WHERE tType=1 AND V.VNO=D.VNo
AND Acc-code Like "141*".
UNION
SELECT Narration, Code, Amount
FROM vouchers As v, Details As D
WHERE tType=0 AND V. VNO=D.VNo
AND Acc-code like "141*".
This SQL statement is source as Query D1

(4) SELECT Code, Sum (Amount) As Total
FROM Query D1
GROUP BY Code
This SQL statement is saved as Query D2.

(5) SELECT a.Code b.Name As [Name of Account],
IIF (a.total>0, a total Null) As Amount
FROM Query D2 As a, Account As b
WHERE a code=b code


flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Bank Reconciliation Part 1
ACCOUNTANCY
Watch in App
Join BYJU'S Learning Program
CrossIcon