CREATE TABLE users (
user_id INT PRIMARY KEY,
signup_date DATE,
country VARCHAR(50)
);
INSERT INTO users (user_id, signup_date, country) VALUES
(1, '2023-01-01', 'USA'),
(2, '2023-01-15', 'Canada'),
(3, '2023-02-01', 'USA'),
(4, '2023-02-15', 'UK'),
(5, '2023-03-01', 'Australia');
CREATE TABLE purchases (
purchase_id INT PRIMARY KEY,
user_id INT,
purchase_date DATE,
purchase_amount DECIMAL(10, 2),
FOREIGN KEY(user_id) REFERENCES users(user_id)
);
INSERT INTO purchases (purchase_id, user_id, purchase_date, purchase_amount) VALUES
(1, 1, '2023-03-01', 120.00),
(2, 1, '2023-03-10', 80.00),
(3, 2, '2023-03-05', 200.00),
(4, 2, '2023-03-15', 100.00),
(5, 3, '2023-03-07', 150.00),
(6, 4, '2023-03-10', 130.00),
(7, 5, '2023-03-15', 120.00),
(8, 3, '2023-03-20', 100.00),
(9, 4, '2023-03-25', 200.00),
(10, 5, '2023-03-30', 300.00);