drop table if exists customers; create table customers ( id int not null auto_increment primary key, name varchar(80), password varchar(80), email varchar(80), -- other columns ); drop table if exists accounts; create table accounts ( number varchar(16) not null primary key, -- ignores BSB/number distinction name varchar(80) not null, customer_id int foreign key references customer(id), balance float(10,2) not null ); drop table if exists transfers; create table transfers ( id int not null auto_increment primary key, source_account foreign key references accounts(number), -- from-account destination_account foreign key references accounts(number), -- to-account 'time' timestamp not null, amount float(10,2) not null, description varchar(40) ); drop table if exists billers; create table billers ( code int not null, name varchar(40) not null, nickname varchar(40), customer_number int not null, primary_key (code, customer_number) ) drop table if exist payments; create table payments ( id int not null auto_increment primary key, source_account foreign key references accounts(number), -- from-account destination_biller foreign key references billers(code), -- to-biller 'time' timestamp not null, amount float(10,2) not null, )