File size: 14,584 Bytes
8755cf3 5a92583 6ff5200 e34dabd 5a92583 e34dabd bb6b37d 6ff5200 e34dabd 6ff5200 5a92583 6ff5200 5a92583 6ff5200 5a92583 6ff5200 5a92583 6ff5200 5a92583 bb6b37d 5a92583 7d99789 6ff5200 bb6b37d 6ff5200 e34dabd 5a92583 e34dabd 5a92583 6ff5200 e34dabd 5a92583 6ff5200 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 |
---
license: mit
language:
- en
- zh
tags:
- finance
pretty_name: RubikBench
size_categories:
- 100M<n<1B
configs:
# -- BUDGET TABLES --
- config_name: budget_accessory
data_files: "RubikBench/BUDGET_AND_FORECAST_ACCESSORY/*.parquet"
- config_name: budget_all
data_files: "RubikBench/BUDGET_AND_FORECAST_ALL/*.parquet"
- config_name: budget_cybvehsys
data_files: "RubikBench/BUDGET_AND_FORECAST_CYBVEHSYS/*.parquet"
- config_name: budget_galmotgro
data_files: "RubikBench/BUDGET_AND_FORECAST_GALMOTGRO/*.parquet"
- config_name: budget_novdyn
data_files: "RubikBench/BUDGET_AND_FORECAST_NOVDYN/*.parquet"
- config_name: budget_service
data_files: "RubikBench/BUDGET_AND_FORECAST_SERVICE/*.parquet"
- config_name: budget_shimotcor
data_files: "RubikBench/BUDGET_AND_FORECAST_SHIMOTCOR/*.parquet"
- config_name: budget_tyrautgro
data_files: "RubikBench/BUDGET_AND_FORECAST_TYRAUTGRO/*.parquet"
- config_name: budget_weymotcor
data_files: "RubikBench/BUDGET_AND_FORECAST_WEYMOTCOR/*.parquet"
# -- INCOME TABLES --
- config_name: income_accessory
data_files: "RubikBench/INCOME_ACCESSORY/*.parquet"
- config_name: income_all
data_files: "RubikBench/INCOME_ALL/*.parquet"
- config_name: income_cybvehsys
data_files: "RubikBench/INCOME_CYBVEHSYS/*.parquet"
- config_name: income_galmotgro
data_files: "RubikBench/INCOME_GALMOTGRO/*.parquet"
- config_name: income_novdyn
data_files: "RubikBench/INCOME_NOVDYN/*.parquet"
- config_name: income_service
data_files: "RubikBench/INCOME_SERVICE/*.parquet"
- config_name: income_shimotcor
data_files: "RubikBench/INCOME_SHIMOTCOR/*.parquet"
- config_name: income_tyrautgro
data_files: "RubikBench/INCOME_TYRAUTGRO/*.parquet"
- config_name: income_weymotcor
data_files: "RubikBench/INCOME_WEYMOTCOR/*.parquet"
# -- LARGE LEDGERS --
- config_name: profit_and_loss
data_files: "RubikBench/PROFIT_AND_LOSS/*.parquet"
- config_name: sales_ledger
data_files: "RubikBench/SALES_LEDGER/*.parquet"
default: true
---
# RubikBench
**Version**: v0.9.2 (2026-02-13)
> **Database Homepage**: [RubikBench](https://huggingface.co/datasets/Magolor/RubikBench)
RubikBench is an enterprise-scale financial database designed for realistic Natural Language to SQL (NL2SQL) research and evaluation.
The RubikBench database contains the **financial** data of *APEX*, a hypothetical international **automobile** manufacturing and sales company. As a financial database, it is designed to support various analytical queries related to the company's operations, sales, and financial performance. This (imaginary) company operates mainly in China, the United States, and Europe. Therefore the database is bilingual, with both English and Chinese values, and uses three currencies: CNY, USD, and EUR.
While the data values are synthesized, the schemas and structural patterns are closely modeled after actual enterprise financial databases, ensuring practical relevance for NL2SQL system development and evaluation. The database is specifically designed to reflect the complexities encountered in real-world enterprise environments, including wide table schemas, domain-specific knowledge, diverse metrics and data calibers, etc.
<br/>
## Database Statistics
### 2.1 Overview
- **Total Size**: ~ 38 GB (DuckDB) / ~ 11 GB (parquet)
- **Total Tables**: 20 tables
- **Total Records**: ~ 901.53 million rows
- **Time Coverage**: Monthly from January 2020 to December 2025 (72 months)
- **Languages**: Bilingual (English and Chinese)
- **Database Format**: DuckDB Native (recommended), parquet (for huggingface)
- Formats like sqlite is not supported as it does not compress the data. The full, uncompressed size of data can be over 500GB.
<br/>
### 2.2 Table Statistics
| Table Name | Rows | Columns | Period | Region | Customer | Dealer | Product | Contract | Project | Revenue | Expense |
|------------|----------------|---------|--------|--------|----------|--------|---------|----------|---------|---------|---------|
| **INCOME_ALL** | 12.41M | 61 | 72 | ✓ | ✓ | | ✓ | | | ✓ | |
| INCOME_ACCESSORY | 3.37M | 61 | 72 | ✓ | ✓ | | ✓ | | | ✓ | |
| INCOME_CYBVEHSYS | 0.99M | 61 | 72 | ✓ | ✓ | | ✓ | | | ✓ | |
| INCOME_GALMOTGRO | 1.72M | 61 | 72 | ✓ | ✓ | | ✓ | | | ✓ | |
| INCOME_NOVDYN | 1.42M | 61 | 72 | ✓ | ✓ | | ✓ | | | ✓ | |
| INCOME_SERVICE | 1.48M | 61 | 72 | ✓ | ✓ | | ✓ | | | ✓ | |
| INCOME_SHIMOTCOR | 1.13M | 61 | 72 | ✓ | ✓ | | ✓ | | | ✓ | |
| INCOME_TYRAUTGRO | 1.04M | 61 | 72 | ✓ | ✓ | | ✓ | | | ✓ | |
| INCOME_WEYMOTCOR | 1.25M | 61 | 72 | ✓ | ✓ | | ✓ | | | ✓ | |
| **BUDGET_AND_FORECAST_ALL** | 96.58M | 37 | 72 | ✓ | | | ✓ | | | ✓ | ✓ |
| BUDGET_AND_FORECAST_ACCESSORY | 30.18M | 37 | 72 | ✓ | | | ✓ | | | ✓ | ✓ |
| BUDGET_AND_FORECAST_CYBVEHSYS | 8.50M | 37 | 72 | ✓ | | | ✓ | | | ✓ | ✓ |
| BUDGET_AND_FORECAST_GALMOTGRO | 11.23M | 37 | 72 | ✓ | | | ✓ | | | ✓ | ✓ |
| BUDGET_AND_FORECAST_NOVDYN | 10.46M | 37 | 72 | ✓ | | | ✓ | | | ✓ | ✓ |
| BUDGET_AND_FORECAST_SERVICE | 9.48M | 37 | 72 | ✓ | | | ✓ | | | ✓ | ✓ |
| BUDGET_AND_FORECAST_SHIMOTCOR | 8.86M | 37 | 72 | ✓ | | | ✓ | | | ✓ | ✓ |
| BUDGET_AND_FORECAST_TYRAUTGRO | 8.51M | 37 | 72 | ✓ | | | ✓ | | | ✓ | ✓ |
| BUDGET_AND_FORECAST_WEYMOTCOR | 9.35M | 37 | 72 | ✓ | | | ✓ | | | ✓ | ✓ |
| **PROFIT_AND_LOSS** | 161.74M | 67 | 72 | ✓ | ✓ | ✓ | ✓ | | | ✓ | ✓ |
| **SALES_LEDGER** | 521.81M | 55 | 72 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
<br/>
### 2.3 Entity Statistics
| Dimension | Hierarchy Levels | Total Entities |
|-----------|------------------|----------------|
| **Period** | 1 | 72 months (202001-202512) |
| **Region** | 6 | 2 overseas/domestic, 11 sales regions, 22 countries, 37 national areas, 46 provinces, 47 cities |
| **Product** | 4 | 3 (Lv0), 19 (Lv1), 93 (Lv2), 353 (Lv3) |
| **Customer** | 4 | 4 (Lv1), 9 (Lv2), 14 (Lv3), 22 (Lv4) |
| **Dealer** | 3 | 3 (Lv1), 5 (Lv2), 9 (Lv3) including 'Direct Sales' |
| **Report Item** | 4 | 2 (Lv0), 6 (Lv1), 10 (Lv2), 22 (Lv3) |
| **Contract/Project** | 2 | 40,756 distinct contracts, 46,895 distinct projects |
| **Caliber** | 1 | 2 calibers (A, B) |
| **Currency** | 1 | 3 currencies (CNY, EUR, USD) |
<br/>
### 2.4 Database Explanation
RubikBench is a database containing the **financial** data of *APEX*, an (imaginary) international **automobile** manufacturing and sales company. As a financial database, it is designed to support various analytical queries related to the company's operations, sales, and financial performance. This (imaginary) company operates mainly in China, the United States, and Europe. Therefore the database is bilingual, with both English and Chinese values, and uses three currencies: CNY, USD, and EUR.
Specifically, there are **6 key dimensions**: *Period* (time, monthly), *Product*, *Region*, *Customer*, *Dealer*, and *Report Item* (revenues and expenses). Also, there are extra dimensions including: *Contract*, *Project*, *Currency*, and *Caliber*.
The minimal granularity of the data is a **payment** of a **project**. Each **project** happens between APEX and a **customer** at a specific **region**, with an optional **dealer**, over a **period** of time. Payments of a project can be distributed over multiple months in that time period. Each project may contain multiple **products**. Each **contract** may contain multiple projects.
RubikBench contains **20 tables** of **4 major categories**, all of them are aggregated views over the fact table (which is not exposed directly):
- The `INCOME` tables, which contain data aggregated over **project** and **dealer**, and only includes revenues. The INCOME tables are the smallest tables in RubikBench, aiming for quick analytical queries.
- The `BUDGET_AND_FORECAST` tables, which contain data aggregated over **project**, **customer**, and **dealer**. These tables contain only amt/forecast/budget/target values. Notice that the semantics of these values could be counter-intuitive: While the target value is the target for monthly revenues and expenses in `YYYYMM`, as one would expect; the forecast value of `YYYYMM` is the forecast of `YYYY12` (yearly) based on the information available at the end of `YYYYMM`; the budget of `YYYYMM` is a constant value indicating the yearly budget duplicated for each month in the year.
- The `PROFIT_AND_LOSS` table, which contains data aggregated only over **project**. It contains the most comprehensive dimensions and measures, including both revenues and expenses. It is the largest table in RubikBench, aiming to support detailed financial analysis.
- The `SALES_LEDGER` table, which contains the lowest granularity data, i.e., payment-level data. It is designed to support detailed audit and traceability of sales. However, it is limited to sales-related revenues and expenses only.
The products of APEX are divided into **3 major divisions**: *Automobiles*, *Accessories*, and *Services*.
- *Automobiles* are produced by enterprise brand groups, which are **6 sub-brands** under APEX. Each brand group has its own `INCOME` and `BUDGET_AND_FORECAST` tables.
- *Accessories* and *Services* each have their own `INCOME` and `BUDGET_AND_FORECAST` tables. Accessories only have equipment revenues and costs, while services only have service revenues and costs.
The default Caliber is code *A*, which clearly separates equipment and service report items, reflecting the real financial statistics. However, to facilitate the cooperation between different divisions, there are also Caliber *B*, which moves 5% of service revenue to equipment revenue.
Notice that due to historical reasons as well as query efficiency expectations, currencies and calibers are organized differently across different tables. For example, for the INCOME and PROFIT_AND_LOSS tables, different currencies and calibers are stored in different columns as column name suffixes (e.g., `_cny_a`, `_usd_a`, `_eur_b`, etc.); while for the SALES_LEDGER and BUDGET_AND_FORECAST tables, `caliber` and `currency` are separate columns that MUST be filtered on in the query predicates to avoid duplicated results.
Financial amounts presents both `ptd` (monthly) values and `ytd` (year-to-date) values. For example, `ptd` of `YYYYMM` means the amount for that month, while `ytd` of `YYYYMM` means the cumulative amount from `YYYY01` to `YYYYMM` (inclusive). Furthermore, `_py` columns contain previous year data, which means that, for exammple, `ytd` py columns with `period='YYYYMM'` contain cumulative amounts from `YYYY-1 01` to `YYYY-1 MM`, etc.
<br/>
## Query Statistics
RubikBench v0.9.2 contains **3198** fully human-verified queries covering diverse financial analysis scenarios, with comprehensive annotations including difficulty levels, query tags, and user context profiles. The queries are written in both English (1,689) and Chinese (1,509), reflecting the bilingual nature of the database.
<br/>
### 3.1 Difficulty Distribution
| Difficulty | Count | % | Avg. SQL Length | Min SQL Length | Max SQL Length |
|------------|------:|---:|---------------:|---------------:|---------------:|
| **Simple** | 1,047 | 32.7% | 218 chars | 11 chars | 1,240 chars |
| **Moderate** | 1,531 | 47.9% | 641 chars | 213 chars | 3,492 chars |
| **Challenging** | 415 | 13.0% | 1,755 chars | 339 chars | 3,635 chars |
| **Nightmare** | 205 | 6.4% | 1,881 chars | 579 chars | 4,183 chars |
<br/>
### 3.2 Table Coverage
Queries span all 4 major table categories (a query may reference multiple tables):
| Table Category | Queries | Individual Tables |
|----------------|--------:|:---|
| **INCOME_\*** | 1,615 | INCOME_ALL (581), INCOME_WEYMOTCOR (153), INCOME_SHIMOTCOR (142), INCOME_TYRAUTGRO (132), INCOME_ACCESSORY (130), INCOME_NOVDYN (122), INCOME_SERVICE (121), INCOME_GALMOTGRO (120), INCOME_CYBVEHSYS (118) |
| **BUDGET_AND_FORECAST_\*** | 724 | BUDGET_AND_FORECAST_ALL (124), BUDGET_AND_FORECAST_WEYMOTCOR (97), BUDGET_AND_FORECAST_TYRAUTGRO (85), BUDGET_AND_FORECAST_SERVICE (81), BUDGET_AND_FORECAST_SHIMOTCOR (79), BUDGET_AND_FORECAST_NOVDYN (77), BUDGET_AND_FORECAST_ACCESSORY (72), BUDGET_AND_FORECAST_CYBVEHSYS (54), BUDGET_AND_FORECAST_GALMOTGRO (53) |
| **PROFIT_AND_LOSS** | 408 | — |
| **SALES_LEDGER** | 367 | — |
<br/>
### 3.3 SQL Feature Distribution
| SQL Feature | Queries | % |
|-------------|--------:|---:|
| `GROUP BY` | 2,296 | 71.8% |
| `ORDER BY` | 2,139 | 66.9% |
| `CASE WHEN` | 1,409 | 44.1% |
| `COALESCE` | 876 | 27.4% |
| Subquery | 768 | 24.0% |
| Window Function (`OVER`) | 746 | 23.3% |
| `LIMIT` | 635 | 19.9% |
| CTE (`WITH`) | 438 | 13.7% |
| `HAVING` | 334 | 10.4% |
| `DISTINCT` | 260 | 8.1% |
| `JOIN` | 94 | 2.9% |
| `CAST` | 86 | 2.7% |
| `UNION` | 28 | 0.9% |
<br/>
### 3.4 Query Occupations
Each query includes a simulated user profile with an occupation field, representing different roles that would typically interact with financial data:
| Occupation | Count | % | Description |
|------------|------:|---:|-------------|
| **Sales** | 707 | 22.1% | Sales representatives and managers |
| **Finance** | 675 | 21.1% | Financial analysts and accountants |
| **Management** | 559 | 17.5% | Executive and strategic decision-makers |
| **Guest** | 363 | 11.4% | External users with limited access |
| **Developer** | 356 | 11.1% | Technical users and system developers |
| **Unspecified** | 538 | 16.8% | No specific occupation context |
<br/>
## Update Log
- [2025-02] **RubikBench v0.9.2**:
- Added 3198 queries and query statistics (schema-grounded queries to be added).
- Integrated BirdSQL MINIDEV benchmark and KaggleDBQA benchmark into RubikBench CLI.
- Released RubikBench evaluation toolkit as open-source Python package: [rubikbench](https://pypi.org/project/rubikbench/).
- [2026-02] Updated **RubikBench v0.9.1** database on huggingface: [RubikBench](https://huggingface.co/datasets/Magolor/RubikBench).
- Add support for `.parquet` format.
- More realistic business logic, reduced the number of products per project
- Diversify between SALES_LEDGER and PROFIT_AND_LOSS
- Fixed some geographical region errors
- Re-generate all projects and contracts
- Expand to 9 dealers
- ytd/ptd fix
- [2026-01] Initial release of **RubikBench v0.9** database on huggingface: [RubikBench](https://huggingface.co/datasets/Magolor/RubikBench).
<br/>
|