LISTING 3: Creating Views That Return Transaction Details and Amount Positions CREATE VIEW VTrans1 AS SELECT account_id, tran_id, amount, (SELECT COUNT(*) FROM Trans1 AS T1B WHERE T1B.account_id = T1.account_id AND T1B.amount = T1.amount AND T1B.tran_id <= T1.tran_id) AS position FROM Trans1 AS T1 GO CREATE VIEW VTrans2 AS SELECT account_id, tran_id, amount, (SELECT COUNT(*) FROM Trans2 AS T2B WHERE T2B.account_id = T2.account_id AND T2B.amount = T2.amount AND T2B.tran_id <= T2.tran_id) AS position FROM Trans2 AS T2 GO