Created
October 18, 2018 04:11
-
-
Save PantherHawk/0cedfc5513f0e9fbff47d8c1076fcfc9 to your computer and use it in GitHub Desktop.
some sql to make a bank, just a way to save stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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