Skip to content

Instantly share code, notes, and snippets.

@ppiotrow
Created April 17, 2023 10:40
Show Gist options
  • Save ppiotrow/c2af9266bd6ea4bd360ca05730c304de to your computer and use it in GitHub Desktop.
Save ppiotrow/c2af9266bd6ea4bd360ca05730c304de to your computer and use it in GitHub Desktop.
create temporary table coding_interview_cash_flows(
flow_date DATE NOT NULL,
account VARCHAR (50) NOT NULL,
net_value NUMERIC (10, 2) NOT NULL
);
truncate table coding_interview_cash_flows;
insert into coding_interview_cash_flows VALUES('2021-11-23', 'COMP1_USD', -8000.00);
insert into coding_interview_cash_flows VALUES('2021-11-23', 'COMP2_USD', 5000);
insert into coding_interview_cash_flows VALUES('2021-11-24', 'COMP1_EUR', -13000);
insert into coding_interview_cash_flows VALUES('2021-11-25', 'COMP1_USD', 500000);
insert into coding_interview_cash_flows VALUES('2021-11-28', 'COMP2_USD', 10000);
insert into coding_interview_cash_flows VALUES('2021-12-23', 'COMP1_USD', -3000.00);
insert into coding_interview_cash_flows VALUES('2021-12-23', 'COMP2_USD', 50000);
insert into coding_interview_cash_flows VALUES('2021-12-24', 'COMP1_EUR', -9000);
insert into coding_interview_cash_flows VALUES('2021-12-24', 'COMP1_EUR', 900000);
insert into coding_interview_cash_flows VALUES('2021-12-25', 'COMP1_USD', 100000);
insert into coding_interview_cash_flows VALUES('2021-12-28', 'COMP2_USD', 20000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment