wiki:dmlScript.sql

Version 2 (modified by 211101, 5 weeks 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 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, date, tag_id) VALUES 
('Bought groceries', 1000.00, 800.00, '2024-11-23 13:51:35+02:00', 1),
('Paid rent', 15000.00, 15000.00, '2024-11-01 17:01:41+02:00', 5),
('Dinner with friends', 2500.00, 1500.00, '2024-11-29 22:02:22+02:00', 2),
('Movie tickets', 600.00, 600.00, '2024-11-30 17:38:00+02:00', 4),
('Electricity bill', 1200.00, 1200.00, '2024-11-02 07:03:35+02:00', 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

INSERT INTO tag_assigned_to_transaction (tag_id, transaction_id) VALUES
(1, 1),
(5, 2),
(2, 3),
(4, 4),
(5, 5);
Note: See TracWiki for help on using the wiki.