-- Kolo Bank: Views --
USE KoloBank1;
GO
CREATE VIEW Accounts.DepositsSummary
AS
SELECT LocationCode,
EmployeeNumber,
AccountNumber,
TransactionDate,
TransactionTime,
CurrencyType,
DepositAmount,
Balance
FROM Accounts.Transactions
WHERE TransactionType = N'Deposit';
GO
CREATE VIEW Accounts.WithdrawalsSummary
AS
SELECT LocationCode,
EmployeeNumber,
AccountNumber,
TransactionDate,
TransactionTime,
CurrencyType,
WithdrawalAmount,
HasEnoughFunds,
Balance
FROM Accounts.Transactions
WHERE TransactionType = N'Withdrawal'
GO
CREATE VIEW Accounts.Charges
AS
SELECT LocationCode,
EmployeeNumber,
AccountNumber,
TransactionDate,
TransactionTime,
CurrencyType,
ChargeAmount,
ChargeReason,
Balance
FROM Accounts.Transactions
WHERE TransactionType = N'Service Charge';
GO
CREATE VIEW Accounts.ChecksCashing
AS
SELECT LocationCode,
EmployeeNumber,
AccountNumber,
TransactionDate,
TransactionTime,
CurrencyType,
CheckNumber,
CheckAmount,
HasEnoughFunds,
Recipient,
Balance
FROM Accounts.Transactions
WHERE TransactionType = N'Check Cashing';
GO