Skip to content

Instantly share code, notes, and snippets.

@PantherHawk
Created October 18, 2018 04:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PantherHawk/0cedfc5513f0e9fbff47d8c1076fcfc9 to your computer and use it in GitHub Desktop.
Save PantherHawk/0cedfc5513f0e9fbff47d8c1076fcfc9 to your computer and use it in GitHub Desktop.
some sql to make a bank, just a way to save stuff
drop table users;
drop table role;
create table role
(id number primary key not null,
is_admin number not null);
create table users
(name varchar(20) not null,
passhash nvarchar2(20) not null,
id number(19, 0) not null,
user_id number primary key,
role_id number references role(id));
create table account_type
(id number primary key not null,
type varchar2(20) not null,
constraint check_type check (type in ('savings', 'checking', 'interest')));
--
--create table "user_accounts"
--(id number primary key not null,
--balance number,
--user_id number references user(id),
--account_type_id references account_type(id)
--);
create table transactions
(id number primary key not null,
message nvarchar2(500),
user_id number references user(id));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment