-- Sharadar table schema: fundamentals (PostgreSQL) -- As of 2026-08-02 -- https://api.sharadar.com/v1.0/schema/fundamentals?format=postgres CREATE TABLE IF NOT EXISTS fundamentals ( ticker text NOT NULL, dimension text NOT NULL, calendardate date, date date NOT NULL, reportperiod date NOT NULL, fiscalperiod text, lastupdated date, accoci bigint, assets bigint, assetsavg bigint, assetsc bigint, assetsnc bigint, assetturnover double precision, bvps double precision, capex bigint, cashneq bigint, cashnequsd bigint, cor bigint, consolinc bigint, currentratio double precision, de double precision, debt bigint, debtc bigint, debtnc bigint, debtusd bigint, deferredrev bigint, depamor bigint, deposits bigint, divyield double precision, dps double precision, ebit bigint, ebitda bigint, ebitdamargin double precision, ebitdausd bigint, ebitusd bigint, ebt bigint, eps double precision, epsdil double precision, epsusd double precision, equity bigint, equityavg bigint, equityusd bigint, ev bigint, evebit bigint, evebitda double precision, fcf bigint, fcfps double precision, fxusd double precision, gp bigint, grossmargin double precision, intangibles bigint, intexp bigint, invcap bigint, invcapavg bigint, inventory bigint, investments bigint, investmentsc bigint, investmentsnc bigint, liabilities bigint, liabilitiesc bigint, liabilitiesnc bigint, marketcap bigint, ncf bigint, ncfbus bigint, ncfcommon bigint, ncfdebt bigint, ncfdiv bigint, ncff bigint, ncfi bigint, ncfinv bigint, ncfo bigint, ncfx bigint, netinc bigint, netinccmn bigint, netinccmnusd bigint, netincdis bigint, netincnci bigint, netmargin double precision, opex bigint, opinc bigint, payables bigint, payoutratio double precision, pb double precision, pe double precision, pe1 double precision, ppnenet bigint, prefdivis bigint, price double precision, ps double precision, ps1 double precision, receivables bigint, retearn bigint, revenue bigint, revenueusd bigint, rnd bigint, roa double precision, roe double precision, roic double precision, ros double precision, sbcomp bigint, sgna bigint, sharefactor double precision, sharesbas bigint, shareswa bigint, shareswadil bigint, sps double precision, tangibles bigint, taxassets bigint, taxexp bigint, taxliabilities bigint, tbvps double precision, workingcapital bigint, PRIMARY KEY (ticker, dimension, date, reportperiod) ); CREATE INDEX IF NOT EXISTS fundamentals_calendardate_idx ON public.fundamentals USING btree (calendardate); CREATE INDEX IF NOT EXISTS fundamentals_dimension_idx ON public.fundamentals USING btree (dimension); CREATE INDEX IF NOT EXISTS fundamentals_lastupdated_idx ON public.fundamentals USING btree (lastupdated); CREATE INDEX IF NOT EXISTS fundamentals_ticker_idx ON public.fundamentals USING btree (ticker);