variant stringclasses 3
values | prompt stringlengths 163 237 | sql stringlengths 103 143 | metadata unknown | id stringlengths 21 21 | split stringclasses 1
value | token_group stringclasses 2
values |
|---|---|---|---|---|---|---|
v3 | Schema:
invoices (alias: inv)(name, salary, id, code)
transactions(name, value, date, id)
Task: Retrieve salary from invoices with salary above the SUM(amount) of transactions rows sharing the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE salary > (
SELECT SUM(amount) FROM transactions AS txn
WHERE txn.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_01300 | train | T1 |
v1 | Schema:
budgets (alias: budg)(type, status, name, date)
accounts(amount, level, salary, type)
Task: Retrieve id from budgets whose status is found in accounts rows where code matches the outer record.
SQL: | SELECT id FROM budgets AS budg
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "accounts",
"outer_alias": "budg",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_01301 | train | T2 |
v2 | Schema:
sales (alias: sale)(type, name, level, id)
warehouses(amount, type, salary, value)
Task: Find value from sales where a matching record exists in warehouses with the same level.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "warehouses",
"outer_alias": "sale",
"inner_alias": "whs",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_01302 | train | T1 |
v3 | Schema:
shipments (alias: shp)(amount, value, name, type)
categories(id, value, status, date)
Task: Find name from shipments where amount exceeds the average amount from categories for the same status.
SQL: | SELECT name FROM shipments AS shp
WHERE amount > (
SELECT AVG(amount) FROM categories AS catg
WHERE catg.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_01303 | train | T2 |
v3 | Schema:
shipments (alias: shp)(salary, name, status, amount)
managers(code, level, name, date)
Task: Retrieve value from shipments with salary above the MIN(amount) of managers rows sharing the same type.
SQL: | SELECT value FROM shipments AS shp
WHERE salary > (
SELECT MIN(amount) FROM managers AS mgr
WHERE mgr.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_01304 | train | T2 |
v2 | Schema:
sales (alias: sale)(code, type, id, salary)
shipments(type, date, status, name)
Task: Find amount from sales where a matching record exists in shipments with the same status.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_01305 | train | T1 |
v3 | Schema:
categories (alias: catg)(salary, date, amount, name)
customers(value, type, salary, name)
Task: Retrieve id from categories with amount above the MIN(salary) of customers rows sharing the same type.
SQL: | SELECT id FROM categories AS catg
WHERE amount > (
SELECT MIN(salary) FROM customers AS cust
WHERE cust.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_01306 | train | T2 |
v1 | Schema:
transactions (alias: txn)(date, type, amount, level)
employees(salary, status, id, code)
Task: Retrieve name from transactions whose level is found in employees rows where status matches the outer record.
SQL: | SELECT name FROM transactions AS txn
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_01307 | train | T1 |
v3 | Schema:
accounts (alias: acct)(salary, code, name, date)
requests(code, status, date, salary)
Task: Retrieve code from accounts with amount above the MAX(salary) of requests rows sharing the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE amount > (
SELECT MAX(salary) FROM requests AS ordr
WHERE ordr.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_01308 | train | T1 |
v2 | Schema:
products (alias: prod)(amount, level, id, code)
managers(level, code, amount, type)
Task: Retrieve amount from products that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = prod.id
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_01309 | train | T1 |
v1 | Schema:
categories (alias: catg)(level, type, status, date)
items(value, level, salary, type)
Task: Retrieve salary from categories whose id is found in items rows where status matches the outer record.
SQL: | SELECT salary FROM categories AS catg
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_01310 | train | T2 |
v2 | Schema:
sales (alias: sale)(amount, name, code, id)
orders(name, code, amount, type)
Task: Find code from sales where a matching record exists in orders with the same status.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_01311 | train | T1 |
v1 | Schema:
services (alias: srvc)(name, date, salary, amount)
shipments(name, status, level, date)
Task: Retrieve id from services whose type is found in shipments rows where status matches the outer record.
SQL: | SELECT id FROM services AS srvc
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "shipments",
"outer_alias": "srvc",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_01312 | train | T2 |
v1 | Schema:
invoices (alias: inv)(amount, date, id, level)
products(name, status, level, code)
Task: Find salary from invoices where type appears in products entries with matching code.
SQL: | SELECT salary FROM invoices AS inv
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_01313 | train | T1 |
v3 | Schema:
managers (alias: mgr)(name, value, status, id)
orders(id, code, status, value)
Task: Find amount from managers where salary exceeds the average salary from orders for the same level.
SQL: | SELECT amount FROM managers AS mgr
WHERE salary > (
SELECT COUNT(salary) FROM orders AS ord
WHERE ord.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_01314 | train | T1 |
v3 | Schema:
products (alias: prod)(amount, name, code, date)
accounts(code, type, id, amount)
Task: Find code from products where value exceeds the average salary from accounts for the same code.
SQL: | SELECT code FROM products AS prod
WHERE value > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.code = prod.code
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_01315 | train | T1 |
v1 | Schema:
regions (alias: rgn)(id, type, name, value)
budgets(salary, amount, date, name)
Task: Find name from regions where status appears in budgets entries with matching level.
SQL: | SELECT name FROM regions AS rgn
WHERE status IN (
SELECT status FROM budgets AS budg
WHERE budg.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "budgets",
"outer_alias": "rgn",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_01316 | train | T2 |
v2 | Schema:
transactions (alias: txn)(date, id, name, code)
products(name, level, value, amount)
Task: Find id from transactions where a matching record exists in products with the same code.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_01317 | train | T1 |
v2 | Schema:
staff (alias: empl)(name, value, status, type)
products(date, id, value, level)
Task: Find value from staff where a matching record exists in products with the same type.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_01318 | train | T2 |
v3 | Schema:
regions (alias: rgn)(code, value, name, salary)
transactions(code, level, type, id)
Task: Retrieve code from regions with amount above the AVG(salary) of transactions rows sharing the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE amount > (
SELECT AVG(salary) FROM transactions AS txn
WHERE txn.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_01319 | train | T2 |
v2 | Schema:
orders (alias: ord)(type, status, code, value)
shipments(status, salary, id, code)
Task: Retrieve name from orders that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_01320 | train | T1 |
v3 | Schema:
transactions (alias: txn)(code, value, date, amount)
budgets(code, type, level, id)
Task: Retrieve salary from transactions with value above the MIN(value) of budgets rows sharing the same type.
SQL: | SELECT salary FROM transactions AS txn
WHERE value > (
SELECT MIN(value) FROM budgets AS budg
WHERE budg.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "budgets",
"outer_alias": "txn",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_01321 | train | T1 |
v3 | Schema:
products (alias: prod)(id, salary, date, code)
employees(level, amount, name, value)
Task: Retrieve code from products with amount above the AVG(salary) of employees rows sharing the same level.
SQL: | SELECT code FROM products AS prod
WHERE amount > (
SELECT AVG(salary) FROM employees AS emp
WHERE emp.level = prod.level
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_01322 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(name, value, id, code)
accounts(code, status, type, date)
Task: Find id from warehouses where a matching record exists in accounts with the same status.
SQL: | SELECT id FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "accounts",
"outer_alias": "whs",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_01323 | train | T2 |
v1 | Schema:
departments (alias: dept)(name, level, status, amount)
sales(amount, code, level, status)
Task: Find value from departments where code appears in sales entries with matching level.
SQL: | SELECT value FROM departments AS dept
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_01324 | train | T1 |
v2 | Schema:
schedules (alias: schd)(level, value, name, salary)
departments(name, value, id, salary)
Task: Retrieve name from schedules that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_01325 | train | T2 |
v1 | Schema:
employees (alias: emp)(salary, date, name, amount)
products(status, amount, level, code)
Task: Select salary from employees where id exists in products for the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_01326 | train | T1 |
v3 | Schema:
items (alias: lne)(amount, level, value, type)
transactions(salary, code, amount, id)
Task: Retrieve id from items with amount above the AVG(value) of transactions rows sharing the same status.
SQL: | SELECT id FROM items AS lne
WHERE amount > (
SELECT AVG(value) FROM transactions AS txn
WHERE txn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_01327 | train | T2 |
v1 | Schema:
accounts (alias: acct)(id, date, level, status)
warehouses(salary, id, amount, value)
Task: Select value from accounts where type exists in warehouses for the same level.
SQL: | SELECT value FROM accounts AS acct
WHERE type IN (
SELECT type FROM warehouses AS whs
WHERE whs.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "warehouses",
"outer_alias": "acct",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_01328 | train | T1 |
v1 | Schema:
managers (alias: mgr)(name, salary, id, value)
employees(name, salary, type, amount)
Task: Find amount from managers where code appears in employees entries with matching id.
SQL: | SELECT amount FROM managers AS mgr
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_01329 | train | T1 |
v2 | Schema:
items (alias: lne)(salary, value, date, level)
transactions(status, level, amount, salary)
Task: Retrieve amount from items that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_01330 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(type, salary, id, amount)
shipments(date, status, amount, level)
Task: Find id from warehouses where level appears in shipments entries with matching code.
SQL: | SELECT id FROM warehouses AS whs
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "shipments",
"outer_alias": "whs",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_01331 | train | T2 |
v2 | Schema:
shipments (alias: shp)(name, date, salary, code)
employees(date, code, id, level)
Task: Retrieve name from shipments that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_01332 | train | T2 |
v2 | Schema:
transactions (alias: txn)(code, salary, type, amount)
staff(amount, date, level, id)
Task: Find value from transactions where a matching record exists in staff with the same level.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_01333 | train | T1 |
v3 | Schema:
categories (alias: catg)(type, level, name, id)
requests(salary, name, status, value)
Task: Find amount from categories where value exceeds the average amount from requests for the same type.
SQL: | SELECT amount FROM categories AS catg
WHERE value > (
SELECT SUM(amount) FROM requests AS ordr
WHERE ordr.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_01334 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(type, name, date, status)
requests(status, type, value, amount)
Task: Retrieve id from warehouses with value above the MAX(amount) of requests rows sharing the same id.
SQL: | SELECT id FROM warehouses AS whs
WHERE value > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "requests",
"outer_alias": "whs",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_01335 | train | T2 |
v1 | Schema:
services (alias: srvc)(value, amount, status, id)
customers(amount, id, date, value)
Task: Retrieve amount from services whose level is found in customers rows where id matches the outer record.
SQL: | SELECT amount FROM services AS srvc
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "customers",
"outer_alias": "srvc",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_01336 | train | T2 |
v2 | Schema:
requests (alias: ordr)(name, date, id, level)
transactions(type, salary, date, code)
Task: Retrieve code from requests that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_01337 | train | T2 |
v3 | Schema:
schedules (alias: schd)(id, type, date, level)
departments(value, level, name, code)
Task: Find salary from schedules where salary exceeds the average value from departments for the same code.
SQL: | SELECT salary FROM schedules AS schd
WHERE salary > (
SELECT MAX(value) FROM departments AS dept
WHERE dept.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_01338 | train | T2 |
v1 | Schema:
budgets (alias: budg)(value, name, id, code)
regions(id, status, name, value)
Task: Retrieve name from budgets whose id is found in regions rows where id matches the outer record.
SQL: | SELECT name FROM budgets AS budg
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "regions",
"outer_alias": "budg",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_01339 | train | T2 |
v3 | Schema:
shipments (alias: shp)(id, value, amount, salary)
items(name, id, type, level)
Task: Find salary from shipments where value exceeds the average salary from items for the same level.
SQL: | SELECT salary FROM shipments AS shp
WHERE value > (
SELECT SUM(salary) FROM items AS lne
WHERE lne.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_01340 | train | T2 |
v1 | Schema:
items (alias: lne)(amount, date, type, code)
departments(salary, type, code, level)
Task: Select code from items where code exists in departments for the same status.
SQL: | SELECT code FROM items AS lne
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.status = lne.status
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_01341 | train | T2 |
v2 | Schema:
schedules (alias: schd)(id, value, date, level)
invoices(status, amount, value, name)
Task: Find value from schedules where a matching record exists in invoices with the same level.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_01342 | train | T2 |
v1 | Schema:
requests (alias: ordr)(code, status, level, amount)
shipments(type, level, amount, code)
Task: Retrieve salary from requests whose level is found in shipments rows where id matches the outer record.
SQL: | SELECT salary FROM requests AS ordr
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_01343 | train | T2 |
v1 | Schema:
staff (alias: empl)(type, level, value, status)
accounts(level, id, code, amount)
Task: Select code from staff where code exists in accounts for the same status.
SQL: | SELECT code FROM staff AS empl
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_01344 | train | T2 |
v2 | Schema:
shipments (alias: shp)(amount, date, level, id)
transactions(level, amount, date, value)
Task: Find id from shipments where a matching record exists in transactions with the same status.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_01345 | train | T2 |
v1 | Schema:
accounts (alias: acct)(salary, level, status, id)
managers(amount, name, level, date)
Task: Select amount from accounts where status exists in managers for the same level.
SQL: | SELECT amount FROM accounts AS acct
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_01346 | train | T1 |
v3 | Schema:
categories (alias: catg)(value, type, code, salary)
employees(salary, name, value, level)
Task: Retrieve name from categories with salary above the MIN(amount) of employees rows sharing the same id.
SQL: | SELECT name FROM categories AS catg
WHERE salary > (
SELECT MIN(amount) FROM employees AS emp
WHERE emp.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_01347 | train | T2 |
v2 | Schema:
invoices (alias: inv)(value, id, amount, date)
departments(type, date, code, value)
Task: Retrieve amount from invoices that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_01348 | train | T1 |
v3 | Schema:
invoices (alias: inv)(status, salary, value, amount)
budgets(type, amount, name, salary)
Task: Retrieve value from invoices with value above the MAX(salary) of budgets rows sharing the same level.
SQL: | SELECT value FROM invoices AS inv
WHERE value > (
SELECT MAX(salary) FROM budgets AS budg
WHERE budg.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "budgets",
"outer_alias": "inv",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_01349 | train | T1 |
v2 | Schema:
transactions (alias: txn)(level, value, name, code)
managers(value, status, salary, level)
Task: Find value from transactions where a matching record exists in managers with the same code.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_01350 | train | T1 |
v2 | Schema:
categories (alias: catg)(date, level, amount, salary)
managers(code, id, value, salary)
Task: Retrieve amount from categories that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_01351 | train | T2 |
v1 | Schema:
services (alias: srvc)(name, type, status, id)
budgets(type, level, value, amount)
Task: Retrieve name from services whose code is found in budgets rows where code matches the outer record.
SQL: | SELECT name FROM services AS srvc
WHERE code IN (
SELECT code FROM budgets AS budg
WHERE budg.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "budgets",
"outer_alias": "srvc",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_01352 | train | T2 |
v1 | Schema:
departments (alias: dept)(date, salary, status, value)
shipments(type, status, value, amount)
Task: Retrieve name from departments whose type is found in shipments rows where level matches the outer record.
SQL: | SELECT name FROM departments AS dept
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_01353 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(date, level, status, code)
sales(value, code, status, type)
Task: Find code from warehouses where a matching record exists in sales with the same code.
SQL: | SELECT code FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "sales",
"outer_alias": "whs",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_01354 | train | T2 |
v2 | Schema:
requests (alias: ordr)(status, level, amount, name)
departments(date, id, type, salary)
Task: Retrieve code from requests that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_01355 | train | T2 |
v1 | Schema:
sales (alias: sale)(name, level, code, date)
schedules(value, amount, id, salary)
Task: Find code from sales where status appears in schedules entries with matching id.
SQL: | SELECT code FROM sales AS sale
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_01356 | train | T1 |
v2 | Schema:
employees (alias: emp)(amount, value, date, salary)
managers(level, date, salary, name)
Task: Retrieve value from employees that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_01357 | train | T1 |
v3 | Schema:
schedules (alias: schd)(id, date, type, value)
budgets(status, amount, level, id)
Task: Find id from schedules where salary exceeds the average amount from budgets for the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE salary > (
SELECT AVG(amount) FROM budgets AS budg
WHERE budg.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "budgets",
"outer_alias": "schd",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_01358 | train | T2 |
v2 | Schema:
accounts (alias: acct)(level, value, date, id)
employees(date, salary, amount, type)
Task: Find amount from accounts where a matching record exists in employees with the same code.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_01359 | train | T1 |
v3 | Schema:
requests (alias: ordr)(date, value, id, status)
managers(status, code, amount, date)
Task: Find id from requests where salary exceeds the average salary from managers for the same code.
SQL: | SELECT id FROM requests AS ordr
WHERE salary > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_01360 | train | T2 |
v3 | Schema:
managers (alias: mgr)(id, name, value, date)
shipments(type, id, value, name)
Task: Find amount from managers where salary exceeds the average salary from shipments for the same type.
SQL: | SELECT amount FROM managers AS mgr
WHERE salary > (
SELECT MAX(salary) FROM shipments AS shp
WHERE shp.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_01361 | train | T1 |
v1 | Schema:
regions (alias: rgn)(type, code, date, level)
staff(amount, level, id, code)
Task: Find name from regions where code appears in staff entries with matching id.
SQL: | SELECT name FROM regions AS rgn
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_01362 | train | T2 |
v1 | Schema:
transactions (alias: txn)(name, status, id, salary)
accounts(status, amount, level, name)
Task: Retrieve salary from transactions whose level is found in accounts rows where type matches the outer record.
SQL: | SELECT salary FROM transactions AS txn
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_01363 | train | T1 |
v2 | Schema:
staff (alias: empl)(id, type, date, name)
shipments(salary, amount, id, date)
Task: Retrieve amount from staff that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_01364 | train | T2 |
v3 | Schema:
managers (alias: mgr)(amount, value, name, level)
departments(salary, name, type, code)
Task: Retrieve id from managers with amount above the AVG(salary) of departments rows sharing the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE amount > (
SELECT AVG(salary) FROM departments AS dept
WHERE dept.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_01365 | train | T1 |
v3 | Schema:
services (alias: srvc)(id, level, code, salary)
employees(level, type, value, id)
Task: Retrieve value from services with amount above the MAX(salary) of employees rows sharing the same id.
SQL: | SELECT value FROM services AS srvc
WHERE amount > (
SELECT MAX(salary) FROM employees AS emp
WHERE emp.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "employees",
"outer_alias": "srvc",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_01366 | train | T2 |
v3 | Schema:
orders (alias: ord)(date, type, name, level)
managers(amount, value, type, code)
Task: Find name from orders where value exceeds the average value from managers for the same level.
SQL: | SELECT name FROM orders AS ord
WHERE value > (
SELECT AVG(value) FROM managers AS mgr
WHERE mgr.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_01367 | train | T1 |
v1 | Schema:
items (alias: lne)(name, code, salary, type)
regions(level, code, status, name)
Task: Select salary from items where status exists in regions for the same code.
SQL: | SELECT salary FROM items AS lne
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.code = lne.code
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_01368 | train | T2 |
v2 | Schema:
regions (alias: rgn)(id, value, status, code)
customers(level, date, amount, type)
Task: Find code from regions where a matching record exists in customers with the same id.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_01369 | train | T2 |
v1 | Schema:
schedules (alias: schd)(id, status, date, level)
requests(code, value, name, level)
Task: Find name from schedules where id appears in requests entries with matching id.
SQL: | SELECT name FROM schedules AS schd
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_01370 | train | T2 |
v3 | Schema:
requests (alias: ordr)(status, amount, level, salary)
accounts(date, value, id, name)
Task: Find code from requests where amount exceeds the average salary from accounts for the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE amount > (
SELECT SUM(salary) FROM accounts AS acct
WHERE acct.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_01371 | train | T2 |
v1 | Schema:
orders (alias: ord)(value, name, amount, salary)
services(type, code, amount, salary)
Task: Retrieve code from orders whose status is found in services rows where type matches the outer record.
SQL: | SELECT code FROM orders AS ord
WHERE status IN (
SELECT status FROM services AS srvc
WHERE srvc.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "services",
"outer_alias": "ord",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_01372 | train | T1 |
v3 | Schema:
managers (alias: mgr)(status, code, value, date)
accounts(level, salary, date, value)
Task: Find salary from managers where salary exceeds the average amount from accounts for the same code.
SQL: | SELECT salary FROM managers AS mgr
WHERE salary > (
SELECT SUM(amount) FROM accounts AS acct
WHERE acct.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_01373 | train | T1 |
v2 | Schema:
customers (alias: cust)(code, level, type, salary)
budgets(value, id, salary, amount)
Task: Find name from customers where a matching record exists in budgets with the same level.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "budgets",
"outer_alias": "cust",
"inner_alias": "budg",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_01374 | train | T1 |
v3 | Schema:
accounts (alias: acct)(salary, status, id, amount)
products(amount, type, salary, level)
Task: Find code from accounts where value exceeds the average value from products for the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE value > (
SELECT MIN(value) FROM products AS prod
WHERE prod.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_01375 | train | T1 |
v1 | Schema:
budgets (alias: budg)(amount, code, date, id)
invoices(value, code, status, level)
Task: Find code from budgets where code appears in invoices entries with matching id.
SQL: | SELECT code FROM budgets AS budg
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "invoices",
"outer_alias": "budg",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_01376 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(code, date, amount, type)
schedules(name, code, amount, type)
Task: Find salary from warehouses where a matching record exists in schedules with the same type.
SQL: | SELECT salary FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "schedules",
"outer_alias": "whs",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_01377 | train | T2 |
v2 | Schema:
transactions (alias: txn)(level, code, date, value)
products(value, type, code, status)
Task: Find id from transactions where a matching record exists in products with the same level.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_01378 | train | T1 |
v1 | Schema:
departments (alias: dept)(name, salary, value, id)
managers(value, salary, name, status)
Task: Find value from departments where code appears in managers entries with matching type.
SQL: | SELECT value FROM departments AS dept
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_01379 | train | T1 |
v3 | Schema:
customers (alias: cust)(code, type, value, level)
products(level, name, code, date)
Task: Find name from customers where salary exceeds the average amount from products for the same status.
SQL: | SELECT name FROM customers AS cust
WHERE salary > (
SELECT COUNT(amount) FROM products AS prod
WHERE prod.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_01380 | train | T1 |
v3 | Schema:
shipments (alias: shp)(date, value, code, name)
employees(name, salary, amount, value)
Task: Retrieve salary from shipments with amount above the AVG(value) of employees rows sharing the same status.
SQL: | SELECT salary FROM shipments AS shp
WHERE amount > (
SELECT AVG(value) FROM employees AS emp
WHERE emp.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_01381 | train | T2 |
v3 | Schema:
customers (alias: cust)(name, code, type, level)
items(id, name, amount, code)
Task: Find id from customers where salary exceeds the average amount from items for the same code.
SQL: | SELECT id FROM customers AS cust
WHERE salary > (
SELECT MIN(amount) FROM items AS lne
WHERE lne.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_01382 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(date, level, status, salary)
shipments(code, amount, level, status)
Task: Retrieve name from warehouses whose type is found in shipments rows where status matches the outer record.
SQL: | SELECT name FROM warehouses AS whs
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "shipments",
"outer_alias": "whs",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_01383 | train | T2 |
v3 | Schema:
categories (alias: catg)(id, type, date, name)
warehouses(salary, status, id, date)
Task: Retrieve value from categories with value above the COUNT(salary) of warehouses rows sharing the same code.
SQL: | SELECT value FROM categories AS catg
WHERE value > (
SELECT COUNT(salary) FROM warehouses AS whs
WHERE whs.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "warehouses",
"outer_alias": "catg",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_01384 | train | T2 |
v1 | Schema:
orders (alias: ord)(salary, type, date, name)
items(code, date, value, salary)
Task: Retrieve code from orders whose code is found in items rows where status matches the outer record.
SQL: | SELECT code FROM orders AS ord
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_01385 | train | T1 |
v2 | Schema:
schedules (alias: schd)(amount, level, value, id)
categories(date, amount, value, name)
Task: Retrieve id from schedules that have at least one corresponding entry in categories sharing the same level.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_01386 | train | T2 |
v2 | Schema:
managers (alias: mgr)(level, date, type, salary)
schedules(level, id, status, date)
Task: Retrieve code from managers that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_01387 | train | T1 |
v1 | Schema:
budgets (alias: budg)(value, id, name, salary)
customers(amount, value, date, code)
Task: Select name from budgets where type exists in customers for the same code.
SQL: | SELECT name FROM budgets AS budg
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "customers",
"outer_alias": "budg",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_01388 | train | T2 |
v2 | Schema:
categories (alias: catg)(amount, level, value, salary)
orders(id, name, salary, level)
Task: Find salary from categories where a matching record exists in orders with the same level.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_01389 | train | T2 |
v3 | Schema:
managers (alias: mgr)(name, id, amount, status)
shipments(value, type, id, status)
Task: Retrieve salary from managers with amount above the MIN(salary) of shipments rows sharing the same type.
SQL: | SELECT salary FROM managers AS mgr
WHERE amount > (
SELECT MIN(salary) FROM shipments AS shp
WHERE shp.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_01390 | train | T1 |
v1 | Schema:
services (alias: srvc)(name, date, id, amount)
accounts(id, amount, status, level)
Task: Select id from services where id exists in accounts for the same status.
SQL: | SELECT id FROM services AS srvc
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "accounts",
"outer_alias": "srvc",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_01391 | train | T2 |
v1 | Schema:
transactions (alias: txn)(code, value, salary, level)
services(value, salary, code, name)
Task: Select value from transactions where code exists in services for the same type.
SQL: | SELECT value FROM transactions AS txn
WHERE code IN (
SELECT code FROM services AS srvc
WHERE srvc.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "services",
"outer_alias": "txn",
"inner_alias": "srvc",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_01392 | train | T1 |
v3 | Schema:
schedules (alias: schd)(code, type, date, status)
managers(amount, id, salary, level)
Task: Retrieve value from schedules with salary above the MIN(salary) of managers rows sharing the same id.
SQL: | SELECT value FROM schedules AS schd
WHERE salary > (
SELECT MIN(salary) FROM managers AS mgr
WHERE mgr.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_01393 | train | T2 |
v3 | Schema:
budgets (alias: budg)(amount, salary, name, value)
shipments(id, code, date, level)
Task: Find value from budgets where value exceeds the average value from shipments for the same id.
SQL: | SELECT value FROM budgets AS budg
WHERE value > (
SELECT AVG(value) FROM shipments AS shp
WHERE shp.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "shipments",
"outer_alias": "budg",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_01394 | train | T2 |
v1 | Schema:
customers (alias: cust)(id, type, amount, value)
shipments(id, name, amount, salary)
Task: Select code from customers where level exists in shipments for the same code.
SQL: | SELECT code FROM customers AS cust
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_01395 | train | T1 |
v1 | Schema:
managers (alias: mgr)(level, type, code, date)
warehouses(value, type, id, code)
Task: Select name from managers where level exists in warehouses for the same level.
SQL: | SELECT name FROM managers AS mgr
WHERE level IN (
SELECT level FROM warehouses AS whs
WHERE whs.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "warehouses",
"outer_alias": "mgr",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_01396 | train | T1 |
v3 | Schema:
sales (alias: sale)(value, date, level, code)
schedules(code, type, name, salary)
Task: Find amount from sales where value exceeds the average salary from schedules for the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE value > (
SELECT MAX(salary) FROM schedules AS schd
WHERE schd.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_01397 | train | T1 |
v1 | Schema:
employees (alias: emp)(salary, type, code, id)
departments(salary, amount, status, value)
Task: Find salary from employees where level appears in departments entries with matching type.
SQL: | SELECT salary FROM employees AS emp
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_01398 | train | T1 |
v1 | Schema:
staff (alias: empl)(status, name, salary, code)
services(value, type, date, name)
Task: Select code from staff where type exists in services for the same code.
SQL: | SELECT code FROM staff AS empl
WHERE type IN (
SELECT type FROM services AS srvc
WHERE srvc.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "services",
"outer_alias": "empl",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_01399 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.