accountDB
=========

connect 'jdbc:derby:accountDB;create=true';

create table accounts(
    number varchar(8) not null,
    balance int,
    primary key(number)
);

insert into accounts values ('ABC123', 1200), ('DEF456', 400);

drop table accounts;



bankDB

connect 'jdbc:derby:bankDB;create=true';

create table banks(
    id varchar(4) not null,
    name varchar(30),
    primary key(id)
);

create table accounts(
    id int generated always as identity,
    bankID varchar(4),
    number varchar(8),
    balance int,
    primary key(id),
    foreign key(bankID) references banks(id)
);

insert into banks(id, name) values('RBS', 'Rich Bank of Scotland'), ('BOS', 'Banque of Scotland');

insert into accounts(bankID, number, balance)
	values('RBS', 'ABC123', 1200),
	      ('RBS', 'DEF456', 400),
	      ('BOS', 'GHI789', 600);
	      
	      
	      
specialDB

create table accounts(
    id int generated always as identity,
    type varchar(10),
    number varchar(8),
    balance int,
    overdraftlimit int,
    interestrate int,
    primary key(id)
);

insert into accounts(type, number, balance, overdraftlimit, interestrate)
    values('CURRENT', 'AAA111', 2000, 400, NULL),
          ('CURRENT', 'BBB222', 3000, 800, NULL),
          ('DEPOSIT', 'CCC333', 4000, NULL, 4);
          