Cấu trúc bảng+
CREATE TABLE subscribers (
id integer PRIMARY KEY,
name text NOT NULL,
signup_date date NOT NULL,
country text NOT NULL
);
CREATE TABLE subscriptions (
id integer PRIMARY KEY,
subscriber_id integer NOT NULL REFERENCES subscribers(id),
plan text NOT NULL,
started_on date NOT NULL,
ended_on date,
monthly_price numeric(12, 2) NOT NULL
);
CREATE TABLE payments (
id integer PRIMARY KEY,
subscription_id integer NOT NULL REFERENCES subscriptions(id),
paid_on date NOT NULL,
amount numeric(12, 2) NOT NULL,
status text NOT NULL
);