STRASMORE/EXPLORE 3,256 QUERIES 22Y EQUITIES · 12Y OPTIONS

3,256 answered market questions

every one with its exact SQL, its result and the date it was computed · free, no signup

Portfolio Analysis in SQL: Weights to Drawdown
Position weights from last close times share counttable · 2026-10-07 · 6×6 Pairwise daily return correlation, trailing yearranking · 2026-10-07 · 15×2Preview: 15 ranked values, largest first. Weekly peak-to-trough drawdown of the blended portfolioseries · 2026-10-07 · 53×4Preview: a 16-point series, roughly flat. Trailing twelve-month dividend income by holdingtable · 2026-10-07 · 6×6 Cumulative weight and the Herfindahl concentration indexranking · 2026-10-07 · 6×4Preview: 6 ranked values, largest first.
Stock Correlation Matrix in One SQL Query
Daily bars per name against sessions shared with SPY, Oct 2025 to Sep 2026ranking · 2026-10-06 · 6×3Preview: 6 ranked values, largest first. AAPL and MSFT return correlation measured quarter by quarterranking · 2026-10-06 · 7×3Preview: 7 ranked values, largest first. Correlation of price levels against correlation of daily returns, same pairsranking · 2026-10-06 · 15×4Preview: 15 ranked values, largest first. Pairwise correlation of daily returns, six large caps, Oct 2025 to Sep 2026ranking · 2026-10-06 · 15×2Preview: 15 ranked values, largest first.
Stock Split Calendar From a Free SQL API
Forward and reverse splits per month, last 36 monthsseries · 2026-10-04 · 36×4Preview: a 16-point series, ending higher. Most common split ratios, last three yearsranking · 2026-10-04 · 12×2Preview: 12 ranked values, largest first. Do the direction labels agree with the ratio columns?ranking · 2026-10-04 · 2×4Preview: 2 ranked values, smallest first. The stock split calendar: recent and scheduledtable · 2026-10-04 · 24×5
Free SQL API for Stock Market Data
SPY implied volatility by days-to-expiry bucket, latest sessionranking · 2026-10-04 · 11×2Preview: 11 ranked values, smallest first. P/E ratios of US companies above $500B market capranking · 2026-10-04 · 12×2Preview: 12 ranked values, largest first. KO: total cash dividends per share by yearranking · 2026-10-04 · 22×2Preview: 16 ranked values, smallest first.
Ex-Dividend Calendar from a Free SQL API
Liquid US names going ex-dividend in the next 14 daysranking · 2026-10-04 · 15×4Preview: 15 ranked values, smallest first. Declared ex-dividend dates per week, next 12 weeksseries · 2026-10-04 · 12×3Preview: a 12-point series, ending lower. How far ahead dividends were declared, trailing 12 monthsranking · 2026-10-04 · 5×2Preview: 5 ranked values, smallest first.
Position weights from last close times share count

Position weights from last close times share count

most recentas of table 6×6read in context →
Position weights from last close times share count — 6 rows by 6 columns, computed from US exchange, SIP and OPRA data.
tickershareslast_closeposition_valueweight_pctpriced_through
AAPL120336.174034125.71Oct 7, 2026
KO30086.572597116.55Oct 7, 2026
XOM150165.882488115.86Oct 7, 2026
MSFT45525.692365615.08Oct 7, 2026
JNJ90255.892303014.68Oct 7, 2026
NVDA80237.611900912.12Oct 7, 2026
the exact SQL behind every number
WITH holdings AS
(
    SELECT 'AAPL' AS ticker, 120 AS shares
    UNION ALL SELECT 'MSFT', 45
    UNION ALL SELECT 'NVDA', 80
    UNION ALL SELECT 'KO',   300
    UNION ALL SELECT 'JNJ',  90
    UNION ALL SELECT 'XOM',  150
),
marks AS
(
    SELECT
        ticker,
        argMax(toFloat64(close), (date, _ingest_time)) AS last_close,
        max(date)                                      AS last_session
    FROM global_markets.stocks_daily_aggs
    WHERE ticker IN ('AAPL', 'MSFT', 'NVDA', 'KO', 'JNJ', 'XOM')
      AND date >= today() - 30
    GROUP BY ticker
),
positions AS
(
    SELECT
        h.ticker                          AS ticker,
        h.shares                          AS shares,
        round(m.last_close, 2)            AS last_close,
        round(h.shares * m.last_close, 0) AS position_value,
        m.last_session                    AS last_session
    FROM holdings AS h
    INNER JOIN marks AS m ON m.ticker = h.ticker
)
SELECT
    ticker,
    shares,
    last_close,
    position_value,
    round(100 * position_value / sum(position_value) OVER (), 2) AS weight_pct,
    formatDateTime(last_session, '%b %e, %Y')                    AS priced_through
FROM positions
ORDER BY weight_pct DESC
$