Files
marketdata/Database/MonthlyUpdate.txt
2024-02-22 14:48:01 -05:00

117 lines
4.1 KiB
Plaintext

operations
1) MK LOADFUNDAMENTALS MK LOADFUNDAMENTALSFINVIZ
2) MK LOADFINANCIALSTATEMENTS (INCOMESTATEMENT, BALANCESHEET, CASHFLOWSTATEMENT)
3) MK LOADHISTORICAL
use market_data;
FUNDAMENTALS CHECK
with CTE AS(
select asof,count(*) from fundamentals group by 1 order by 1 desc
)
SELECT * FROM CTE
select * from fundamentals where asof='2019-08-20'
update fundamentals set asof='2019-08-19' where asof='2019-08-20' and symbol <> 'TAK'
select symbol from fundamentals where asof='2019-8-20' and symbol in (select symbol from fundamentals where asof='2019-08-19')
delete from fundamentals where asof='2019-08-20' and symbol='TAK'
select symbol from fundamentals where asof='2019-07-15' and symbol not in (select symbol from fundamentals where asof='2019-8-19')
select * from fundamentals where symbol='aapl' and asof='2019-08-19'
delete from fundamentals where symbol='aapl' and asof='2019-08-19'
FINANCIAL STATEMENT CHECK
select modified,count(*) from incomestatement group by 1 order by 1 desc
select modified,count(*) from balancesheet group by 1 order by 1 desc
select modified,count(*) from cashflowstatement group by 1 order by 1 desc
select asof,count(*) from fundamentals group by 1 order by 1 desc
select modified,count(*) from incomestatement
operations
1) MK LOADFUNDAMENTALS MK LOADFUNDAMENTALSFINVIZ
2) MK LOADFINANCIALSTATEMENTS (INCOMESTATEMENT, BALANCESHEET, CASHFLOWSTATEMENT)
3) MK LOADHISTORICAL
FUNDAMENTALS CHECK
select asof,count(*) from fundamentals group by 1 order by 1 desc
FINANCIAL STATEMENT CHECK
select modified,count(*) from incomestatement group by 1 order by 1 desc
select modified,count(*) from balancesheet group by 1 order by 1 desc
select modified,count(*) from cashflowstatement group by 1 order by 1 desc
select asof,count(*) from fundamentals group by 1 order by 1 desc
select modified,count(*) from incomestatement group by 1 order by 1 desc
select modified,count(*) from balancesheet group by 1 order by 1 desc
select modified,count(*) from cashflowstatement group by 1 order by 1 desc
select asof,count(*) from historical group by 1 order by 1 desc
***************************************************************************
select * from fundamentals limit 10
select distinct(asof) from fundamentals order by 1 desc
--delete from fundamentals where asof='2018-08-14'
select * from fundamentals where asof='2018-08-14';
select * from securitymaster where security_type <>'EQUITY'
select * from securitymaster where SYMBOL='^GSPC'
SELECT DISTINCT(SECURITY_TYPE) FROM SECURITYMASTER
select * from companyprofile
select max(modified) from incomestatement limit 100
select distinct(modified) from incomestatement order by 1 desc
select * from fundamentals where symbol='MIDD' and asof='2018-08-14';
select count(*) from fundamentals where asof in('2018-08-14','2018-08-15');
SELECT * FROM INCOMESTATEMENT WHERE SYMBOL='IBM' ORDER BY ASOF DESC
select count(*) from fundamentals where asof in('2018-08-14');
--delete from fundamentals where asof='2018-08-14'
select count(*) from fundamentals where asof in('2018-08-15');
SELECT (5166/5699)*100
select count(*) from fundamentals where asof='2018-07-15';
select count(*) from fundamentals where asof='2018-06-17';
select * from fundamentals where asof='2018-06-17' and symbol not in (select symbol from fundamentals where asof='2018-07-15')
select count(*) from incomestatement where modified='2018-08-16';
select count(*) from incomestatement where modified='2018-07-15';
select count(*) from balancesheet where modified='2018-08-15';
select count(*) from balancesheet where modified='2018-07-15';
select count(*) from cashflowstatement where modified='2018-08-15';
select count(*) from cashflowstatement where modified='2018-07-15';
--
select count(*) from incomestatement where modified='2018-08-16';
select count(*) from incomestatement where modified='2018-07-15';
select count(*) from balancesheet where modified='2018-08-16';
select count(*) from balancesheet where modified='2018-07-15';
select count(*) from cashflowstatement where modified='2018-08-16';
select count(*) from cashflowstatement where modified='2018-07-15';