wiki:dmlScriptVer1.sql

Version 1 (modified by 211101, 20 hours ago) ( diff )

--

INSERT INTO USER (user_name, email, password) VALUES
('John Doe', 'john@example.com', 'password123'),
('Jane Smith', 'jane@example.com', 'securepass'),
('Alice Johnson', 'alice@example.com', 'alicepwd');

INSERT INTO YEAR (year_name) VALUES
(2023),
(2024),
(2025);

INSERT INTO MONTH (year_id, month_name) VALUES
(1, 'January'),
(1, 'February'),
(1, 'March'),
(2, 'January'),
(2, 'February');

INSERT INTO DAY (month_id, day_number, day_name) VALUES
(1, 1, 'Sunday'),
(1, 2, 'Monday'),
(1, 3, 'Tuesday'),
(2, 1, 'Wednesday'),
(2, 2, 'Thursday');

INSERT INTO TAG (tag_name) VALUES
('Food'),
('Work'),
('Groceries'),
('Entertainment'),
('Bills');

INSERT INTO TRANSACTION_ACCOUNT (account_name, balance, user_id) VALUES
('Cash', 5000.00, 1),
('Bank Account', 20000.00, 1),
('Credit Card', -1000.00, 2),
('Savings', 15000.00, 2),
('Foreign Currency', 300.00, 3);

INSERT INTO TRANSACTION (transaction_name, amount, net_amount, day_id, tag_id) VALUES
('Bought groceries', 1000.00, 800.00, 1, 1),
('Paid rent', 15000.00, 15000.00, 2, 5),
('Dinner with friends', 2500.00, 1500.00, 3, 2),
('Movie tickets', 600.00, 600.00, 4, 4),
('Electricity bill', 1200.00, 1200.00, 5, 5);

INSERT INTO TRANSACTION_BREAKDOWN (transaction_id, transaction_account_id, spent_amount, earned_amount) VALUES
(1, 1, 1000.00, 200.00),  -- Spent 1000 on Cash, earned back 200
(1, 2, 0.00, 800.00),     -- Earned back 800 on Bank Account
(2, 2, 15000.00, 0.00),   -- Spent 15000 on Bank Account for rent
(3, 1, 2500.00, 1000.00), -- Spent 2500 on Cash, earned back 1000
(4, 3, 600.00, 0.00);     -- Spent 600 on Credit Card for movie
Note: See TracWiki for help on using the wiki.