Update README.md
Browse files
README.md
CHANGED
|
@@ -59,20 +59,19 @@ default: true
|
|
| 59 |
---
|
| 60 |
# RubikBench
|
| 61 |
|
| 62 |
-
**Version**: v0.9.
|
| 63 |
|
| 64 |
-
> Database Homepage
|
| 65 |
|
| 66 |
RubikBench is an enterprise-scale financial database designed for realistic Natural Language to SQL (NL2SQL) research and evaluation.
|
| 67 |
|
| 68 |
-
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
|
| 69 |
|
| 70 |
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.
|
| 71 |
|
| 72 |
<br/>
|
| 73 |
|
| 74 |
## Database Statistics
|
| 75 |
-
|
| 76 |
### 2.1 Overview
|
| 77 |
|
| 78 |
- **Total Size**: ~ 38 GB (DuckDB) / ~ 11 GB (parquet)
|
|
@@ -128,14 +127,104 @@ While the data values are synthesized, the schemas and structural patterns are c
|
|
| 128 |
|
| 129 |
<br/>
|
| 130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
## Query Statistics
|
| 132 |
|
| 133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
|
| 135 |
<br/>
|
| 136 |
|
| 137 |
## Update Log
|
| 138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
- [2026-02] Updated **RubikBench v0.9.1** database on huggingface: [RubikBench](https://huggingface.co/datasets/Magolor/RubikBench).
|
| 140 |
- Add support for `.parquet` format.
|
| 141 |
- More realistic business logic, reduced the number of products per project
|
|
|
|
| 59 |
---
|
| 60 |
# RubikBench
|
| 61 |
|
| 62 |
+
**Version**: v0.9.2 (2026-02-13)
|
| 63 |
|
| 64 |
+
> **Database Homepage**: [RubikBench](https://huggingface.co/datasets/Magolor/RubikBench)
|
| 65 |
|
| 66 |
RubikBench is an enterprise-scale financial database designed for realistic Natural Language to SQL (NL2SQL) research and evaluation.
|
| 67 |
|
| 68 |
+
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.
|
| 69 |
|
| 70 |
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.
|
| 71 |
|
| 72 |
<br/>
|
| 73 |
|
| 74 |
## Database Statistics
|
|
|
|
| 75 |
### 2.1 Overview
|
| 76 |
|
| 77 |
- **Total Size**: ~ 38 GB (DuckDB) / ~ 11 GB (parquet)
|
|
|
|
| 127 |
|
| 128 |
<br/>
|
| 129 |
|
| 130 |
+
### 2.4 Database Explanation
|
| 131 |
+
|
| 132 |
+
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.
|
| 133 |
+
|
| 134 |
+
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*.
|
| 135 |
+
|
| 136 |
+
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.
|
| 137 |
+
|
| 138 |
+
RubikBench contains **20 tables** of **4 major categories**, all of them are aggregated views over the fact table (which is not exposed directly):
|
| 139 |
+
- 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.
|
| 140 |
+
- 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.
|
| 141 |
+
- 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.
|
| 142 |
+
- 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.
|
| 143 |
+
|
| 144 |
+
The products of APEX are divided into **3 major divisions**: *Automobiles*, *Accessories*, and *Services*.
|
| 145 |
+
- *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.
|
| 146 |
+
- *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.
|
| 147 |
+
|
| 148 |
+
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.
|
| 149 |
+
|
| 150 |
+
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.
|
| 151 |
+
|
| 152 |
+
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.
|
| 153 |
+
|
| 154 |
+
<br/>
|
| 155 |
+
|
| 156 |
## Query Statistics
|
| 157 |
|
| 158 |
+
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.
|
| 159 |
+
|
| 160 |
+
<br/>
|
| 161 |
+
|
| 162 |
+
### 3.1 Difficulty Distribution
|
| 163 |
+
|
| 164 |
+
| Difficulty | Count | % | Avg. SQL Length | Min SQL Length | Max SQL Length |
|
| 165 |
+
|------------|------:|---:|---------------:|---------------:|---------------:|
|
| 166 |
+
| **Simple** | 1,047 | 32.7% | 218 chars | 11 chars | 1,240 chars |
|
| 167 |
+
| **Moderate** | 1,531 | 47.9% | 641 chars | 213 chars | 3,492 chars |
|
| 168 |
+
| **Challenging** | 415 | 13.0% | 1,755 chars | 339 chars | 3,635 chars |
|
| 169 |
+
| **Nightmare** | 205 | 6.4% | 1,881 chars | 579 chars | 4,183 chars |
|
| 170 |
+
|
| 171 |
+
<br/>
|
| 172 |
+
|
| 173 |
+
### 3.2 Table Coverage
|
| 174 |
+
|
| 175 |
+
Queries span all 4 major table categories (a query may reference multiple tables):
|
| 176 |
+
|
| 177 |
+
| Table Category | Queries | Individual Tables |
|
| 178 |
+
|----------------|--------:|:---|
|
| 179 |
+
| **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) |
|
| 180 |
+
| **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) |
|
| 181 |
+
| **PROFIT_AND_LOSS** | 408 | — |
|
| 182 |
+
| **SALES_LEDGER** | 367 | — |
|
| 183 |
+
|
| 184 |
+
<br/>
|
| 185 |
+
|
| 186 |
+
### 3.3 SQL Feature Distribution
|
| 187 |
+
|
| 188 |
+
| SQL Feature | Queries | % |
|
| 189 |
+
|-------------|--------:|---:|
|
| 190 |
+
| `GROUP BY` | 2,296 | 71.8% |
|
| 191 |
+
| `ORDER BY` | 2,139 | 66.9% |
|
| 192 |
+
| `CASE WHEN` | 1,409 | 44.1% |
|
| 193 |
+
| `COALESCE` | 876 | 27.4% |
|
| 194 |
+
| Subquery | 768 | 24.0% |
|
| 195 |
+
| Window Function (`OVER`) | 746 | 23.3% |
|
| 196 |
+
| `LIMIT` | 635 | 19.9% |
|
| 197 |
+
| CTE (`WITH`) | 438 | 13.7% |
|
| 198 |
+
| `HAVING` | 334 | 10.4% |
|
| 199 |
+
| `DISTINCT` | 260 | 8.1% |
|
| 200 |
+
| `JOIN` | 94 | 2.9% |
|
| 201 |
+
| `CAST` | 86 | 2.7% |
|
| 202 |
+
| `UNION` | 28 | 0.9% |
|
| 203 |
+
|
| 204 |
+
<br/>
|
| 205 |
+
|
| 206 |
+
### 3.4 Query Occupations
|
| 207 |
+
|
| 208 |
+
Each query includes a simulated user profile with an occupation field, representing different roles that would typically interact with financial data:
|
| 209 |
+
|
| 210 |
+
| Occupation | Count | % | Description |
|
| 211 |
+
|------------|------:|---:|-------------|
|
| 212 |
+
| **Sales** | 707 | 22.1% | Sales representatives and managers |
|
| 213 |
+
| **Finance** | 675 | 21.1% | Financial analysts and accountants |
|
| 214 |
+
| **Management** | 559 | 17.5% | Executive and strategic decision-makers |
|
| 215 |
+
| **Guest** | 363 | 11.4% | External users with limited access |
|
| 216 |
+
| **Developer** | 356 | 11.1% | Technical users and system developers |
|
| 217 |
+
| **Unspecified** | 538 | 16.8% | No specific occupation context |
|
| 218 |
|
| 219 |
<br/>
|
| 220 |
|
| 221 |
## Update Log
|
| 222 |
|
| 223 |
+
- [2025-02] **RubikBench v0.9.2**:
|
| 224 |
+
- Added 3198 queries and query statistics (schema-grounded queries to be added).
|
| 225 |
+
- Integrated BirdSQL MINIDEV benchmark and KaggleDBQA benchmark into RubikBench CLI.
|
| 226 |
+
- Released RubikBench evaluation toolkit as open-source Python package: [rubikbench](https://pypi.org/project/rubikbench/).
|
| 227 |
+
|
| 228 |
- [2026-02] Updated **RubikBench v0.9.1** database on huggingface: [RubikBench](https://huggingface.co/datasets/Magolor/RubikBench).
|
| 229 |
- Add support for `.parquet` format.
|
| 230 |
- More realistic business logic, reduced the number of products per project
|