64 lines
5.1 KiB
C++
64 lines
5.1 KiB
C++
#pragma once
|
|
|
|
|
|
std::vector<std::string> k_debug_sql_commands {
|
|
// "create table history_earnings_dates (datetime date, symbol varchar(8), time varchar(18), title varchar(256))",
|
|
// "set 'DATE_FORMAT' = '%Y-%m-%d'",
|
|
// "load into history_earnings_dates '/Users/vaclavt/Development/mlisp_fin/data/history_earnings_dates.csv'"
|
|
// "insert into history_earnings_dates (symbol,time,datetime,title) values ('BABA', '07:00:00', '2021-11-04', 'Alibaba Group Holding')",
|
|
// "insert into history_earnings_dates (symbol,time,datetime,title) values ('BABA', '07:00:00', '2021-11-04', 'Alibaba Group Holding')",
|
|
// "delete from history_earnings_dates where symbol='BABA' and datetime=to_date('2021-11-04', '%Y-%m-%d')",
|
|
// "select * from history_earnings_dates"
|
|
|
|
"create table sf1 (symbol varchar(8) not null, dimension varchar(3), calendar_date date, date_key date, report_period date, last_updated date, accoci float, assets float, assetsavg float, assetsc float, assetsnc float, assetturnover float, bvps float, capex float, cashneq float, cashnequsd float, cor float, consolinc float, currentratio float, de float, debt float, debtc float, debtnc float, debtusd float, deferredrev float, depamor float, deposits float, divyield float, dps float, ebit float, ebitda float, ebitdamargin float, ebitdausd float, ebitusd float, ebt float, eps float, epsdil float, epsusd float, equity float, equityavg float, equityusd float, ev float, evebit float, evebitda float, fcf float, fcfps float, fxusd float, gp float, grossmargin float, intangibles float, intexp float, invcap float, invcapavg float, inventory float, investments float, investmentsc float, investmentsnc float, liabilities float, liabilitiesc float, liabilitiesnc float, marketcap float, ncf float, ncfbus float, ncfcommon float, ncfdebt float, ncfdiv float, ncff float, ncfi float, ncfinv float, ncfo float, ncfx float, netinc float, netinccmn float, netinccmnusd float, netincdis float, netincnci float, netmargin float, opex float, opinc float, payables float, payoutratio float, pb float, pe float, pe1 float, ppnenet float, prefdivis float, price float, ps float, ps1 float, receivables float, retearn float, revenue float, revenueusd float, rnd float, roa float, roe float, roic float, ros float, sbcomp float, sgna float, sharefactor float, sharesbas float, shareswa float, shareswadil float, sps float, tangibles float, taxassets float, taxexp float, taxliabilities float, tbvps float, workingcapital float)",
|
|
"set 'DATE_FORMAT' = '%Y-%m-%d'",
|
|
"create index sf1_symbol on sf1(symbol)",
|
|
"load into sf1 '/srv/SHARADAR_SF1.csv'",
|
|
// "set 'USE_INDEXSCAN' = 'true'",
|
|
"select distinct dimension from sf1 where symbol = 'ALLY'",
|
|
"select calendar_date, calendar_date, dimension from sf1 where symbol = 'ALLY' and dimension = 'MRQ' and calendar_date <= 1653487723 order by calendar_date desc limit 10",
|
|
// "set 'USE_INDEXSCAN' = 'false'",
|
|
// "select dimension, to_char(calendar_date, '%d.%m.%Y'), pp(eps, \"%.2f\"), pp(shareswadil), pp(revenue), pp(netinc), pp(cashneq), pp(assets), pp(debt), pp(ncfdebt), pp(roe*100), pp(intangibles), calendar_date from sf1 where symbol = 'MU' and dimension = 'ARQ' order by dimension, calendar_date desc limit 5",
|
|
// "set 'USE_INDEXSCAN' = 'true'",
|
|
// "select dimension, to_char(calendar_date, '%d.%m.%Y'), pp(eps, \"%.2f\"), pp(shareswadil), pp(revenue), pp(netinc), pp(cashneq), pp(assets), pp(debt), pp(ncfdebt), pp(roe*100), pp(intangibles), calendar_date from sf1 where symbol = 'MU' and dimension = 'ARQ' order by dimension, calendar_date desc limit 5",
|
|
// "select max(calendar_date), calendar_date from sf1 where symbol = 'MU' and dimension = 'ARQ'",
|
|
// "select max(calendar_date), min(calendar_date) from sf1 where symbol = 'MU' and dimension = 'ARQ'"
|
|
|
|
// "create table a (i integer not null, s varchar(64))",
|
|
// "create index a_i on a(i)",
|
|
// "insert into a (i, s) values(1, 'one')",
|
|
// "insert into a (i, s) values(2, 'two')",
|
|
// "insert into a (i, s) values(2, 'second two')",
|
|
// "insert into a (i, s) values(3, 'three')",
|
|
// "insert into a (i, s) values(4, 'four')",
|
|
// "insert into a (i) values(5)",
|
|
// "save a into '/tmp/a.csv'",
|
|
// "set 'USE_INDEXSCAN' = 'true'",
|
|
// "select * from a where 1 = i",
|
|
// "delete from a where i = 2 and s ='two'",
|
|
// "select * from a where i = 2",
|
|
// "update a set i = 5 where i = 2",
|
|
// "select * from a where i = 5",
|
|
// "select max(i) from a where s = 'two'",
|
|
// "select min(i), max(i), count(i) from a",
|
|
// "select i + 1000 from a",
|
|
// "select i, s from a where i = 5",
|
|
// "select i, s, coalesce(s, i) from a where i = 5",
|
|
|
|
// "create table a (i float, j float)",
|
|
// "insert into a (i, j) values(null, 123456789.12345)",
|
|
// "select pp(coalesce(i, j)) from a",
|
|
|
|
// "create table d (datetime date)",
|
|
// "insert into d (datetime) values(1648634993)",
|
|
// "select to_char(datetime, '%Y%m%d') from d",
|
|
// "select to_int(datetime) from d",
|
|
// "select max(to_char(datetime, '%Y%m%d')) from d",
|
|
// "select max(to_int(to_float(to_char(datetime, '%Y%m%d')))) from d",
|
|
|
|
// "select * from usql_tables",
|
|
// "select * from usql_columns",
|
|
// "select * from usql_indexes",
|
|
};
|
|
|