messages
listlengths
3
3
prompt
stringlengths
1.15k
1.44k
target
stringlengths
472
1.62k
slice
stringclasses
3 values
domain
stringclasses
1 value
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: ACCESS PATTERN ANALYSIS] - Frequent query filters: `(order_date, customer_id, order_status)`. - Solution: Composite B-Tree index + Range partitioning by `order_date`. </Thinking> ```sql -- OPTIMAL COMPOSITE INDEXES & PARTITIONING FOR ORDERS CREATE INDEX idx_orders_customer_date_status ON orders(cus...
replay_buffer
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'GBP' AND a.account_type = 'commercial_treasury' AND al.risk_score > 73 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'direct_web' AND o.order_status = 'delivered' AND o.order_date >= '2024-07-01' AND o.order_date < '2024-11-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o....
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Enterprise' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Enterprise' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'direct_web' AND o.order_status = 'delivered' AND o.order_date >= '2024-07-01' AND o.order_date < '2024-11-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o....
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'affiliate' AND o.order_status = 'delivered' AND o.order_date >= '2024-04-01' AND o.order_date < '2024-12-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o.t...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Enterprise' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Scale' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month 3: `...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'JPY' AND a.account_type = 'commercial_treasury' AND al.risk_score > 85 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'CHF' AND a.account_type = 'commercial_treasury' AND al.risk_score > 88 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'USD' AND a.account_type = 'commercial_treasury' AND al.risk_score > 67 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'direct_web' AND o.order_status = 'delivered' AND o.order_date >= '2024-01-01' AND o.order_date < '2024-11-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o....
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'JPY' AND a.account_type = 'commercial_treasury' AND al.risk_score > 79 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'affiliate' AND o.order_status = 'delivered' AND o.order_date >= '2024-07-01' AND o.order_date < '2024-12-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o.t...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'CAD' AND a.account_type = 'commercial_treasury' AND al.risk_score > 94 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Custom_OEM' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Enterprise' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'CHF' AND a.account_type = 'commercial_treasury' AND al.risk_score > 94 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'affiliate' AND o.order_status = 'delivered' AND o.order_date >= '2024-01-01' AND o.order_date < '2024-12-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o.t...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Growth' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month 3: ...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'AUD' AND a.account_type = 'commercial_treasury' AND al.risk_score > 73 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Starter' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month 3:...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'direct_web' AND o.order_status = 'delivered' AND o.order_date >= '2024-04-01' AND o.order_date < '2024-11-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o....
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'direct_web' AND o.order_status = 'delivered' AND o.order_date >= '2024-04-01' AND o.order_date < '2024-11-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o....
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'USD' AND a.account_type = 'commercial_treasury' AND al.risk_score > 79 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'affiliate' AND o.order_status = 'delivered' AND o.order_date >= '2024-07-01' AND o.order_date < '2024-12-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o.t...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'CHF' AND a.account_type = 'commercial_treasury' AND al.risk_score > 70 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Custom_OEM' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: ACCESS PATTERN ANALYSIS] - Frequent query filters: `(order_date, customer_id, order_status)`. - Solution: Composite B-Tree index + Range partitioning by `order_date`. </Thinking> ```sql -- OPTIMAL COMPOSITE INDEXES & PARTITIONING FOR ORDERS CREATE INDEX idx_orders_customer_date_status ON orders(cus...
replay_buffer
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Starter' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month 3:...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: ACCESS PATTERN ANALYSIS] - Frequent query filters: `(order_date, customer_id, order_status)`. - Solution: Composite B-Tree index + Range partitioning by `order_date`. </Thinking> ```sql -- OPTIMAL COMPOSITE INDEXES & PARTITIONING FOR ORDERS CREATE INDEX idx_orders_customer_date_status ON orders(cus...
replay_buffer
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'SGD' AND a.account_type = 'commercial_treasury' AND al.risk_score > 88 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'CAD' AND a.account_type = 'commercial_treasury' AND al.risk_score > 82 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'affiliate' AND o.order_status = 'delivered' AND o.order_date >= '2024-04-01' AND o.order_date < '2024-12-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o.t...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Custom_OEM' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: ACCESS PATTERN ANALYSIS] - Frequent query filters: `(order_date, customer_id, order_status)`. - Solution: Composite B-Tree index + Range partitioning by `order_date`. </Thinking> ```sql -- OPTIMAL COMPOSITE INDEXES & PARTITIONING FOR ORDERS CREATE INDEX idx_orders_customer_date_status ON orders(cus...
replay_buffer
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'direct_web' AND o.order_status = 'delivered' AND o.order_date >= '2024-07-01' AND o.order_date < '2024-11-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o....
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'affiliate' AND o.order_status = 'delivered' AND o.order_date >= '2024-01-01' AND o.order_date < '2024-12-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o.t...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'affiliate' AND o.order_status = 'delivered' AND o.order_date >= '2024-07-01' AND o.order_date < '2024-12-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o.t...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: ACCESS PATTERN ANALYSIS] - Frequent query filters: `(order_date, customer_id, order_status)`. - Solution: Composite B-Tree index + Range partitioning by `order_date`. </Thinking> ```sql -- OPTIMAL COMPOSITE INDEXES & PARTITIONING FOR ORDERS CREATE INDEX idx_orders_customer_date_status ON orders(cus...
replay_buffer
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Custom_OEM' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'EUR' AND a.account_type = 'commercial_treasury' AND al.risk_score > 88 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Scale' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month 3: `...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Starter' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month 3:...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Starter' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month 3:...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: ACCESS PATTERN ANALYSIS] - Frequent query filters: `(order_date, customer_id, order_status)`. - Solution: Composite B-Tree index + Range partitioning by `order_date`. </Thinking> ```sql -- OPTIMAL COMPOSITE INDEXES & PARTITIONING FOR ORDERS CREATE INDEX idx_orders_customer_date_status ON orders(cus...
replay_buffer
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'direct_web' AND o.order_status = 'delivered' AND o.order_date >= '2024-07-01' AND o.order_date < '2024-11-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o....
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'affiliate' AND o.order_status = 'delivered' AND o.order_date >= '2024-01-01' AND o.order_date < '2024-12-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o.t...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'USD' AND a.account_type = 'commercial_treasury' AND al.risk_score > 91 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Growth' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month 3: ...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Starter' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month 3:...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'affiliate' AND o.order_status = 'delivered' AND o.order_date >= '2024-07-01' AND o.order_date < '2024-12-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o.t...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Growth' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month 3: ...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'CAD' AND a.account_type = 'commercial_treasury' AND al.risk_score > 70 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'USD' AND a.account_type = 'commercial_treasury' AND al.risk_score > 79 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Scale' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month 3: `...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'direct_web' AND o.order_status = 'delivered' AND o.order_date >= '2024-07-01' AND o.order_date < '2024-11-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o....
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: ACCESS PATTERN ANALYSIS] - Frequent query filters: `(order_date, customer_id, order_status)`. - Solution: Composite B-Tree index + Range partitioning by `order_date`. </Thinking> ```sql -- OPTIMAL COMPOSITE INDEXES & PARTITIONING FOR ORDERS CREATE INDEX idx_orders_customer_date_status ON orders(cus...
replay_buffer
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: ACCESS PATTERN ANALYSIS] - Frequent query filters: `(order_date, customer_id, order_status)`. - Solution: Composite B-Tree index + Range partitioning by `order_date`. </Thinking> ```sql -- OPTIMAL COMPOSITE INDEXES & PARTITIONING FOR ORDERS CREATE INDEX idx_orders_customer_date_status ON orders(cus...
replay_buffer
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: ACCESS PATTERN ANALYSIS] - Frequent query filters: `(order_date, customer_id, order_status)`. - Solution: Composite B-Tree index + Range partitioning by `order_date`. </Thinking> ```sql -- OPTIMAL COMPOSITE INDEXES & PARTITIONING FOR ORDERS CREATE INDEX idx_orders_customer_date_status ON orders(cus...
replay_buffer
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'affiliate' AND o.order_status = 'delivered' AND o.order_date >= '2024-01-01' AND o.order_date < '2024-12-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o.t...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Custom_OEM' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'GBP' AND a.account_type = 'commercial_treasury' AND al.risk_score > 79 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Custom_OEM' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'AUD' AND a.account_type = 'commercial_treasury' AND al.risk_score > 79 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'SGD' AND a.account_type = 'commercial_treasury' AND al.risk_score > 94 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'SGD' AND a.account_type = 'commercial_treasury' AND al.risk_score > 76 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (SAAS_BILLING): CREATE TABLE organizations (org_id BIGINT PRIMARY KEY, org_name VARCHAR(255), plan_name VARCHAR(100), billing_interval VARCHAR(20), created_at TIMESTAMP, status VARCHAR(50)); CREATE TABLE subscriptions (sub_id BIGINT PRIMARY KEY, org_id BIGINT REFERENCES organizations(org_id), mrr_am...
<Thinking> [PHASE 1: COHORT DEFINITION] - Entity: `organizations` (o) JOIN `subscriptions` (s) on `o.org_id = s.org_id`. - Filters: `o.plan_name = 'Growth' AND s.start_date >= '2025-01-01' AND s.start_date < '2026-01-01'`. - Cohort Grain: `DATE_TRUNC('month', s.start_date)`. [PHASE 2: RETENTION EVALUATION] - Month 3: ...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'affiliate' AND o.order_status = 'delivered' AND o.order_date >= '2024-04-01' AND o.order_date < '2024-12-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o.t...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'JPY' AND a.account_type = 'commercial_treasury' AND al.risk_score > 91 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'USD' AND a.account_type = 'commercial_treasury' AND al.risk_score > 85 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'affiliate' AND o.order_status = 'delivered' AND o.order_date >= '2024-07-01' AND o.order_date < '2024-12-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o.t...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (FINTECH_BANKING): CREATE TABLE accounts (account_id BIGINT PRIMARY KEY, account_number VARCHAR(34) UNIQUE, customer_id BIGINT, account_type VARCHAR(50), currency_code VARCHAR(3), available_balance DECIMAL(16,2), is_frozen BOOLEAN, opened_at TIMESTAMP); CREATE TABLE transactions (txn_id VARCHAR(64) ...
<Thinking> [PHASE 1: SCHEMA LINKING & JOIN PATHS] - Entities: `accounts` (a), `transactions` (t), `aml_alerts` (al). - Joins: `a.account_id = t.source_account_id` and `t.txn_id = al.txn_id`. - Filters: `a.currency_code = 'GBP' AND a.account_type = 'commercial_treasury' AND al.risk_score > 91 AND t.initiated_at >= NOW()...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: CATALOG SECURITY AUDIT] - Table `customers` schema: `customer_id`, `full_name`, `email`, `tier`, `country_code`, `signup_date`. - Violation: The relational catalog does not contain payment PANs, tokens, or CVV security codes per PCI-DSS compliance regulations. [PHASE 2: REFUTATION EMISSION] - Refu...
hard_negative
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'affiliate' AND o.order_status = 'delivered' AND o.order_date >= '2024-04-01' AND o.order_date < '2024-12-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o.t...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: GRAIN & ENTITY LINKING] - Entity: `orders` (o). - Filters: `o.channel = 'affiliate' AND o.order_status = 'delivered' AND o.order_date >= '2024-01-01' AND o.order_date < '2024-12-28'`. - Grain: Group by `DATE(o.order_date)`. [PHASE 2: WINDOW FUNCTION & TEMPORAL BOUNDS] - Daily Revenue CTE: `SUM(o.t...
gold
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: ACCESS PATTERN ANALYSIS] - Frequent query filters: `(order_date, customer_id, order_status)`. - Solution: Composite B-Tree index + Range partitioning by `order_date`. </Thinking> ```sql -- OPTIMAL COMPOSITE INDEXES & PARTITIONING FOR ORDERS CREATE INDEX idx_orders_customer_date_status ON orders(cus...
replay_buffer
curated_600_text2sql
[ { "role": "system", "content": "You are a specialized Enterprise SQL Compiler and Database Reasoning AI. Conduct rigorous step-by-step schema linking, constraint auditing, and dialect planning inside <Thinking> and </Thinking> tags before generating the final optimized SQL query." }, { "role": "user...
### DATABASE SCHEMA (ECOMMERCE): CREATE TABLE customers (customer_id BIGINT PRIMARY KEY, full_name VARCHAR(150), email VARCHAR(255), tier VARCHAR(50), country_code VARCHAR(3), signup_date DATE); CREATE TABLE products (product_id BIGINT PRIMARY KEY, category_id INT, sku VARCHAR(64), product_name VARCHAR(255), unit_cost ...
<Thinking> [PHASE 1: ACCESS PATTERN ANALYSIS] - Frequent query filters: `(order_date, customer_id, order_status)`. - Solution: Composite B-Tree index + Range partitioning by `order_date`. </Thinking> ```sql -- OPTIMAL COMPOSITE INDEXES & PARTITIONING FOR ORDERS CREATE INDEX idx_orders_customer_date_status ON orders(cus...
replay_buffer
curated_600_text2sql