What is a fact table?

A fact table is the central table in a dimensional data model that stores measurable, quantitative events, such as sales, transactions or clicks, along with foreign keys linking to descriptive dimension tables. Facts are the numbers you aggregate; dimensions are the context you slice them by.

In an analytical database, the fact table is where the metrics live. Each row records one event at a defined grain and typically contains:

  • Measures the numeric values you sum, average or count (revenue, units, minutes).
  • Foreign keys pointers to dimension tables that describe the event (which product, customer, date, store).
  • Sometimes degenerate dimensions like an order number kept in the fact itself.

Fact tables are usually long and narrow, growing by millions of rows as events accumulate, and they are the target of most aggregation queries: total sales by region, average order value by month, and so on.

To answer such a question by hand you join the fact table to the right dimensions, group correctly, and pick the correct measure, easy to get subtly wrong. iDBQuery handles that for you: it recognises which tables are facts and which are dimensions, infers the foreign-key joins, writes the aggregation SQL from your plain-language question, and cites the result back to the exact fact rows it summed, so you can trust the number and see where it came from.

Updated 2026-06-22