Skip to content

oracle-samples/nl2analytics-view-sql-benchmark

Repository files navigation

ORACLE AND ITS AFFILIATES DO NOT PROVIDE ANY WARRANTY WHATSOEVER, EXPRESS OR IMPLIED, FOR ANY SOFTWARE, MATERIAL OR CONTENT OF ANY KIND CONTAINED OR PRODUCED WITHIN THIS REPOSITORY, AND IN PARTICULAR SPECIFICALLY DISCLAIM ANY AND ALL IMPLIED WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. FURTHERMORE, ORACLE AND ITS AFFILIATES DO NOT REPRESENT THAT ANY CUSTOMARY SECURITY REVIEW HAS BEEN PERFORMED WITH RESPECT TO ANY SOFTWARE, MATERIAL OR CONTENT CONTAINED OR PRODUCED WITHIN THIS REPOSITORY. IN ADDITION, AND WITHOUT LIMITING THE FOREGOING, THIRD PARTIES MAY HAVE POSTED SOFTWARE, MATERIAL OR CONTENT TO THIS REPOSITORY WITHOUT ANY REVIEW. USE AT YOUR OWN RISK.

NL 2 Analytic Views SQL Benchmark

This repository contains resources for benchmarking natural language to Oracle Analytic View (AV) SQL generation. It provides Oracle Analytic View definitions over tables from multiple public-data domains, along with natural language questions and gold Analytic View SQL answers.

The benchmark is intended to test how well LLMs and agentic NL2SQL systems can discover analytic-view metadata, choose the right dimensions, hierarchies, levels, and measures, and produce valid Oracle SQL using FROM ANALYTIC VIEW (USING ...) patterns.

The data artifacts live under benchmark/ and include the following.

Agent Specs

The benchmark/agent/ directory includes two Open Agent Spec exports used by the benchmark. The Analytic View agent uses schema-discovery and AV-specific metadata tools, executes candidate SQL for validation, and returns final AV SQL. The vanilla agent provides a baseline using only general schema-discovery and SQL-execution tools, without the Analytic View skill or AV-specific tools.

The results highlight that an AV SQL skill with specialized Analytic View tools substantially outperforms a vanilla agent baseline across model families.

Data Tables

Source links and licensing or reuse notes below were checked against the current source pages or portal terms on 2026-04-28.

Table Host Download link CSV file License or reuse terms License link Notes
BROOKLYN_SALES www.nyc.gov Download BROOKLYN_SALES.csv NYC Open Data Terms of Use (Public Domain/Open Data) NYC Open Data Public Policies The data is provided "as is". Although it is free of restrictive rights, the user assumes full responsibility for verifying the accuracy of prices and cadastral information before any commercial or legal use.
CALF_EMPLOYMENT_SURVEY data.ca.gov Download CALF_EMPLOYMENT_SURVEY.csv Creative Commons Attribution CC BY 4.0 Listed directly on the CA Open Data dataset page.
CALF_VEHICLE_FUEL_TYPES data.ca.gov Download CALF_VEHICLE_FUEL_TYPES.csv Public domain CA Open Data Licenses Listed directly on the CA Open Data dataset page.
ITALY_WEEKLY_FUEL_PRICES data.europa.eu Download ITALY_WEEKLY_FUEL_PRICES.csv Italian Open Data License (IODL) 2.0 IODL 2.0 This license allows viewing, extraction, downloading, copying, distribution, and the creation of derivative works (mashups). The user is required to cite the source (Ministero dell'Ambiente e della Sicurezza Energetica) and include a link to the IODL 2.0 license.
MASS_WELL_DRILLING data.mass.gov Download MASS_WELL_DRILLING.csv Massachusetts Public Records Law (G.L. c. 66) Massachusetts G.L. c. 66 Public Records Law (G.L. c. 66) As a public document, this data is presumed to be open to all. The state cannot restrict your use of it (commercial or otherwise), but it disclaims all responsibility for the technical accuracy of drilling reports submitted by third parties (certified drillers).
NYC_FOR_HIRE_VEHICLES data.cityofnewyork.us Download NYC_FOR_HIRE_VEHICLES.csv No restrictions on use via NYC Open Data NYC Open Data FAQ NYC Open Data says there are no restrictions on the use of Open Data, while also stating that users are subject to NYC.gov terms of use and any additional agency terms.
NYC_PAYROLL data.cityofnewyork.us Download NYC_PAYROLL.csv No restrictions on use via NYC Open Data NYC Open Data FAQ NYC Open Data says there are no restrictions on the use of Open Data, while also stating that users are subject to NYC.gov terms of use and any additional agency terms.
NYPD_SHOOTING_INCIDENTS_2024 data.cityofnewyork.us Download NYPD_SHOOTING_INCIDENTS_2024.csv No restrictions on use via NYC Open Data NYC Open Data FAQ NYC Open Data says there are no restrictions on the use of Open Data, while also stating that users are subject to NYC.gov terms of use and any additional agency terms.
NYS_SPENDING_T data.ny.gov Download NYS_SPENDING_T.csv OPEN-NY Terms of Use OPEN-NY Terms of Use OPEN-NY says users may freely download and use portal content as long as they comply with the terms of use.
ONTIME_PERFORMANCE transtats.bts.gov Download ONTIME_PERFORMANCE.csv Public Domain (Domaine Public US) USA.gov Federal Copyright Guidance As a work of the U.S. federal government, this dataset is in the public domain. It may be copied, modified, and distributed without permission, including for commercial purposes. Attribution to the BTS is, however, recommended for data transparency.
SMALL_AREA_HEALTH_INSURANCE_ESTIMATES www.census.gov Download SMALL_AREA_HEALTH_INSURANCE_ESTIMATES.csv Federal government public-use/open data Census Open Data Census describes its public datasets as open/public-use data that users can analyze, extract, customize, and publish, subject to privacy protections and any non-government content exceptions.
USDA_COUNTY_POPULATION www.ers.usda.gov Download USDA_COUNTY_POPULATION.csv Public domain (USDA) USDA Policies and Links USDA says most information on USDA websites is considered public domain and may be freely distributed or copied, with attribution requested.

Oracle DDL Data for Schema Creation

The benchmark/data/ddl/ folder contains the schema-side artifacts (Table DDL, Analytic view DDL, Attribute dimension DDL and Hierarchy DDL) for the dataset:

Oracle DML Data for Data Ingestion

The benchmark/data/dml/ folder contains the generated insert payloads derived from the source CSV extracts.

Natural Language Questions to Oracle AV SQL examples

The benchmark/data/questions/ folder contains per-analytic-view NL2SQL task files in .jsonl format.

Contributing

This project is not accepting external contributions at this time.

Security

Please consult the security guide for our responsible security vulnerability disclosure process

License

Copyright (c) 2026 Oracle and/or its affiliates. Released under the Creative Commons Attribution 4.0 International License (CC BY 4.0) as shown under https://creativecommons.org/licenses/by/4.0/

About

This repository contains resources for benchmarking natural language to Oracle Analytic View (AV) SQL generation. It provides Oracle Analytic View definitions over tables from multiple public-data domains, along with natural language questions and gold Analytic View SQL answers.

Resources

License

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Generated from oracle/template-repo