> ## Documentation Index
> Fetch the complete documentation index at: https://fruitstand.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How Do I Get Dividend History From Stock Prices in SQL?

> Derive dividend history from stock prices in SQL: the adjustment-factor method, tested queries, split filtering, yield, and 2025 counts for 2,096 US stocks.

*By [Fruit Stand Team](https://fruitstand.dev/about.md) · November 15, 2026 · Guides*

If your price data has `close` and `adjusted_close`, you already have
dividend history. On each ex-dividend date the factor `adjusted_close / close`
steps up, and the dividend equals the prior close times `1 - 1/step`. On our
Snowflake data this reproduces Coca-Cola's $0.51 and $0.53, Johnson &
Johnson's $1.30 and $1.34, and NVIDIA's \$0.25 to the cent.

Below is the method, the SQL for one ticker and for every US stock at once,
how to keep splits out, dividend growth and yield, and where the derived
numbers stop being reliable.

> [!NOTE]
>
> Fruit Stand publishes the Historical Stock Prices listing used here. Every
> query below was run on November 15, 2026, against prices through November
> 13, 2026. Declared dividends were checked against company press releases
> and SEC filings, and other providers' details on their own pages, the
> same day.

## Where bulk dividend history comes from

Per-ticker dividend history is easy to find for free. Every US stock at once,
in a form you can query, usually isn't.

| Source | What you get | Price (checked Nov 15, 2026) |
| - | - | - |
| [EODHD](https://eodhd.com/financial-apis/bulk-api-eod-splits-dividends) | Dividends per ticker, or a whole exchange's dividends for a day through its Bulk API | Free plan: per ticker only, 20 calls a day; its docs say "Bulk downloads are not part of the Free plan." Paid plans with bulk from [\$19.99/month](https://eodhd.com/pricing) |
| [ORATS](https://orats.com/dividends) | Daily dividend files for US stocks with listed options, history back to 2007 | $199/month for an individual license, plus $2,000 one time for the history |
| [Wall Street Horizon](https://www.wallstreethorizon.com/dividends) | Announced dividends with declaration, ex, record and pay dates | No published price; sold through sales |
| yfinance and similar | One ticker per request | Free, unofficial and throttled |
| Derive it from the [Historical Stock Prices listing on the Snowflake Marketplace](https://app.snowflake.com/marketplace/listing/GZTYZTG3LNFA) (this post) | Ex-date and amount for every US stock, queried in SQL in your own Snowflake account | \$100/month after a free 30-day trial |

If you need declaration, record and payment dates, or forecasts, a paid
dividend feed is the right tool. If you need ex-dates and amounts for many
stocks, and you already have adjusted prices, from our listing or any other
source, you can compute them yourself.

## How the adjustment factor encodes each dividend

Adjusted prices are built by multiplying every price before an ex-date by
`1 - dividend / prior_close`. [Adjusted Close vs.
Close](https://fruitstand.dev/blog/adjusted-close-vs-close.md) walks through that adjustment; here we
run it backward.

Let `factor = adjusted_close / close`. It's 1.0 on the latest date and
smaller further back. On a normal day it doesn't change. On an ex-date it
jumps from `prev_factor` to `factor`, and the ratio between them is

```text theme={null}
step     = factor / prev_factor = 1 / (1 - dividend / prev_close)
dividend = prev_close * (1 - 1 / step)
```

The ex-date is the row where the step lands, and `prev_close` is the raw
close the trading day before. Because it uses raw closes, the result is in
as-traded dollars: the amount the company declared, not a split-adjusted one.

## The SQL for one ticker

This returns Coca-Cola's dividends since January 2025. The date filter sits in
the outer query so `lag()` still sees the last trading day of 2024.

```sql theme={null}
with px as (
    select code, date, close,
           adjusted_close / close as factor,
           lag(close) over (partition by code order by date) as prev_close,
           lag(adjusted_close / close) over (partition by code order by date) as prev_factor
    from security_price_history_vw
    where exchange_code = 'US'
      and code = 'KO'
)
select date as ex_date,
       prev_close,
       round(factor / prev_factor, 6) as step,
       round(prev_close * (1 - prev_factor / factor), 4) as dividend
from px
where date >= '2025-01-01'
  and factor / prev_factor < 1.2
  and prev_close * (1 - prev_factor / factor) >= 0.005
order by ex_date;
```

| ex\_date | prev\_close | step | dividend |
| - | -: | -: | -: |
| 2025-03-14 | 69.62 | 1.007380 | 0.5100 |
| 2025-06-13 | 72.24 | 1.007111 | 0.5101 |
| 2025-09-15 | 67.01 | 1.007671 | 0.5101 |
| 2025-12-01 | 73.12 | 1.007024 | 0.5100 |
| 2026-03-13 | 77.61 | 1.006876 | 0.5300 |
| 2026-06-15 | 82.62 | 1.006456 | 0.5300 |
| 2026-09-15 | 89.35 | 1.005967 | 0.5300 |

The two filters do the work:

* `prev_close * (1 - prev_factor / factor) >= 0.005` keeps steps worth at
  least half a cent a share. `adjusted_close` is stored to four decimal
  places, so the factor wobbles slightly from day to day on cheap stocks.
  On stocks above \$1 that wobble is normally well under half a cent.
* `factor / prev_factor < 1.2` drops splits, covered next.

The 0.5101 values are that same rounding. Round to the cent, or compare
with declared amounts within \$0.001.

## Derived vs. declared amounts

The same query for Johnson & Johnson, Apple and NVIDIA, January 2025 to
October 2026:

```sql theme={null}
with px as (
    select code, date, close,
           adjusted_close / close as factor,
           lag(close) over (partition by code order by date) as prev_close,
           lag(adjusted_close / close) over (partition by code order by date) as prev_factor
    from security_price_history_vw
    where exchange_code = 'US'
      and code in ('JNJ', 'AAPL', 'NVDA')
)
select code, date as ex_date,
       round(prev_close * (1 - prev_factor / factor), 4) as dividend
from px
where date between '2025-01-01' and '2026-10-31'
  and factor / prev_factor < 1.2
  and prev_close * (1 - prev_factor / factor) >= 0.005
order by code, ex_date;
```

| Stock | Ex-dates (derived) | Derived | Declared |
| - | - | -: | -: |
| Coca-Cola (KO) | 2025-03-14, 06-13, 09-15, 12-01 | \$0.51 | \$0.51, record date June 13 for the second ([release](https://investors.coca-colacompany.com/news-events/press-releases/detail/1132/coca-cola-board-of-directors-declares-regular-quarterly-dividend)) |
| Coca-Cola (KO) | 2026-03-13, 06-15, 09-15 | \$0.53 | \$0.53, record date March 13 ([release](https://www.businesswire.com/news/home/20260219249302/en/Board-of-Directors-of-The-Coca-Cola-Company-Elects-New-Officer-and-Approves-64th-Consecutive-Annual-Dividend-Increase)) |
| Johnson & Johnson (JNJ) | 2025-02-18 | \$1.24 | \$1.24 |
| Johnson & Johnson (JNJ) | 2025-05-27, 08-26, 11-25, 2026-02-24 | \$1.30 | \$1.30, ex-date May 27, 2025 ([8-K](https://www.sec.gov/Archives/edgar/data/200406/000020040625000110/a2025q1exhibit993.htm)) |
| Johnson & Johnson (JNJ) | 2026-05-26, 08-25 | \$1.34 | \$1.34, ex-date May 26, 2026 ([8-K](https://www.sec.gov/Archives/edgar/data/200406/000020040626000076/a2026q1exhibit993.htm)) |
| Apple (AAPL) | 2025-02-10 | \$0.25 | \$0.25 |
| Apple (AAPL) | 2025-05-12, 08-11, 11-10, 2026-02-09 | \$0.26 | \$0.26, record date May 12, 2025 ([release](https://www.apple.com/newsroom/2025/05/apple-reports-second-quarter-results/)) |
| Apple (AAPL) | 2026-05-11, 08-10 | \$0.27 | \$0.27, record date May 11, 2026 ([release](https://www.apple.com/au/newsroom/2026/04/apple-reports-second-quarter-results/)) |
| NVIDIA (NVDA) | 2025-03-12 through 2026-03-11 (5 dates) | \$0.01 | \$0.01 |
| NVIDIA (NVDA) | 2026-06-04, 09-10 | \$0.25 | \$0.25, record date June 4, 2026 ([release](https://www.hpcwire.com/off-the-wire/nvidia-announces-financial-results-for-1st-quarter-fiscal-2027/)) |

Every amount matched to the cent, and every ex-date we checked matched the
company's record date. That's expected: since US stocks moved to T+1
settlement in May 2024, the ex-date and the record date are the same day.

## Keeping splits out

A split moves the factor too. NVIDIA's 10-for-1 split took effect on June
10, 2024 ([8-K](https://www.sec.gov/Archives/edgar/data/1045810/000104581024000144/nvda-20240607.htm)).
This query lists every day NVIDIA's factor changed in the rest of 2024,
before any filter:

```sql theme={null}
with px as (
    select code, date, close,
           adjusted_close / close as factor,
           lag(close) over (partition by code order by date) as prev_close,
           lag(adjusted_close / close) over (partition by code order by date) as prev_factor
    from security_price_history_vw
    where exchange_code = 'US'
      and code = 'NVDA'
      and date between '2024-05-01' and '2024-12-31'
)
select date, prev_close, close,
       round(factor / prev_factor, 6) as step,
       round(prev_close * (1 - prev_factor / factor), 4) as implied_amount
from px
where abs(factor / prev_factor - 1) > 0.00001
order by date;
```

| date | prev\_close | close | step | implied\_amount |
| - | -: | -: | -: | -: |
| 2024-06-10 | 1208.88 | 121.79 | 9.999997 | 1087.9920 |
| 2024-06-11 | 121.79 | 120.91 | 1.000082 | 0.0100 |
| 2024-09-12 | 116.91 | 119.14 | 1.000085 | 0.0100 |
| 2024-12-05 | 145.14 | 145.06 | 1.000069 | 0.0100 |

The split day has a step of 10.0 and an "implied dividend" of \$1,087.99,
which is nonsense. The `< 1.2` cap removes it. Splits always land on simple
ratios: 2.0 for 2-for-1, 1.5 for 3-for-2, 10.0 for 10-for-1. Reverse splits
give a step below 1, which the half-cent filter already drops.

**The trap is the lower bound.** A common shortcut is to treat only steps
above 1.0005 as dividends. NVIDIA's $0.01 on a $120 stock is a step of
1.00008, so that shortcut silently deletes NVIDIA's dividends. Across 2025
it would have dropped 94 real dividends at 32 listed stocks, mostly
low-yield payers with high share prices. A threshold on the dollar amount
(half a cent) instead of the ratio keeps them.

## Dividend growth by year

Sum the derived amounts by calendar year. Coca-Cola, 2015 to 2025:

```sql theme={null}
with px as (
    select code, date, close,
           adjusted_close / close as factor,
           lag(close) over (partition by code order by date) as prev_close,
           lag(adjusted_close / close) over (partition by code order by date) as prev_factor
    from security_price_history_vw
    where exchange_code = 'US'
      and code = 'KO'
),
divs as (
    select date, prev_close * (1 - prev_factor / factor) as dividend
    from px
    where factor / prev_factor < 1.2
      and prev_close * (1 - prev_factor / factor) >= 0.005
)
select year(date) as year,
       count(*) as payments,
       round(sum(dividend), 2) as annual_dividend,
       round(sum(dividend) / lag(sum(dividend)) over (order by year(date)) - 1, 3) as growth
from divs
where date >= '2015-01-01' and date < '2026-01-01'
group by year(date)
order by year;
```

| Year | Payments | Annual dividend | Growth |
| - | -: | -: | -: |
| 2015 | 4 | \$1.32 | |
| 2016 | 4 | \$1.40 | 6.1% |
| 2017 | 4 | \$1.48 | 5.7% |
| 2018 | 4 | \$1.56 | 5.4% |
| 2019 | 4 | \$1.60 | 2.6% |
| 2020 | 4 | \$1.64 | 2.5% |
| 2021 | 4 | \$1.68 | 2.4% |
| 2022 | 4 | \$1.76 | 4.8% |
| 2023 | 4 | \$1.84 | 4.5% |
| 2024 | 4 | \$1.94 | 5.4% |
| 2025 | 4 | \$2.04 | 5.2% |

Each year is four times that year's quarterly rate, from $0.33 in 2015 to
$0.51 in 2025. Two cautions. Grouping by ex-date year can give a fifth
payment in one year and three in the next when an ex-date crosses January

1. And amounts are as traded, so across a split you must divide earlier
   amounts by the split ratio before comparing.

## Every stock that paid in a year

The same logic across every common stock listed on NYSE, Nasdaq and the
other national exchanges, for 2025, grouped by how often each one paid:

```sql theme={null}
with px as (
    select p.code, p.date, p.close,
           p.adjusted_close / p.close as factor,
           lag(p.close) over (partition by p.code order by p.date) as prev_close,
           lag(p.adjusted_close / p.close) over (partition by p.code order by p.date) as prev_factor
    from security_price_history_vw p
    join security_vw s
      on s.code = p.code and s.exchange_code = p.exchange_code
    where p.exchange_code = 'US'
      and s.type = 'Common Stock'
      and s.exchange in ('NYSE', 'NASDAQ', 'AMEX', 'NYSE MKT', 'NYSE ARCA', 'BATS')
      and p.date >= '2024-12-01' and p.date < '2026-01-01'
      and p.close >= 1
),
divs as (
    select code, date, prev_close * (1 - prev_factor / factor) as dividend
    from px
    where date >= '2025-01-01'
      and factor / prev_factor < 1.2
      and prev_close * (1 - prev_factor / factor) >= 0.005
),
per_stock as (
    select code, count(*) as payments, sum(dividend) as total
    from divs
    group by code
)
select case when payments >= 11 then 'monthly (11+)'
            when payments between 4 and 5 then 'quarterly (4-5)'
            when payments = 2 then 'semiannual (2)'
            when payments = 1 then 'once (1)'
            else 'other (3 or 6-10)' end as pattern,
       count(*) as stocks,
       sum(payments) as payments
from per_stock
group by 1
order by stocks desc;
```

| Pattern | Stocks | Payments |
| - | -: | -: |
| quarterly (4-5) | 1,631 | 6,566 |
| once (1) | 140 | 140 |
| semiannual (2) | 140 | 280 |
| monthly (11+) | 120 | 1,532 |
| other (3 or 6-10) | 65 | 305 |

That's 8,823 derived dividends at 2,096 stocks. To get the list itself,
`select * from divs` instead of the final grouping. The `close >= 1` filter
leaves out sub-dollar stocks, where four-decimal rounding makes the factor
too noisy to trust. OTC stocks are left out because their adjusted prices
are noisier too.

Then check the rows the `< 1.2` cap removed that aren't clean split ratios:

```sql theme={null}
with px as (
    select p.code, p.date, p.close,
           p.adjusted_close / p.close as factor,
           lag(p.close) over (partition by p.code order by p.date) as prev_close,
           lag(p.adjusted_close / p.close) over (partition by p.code order by p.date) as prev_factor
    from security_price_history_vw p
    join security_vw s
      on s.code = p.code and s.exchange_code = p.exchange_code
    where p.exchange_code = 'US'
      and s.type = 'Common Stock'
      and s.exchange in ('NYSE', 'NASDAQ', 'AMEX', 'NYSE MKT', 'NYSE ARCA', 'BATS')
      and p.date >= '2024-12-01' and p.date < '2026-01-01'
      and p.close >= 1
)
select code, date,
       round(factor / prev_factor, 4) as step,
       round(prev_close * (1 - prev_factor / factor), 2) as implied_amount
from px
where date >= '2025-01-01'
  and factor / prev_factor >= 1.2
  and abs(factor / prev_factor - round(factor / prev_factor)) > 0.001
  and abs(factor / prev_factor - 1.5) > 0.001
order by step;
```

It returns 21 rows for 2025. They're a mix of large special dividends,
spin-offs and odd-ratio share exchanges. Western Digital's 1.323 on February
24, 2025, for example, is the Sandisk spin-off, which shareholders received
as stock ([8-K/A](https://www.sec.gov/Archives/edgar/data/106040/000010604025000012/wdc-20250220.htm)).
Decide on these by hand.

## Trailing 12-month dividend yield

Trailing yield is the last 12 months of dividends over the latest close:

```sql theme={null}
with px as (
    select code, date, close,
           adjusted_close / close as factor,
           lag(close) over (partition by code order by date) as prev_close,
           lag(adjusted_close / close) over (partition by code order by date) as prev_factor
    from security_price_history_vw
    where exchange_code = 'US'
      and code in ('KO', 'JNJ', 'NVDA')
),
divs as (
    select code, date, prev_close * (1 - prev_factor / factor) as dividend
    from px
    where factor / prev_factor < 1.2
      and prev_close * (1 - prev_factor / factor) >= 0.005
),
latest as (
    select code, date, close
    from px
    qualify row_number() over (partition by code order by date desc) = 1
)
select l.code, l.date, l.close,
       round(sum(d.dividend), 4) as ttm_dividends,
       count(d.date) as payments,
       round(sum(d.dividend) / l.close * 100, 2) as ttm_yield_pct
from latest l
left join divs d
  on d.code = l.code
 and d.date > dateadd(year, -1, l.date)
 and d.date <= l.date
group by l.code, l.date, l.close
order by ttm_yield_pct desc;
```

| Stock | Close, Nov 13, 2026 | Trailing 12-month dividends | Payments | Yield |
| - | -: | -: | -: | -: |
| Coca-Cola (KO) | \$99.25 | \$2.10 | 4 | 2.12% |
| Johnson & Johnson (JNJ) | \$285.75 | \$5.28 | 4 | 1.85% |
| NVIDIA (NVDA) | \$162.85 | \$0.52 | 4 | 0.32% |

Trailing yield lags raises. NVIDIA's window still holds two $0.01 payments,
so its yield at the current $0.25 rate would be about 0.61%
($1.00 / $162.85). For the yield on a full investment including price moves,
see [How to Calculate Stock Returns From Daily Prices in
SQL](https://fruitstand.dev/blog/calculate-stock-returns-sql.md).

## Limitations

* **The ex-date is the vendor's.** The derived date is the day the vendor
  applied the adjustment. It normally matches the exchange's ex-date, but
  if the vendor's date is wrong, so is yours. Spot-check a few against the
  company's investor relations page.
* **No declaration, record or payment dates.** Prices only reveal the
  ex-date. For US stocks since May 2024 the record date equals the ex-date;
  declaration and payment dates aren't recoverable.
* **Special dividends, return of capital and spin-offs look like regular
  dividends.** A one-time payment under the 1.2 cap is counted like any
  other. So is a small spin-off, and a 5% or 10% stock dividend shows up as
  a step of 1.05 or 1.10.
* **Rounding.** Expect errors of up to about a tenth of a cent, more on
  cheap stocks and in early history, where the factor is small. Fractional
  amounts such as \$0.485 survive, but round to the nearest tenth of a cent
  before comparing.
* **Our data has no dividend table and no delisted stocks.** The listing
  covers securities that still trade, so a count across past years misses
  companies that have since been acquired or delisted.

## F.A.Q.

> [accordion] Can I calculate dividends from adjusted close?
>
> Yes. On the ex-date, divide that day's factor (`adjusted_close / close`) by the previous day's to get the step, then compute `prev_close * (1 - 1/step)`. On Coca-Cola, Johnson & Johnson, Apple and NVIDIA in 2025–2026 it matched every declared amount to the cent.

> [accordion] Why doesn't close minus adjusted close equal the dividend?
>
> Because the adjustment is a cumulative multiplier over every dividend and split since that date. Only the day-over-day change in the factor isolates a single dividend.

> [accordion] How do I keep stock splits from showing up as dividends?
>
> Cap the step below 1.2 and require the implied amount to be at least half a cent. Splits sit at simple ratios (1.5, 2, 3, 10), and reverse splits fall below 1. Don't use a 1.0005 floor on the ratio: it drops small dividends on high-priced stocks, such as NVIDIA's \$0.01.

> [accordion] Is there free bulk dividend history?
>
> Not from the usual APIs. EODHD's free plan gives dividends one ticker at a time, and its bulk downloads need a paid plan. ORATS and Wall Street Horizon are paid feeds. If you already have adjusted daily prices, deriving dividends costs nothing extra.

> [accordion] Does the Historical Stock Prices listing have a dividends table?
>
> No. It has daily raw and adjusted prices for US stocks, ETFs and funds, and the queries above derive ex-dates and amounts from them. It doesn't have declaration or payment dates.

To derive dividend history for every US stock in SQL, start a free 30-day
trial of the [Historical Stock Prices listing on the Snowflake
Marketplace](https://app.snowflake.com/marketplace/listing/GZTYZTG3LNFA).
The schema is in the [dataset docs](https://fruitstand.dev/datasets/historical-stock-prices.md).
Questions? Reach out at [contact@fruitstand.dev](mailto:contact@fruitstand.dev).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.