Market-data lake

lake.stock_market_cap dataset schema

Column types and research semantics for NexusTrade’s lake.stock_market_cap dataset. Read the supported schema before submitting a bounded SQL query.

Query name
lake.stock_market_cap
Grain
year
Columns
3

Columns and types

These columns come from the same versioned logical catalog used by the query validator and engine. They describe the fields you can query. Some historical rows have missing values; fields absent from older shards can return typed NULL.

tickerVARCHAR
dateTIMESTAMP
market_capDOUBLE

Current logical schema for lake.stock_market_cap

Coverage and timing

Logical projection of ticker/date/marketCap from SEC daily metrics.

Latest screens SHOULD pin to the newest session with full coverage, not raw `MAX(date)`: a partially published session can sit at the tip with a fraction of the universe. Use `WHERE date::DATE = (SELECT session FROM latest_full)` with `WITH latest_full AS (WITH sessions AS ( SELECT date::DATE AS session, COUNT(DISTINCT ticker) AS tickers FROM lake.stock_market_cap WHERE date::DATE >= (SELECT MAX(date::DATE) FROM lake.stock_market_cap) - INTERVAL 45 DAY GROUP BY 1 ), scored AS ( SELECT session, tickers, MEDIAN(tickers) OVER (ORDER BY session ROWS BETWEEN 20 PRECEDING AND 1 PRECEDING) AS trailing_median FROM sessions ) SELECT MAX(session) AS session FROM scored WHERE trailing_median IS NULL OR tickers >= 0.9 * trailing_median)`.

Run a limited query

Use a registered API key with lake scope. Select needed columns, bind user-supplied values and restrict dates when the table has a time dimension. Query results are durable parts with a schema and manifest rather than an unbounded in-memory array.

This reference documents the schema and its meaning. Run queries in your signed-in workspace; this page does not execute SQL or show private results and datasets.

sql
SELECT "ticker", "date", "market_cap"
FROM lake.stock_market_cap
LIMIT 20;