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 |
|---|---|---|---|---|---|---|
v1 | Schema:
customers (alias: cust)(status, code, value, id)
categories(amount, type, status, id)
Task: Select salary from customers where code exists in categories for the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_09400 | train | T1 |
v3 | Schema:
schedules (alias: schd)(name, level, value, id)
customers(status, amount, name, value)
Task: Find code from schedules where amount exceeds the average amount from customers for the same code.
SQL: | SELECT code FROM schedules AS schd
WHERE amount > (
SELECT SUM(amount) FROM customers AS cust
WHERE cust.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_09401 | train | T2 |
v2 | Schema:
budgets (alias: budg)(name, date, id, code)
employees(amount, name, salary, status)
Task: Retrieve name from budgets that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT name FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "employees",
"outer_alias": "budg",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_09402 | train | T2 |
v1 | Schema:
accounts (alias: acct)(status, type, code, value)
regions(date, id, code, value)
Task: Find value from accounts where id appears in regions entries with matching level.
SQL: | SELECT value FROM accounts AS acct
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_09403 | train | T1 |
v2 | Schema:
customers (alias: cust)(level, status, amount, code)
invoices(salary, name, status, amount)
Task: Retrieve value from customers that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_09404 | train | T1 |
v3 | Schema:
accounts (alias: acct)(salary, code, level, id)
sales(date, status, amount, type)
Task: Retrieve amount from accounts with amount above the AVG(amount) of sales rows sharing the same status.
SQL: | SELECT amount FROM accounts AS acct
WHERE amount > (
SELECT AVG(amount) FROM sales AS sale
WHERE sale.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_09405 | train | T1 |
v3 | Schema:
accounts (alias: acct)(level, amount, id, code)
categories(date, name, level, code)
Task: Retrieve amount from accounts with amount above the MIN(value) of categories rows sharing the same status.
SQL: | SELECT amount FROM accounts AS acct
WHERE amount > (
SELECT MIN(value) FROM categories AS catg
WHERE catg.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_09406 | train | T1 |
v2 | Schema:
customers (alias: cust)(type, amount, id, status)
schedules(type, status, date, salary)
Task: Find name from customers where a matching record exists in schedules with the same status.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_09407 | train | T1 |
v3 | Schema:
departments (alias: dept)(id, amount, code, type)
requests(code, name, value, level)
Task: Retrieve amount from departments with value above the SUM(amount) of requests rows sharing the same type.
SQL: | SELECT amount FROM departments AS dept
WHERE value > (
SELECT SUM(amount) FROM requests AS ordr
WHERE ordr.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_09408 | train | T1 |
v3 | Schema:
items (alias: lne)(name, type, id, date)
employees(name, value, salary, code)
Task: Retrieve id from items with value above the SUM(value) of employees rows sharing the same status.
SQL: | SELECT id FROM items AS lne
WHERE value > (
SELECT SUM(value) FROM employees AS emp
WHERE emp.status = lne.status
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_09409 | train | T2 |
v3 | Schema:
managers (alias: mgr)(id, name, code, status)
budgets(date, level, value, name)
Task: Retrieve name from managers with value above the MAX(amount) of budgets rows sharing the same level.
SQL: | SELECT name FROM managers AS mgr
WHERE value > (
SELECT MAX(amount) FROM budgets AS budg
WHERE budg.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "budgets",
"outer_alias": "mgr",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_09410 | train | T1 |
v2 | Schema:
invoices (alias: inv)(type, status, date, salary)
managers(value, name, date, salary)
Task: Find value from invoices where a matching record exists in managers with the same level.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_09411 | train | T1 |
v3 | Schema:
budgets (alias: budg)(amount, type, value, status)
managers(name, id, code, date)
Task: Retrieve code from budgets with salary above the AVG(value) of managers rows sharing the same type.
SQL: | SELECT code FROM budgets AS budg
WHERE salary > (
SELECT AVG(value) FROM managers AS mgr
WHERE mgr.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "managers",
"outer_alias": "budg",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_09412 | train | T2 |
v1 | Schema:
budgets (alias: budg)(amount, salary, type, status)
requests(status, salary, name, date)
Task: Retrieve code from budgets whose code is found in requests rows where status matches the outer record.
SQL: | SELECT code FROM budgets AS budg
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "requests",
"outer_alias": "budg",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_09413 | train | T2 |
v2 | Schema:
customers (alias: cust)(status, level, id, code)
products(type, salary, id, status)
Task: Retrieve value from customers that have at least one corresponding entry in products sharing the same type.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_09414 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(type, salary, date, code)
staff(level, amount, salary, value)
Task: Retrieve id from warehouses with value above the MAX(value) of staff rows sharing the same code.
SQL: | SELECT id FROM warehouses AS whs
WHERE value > (
SELECT MAX(value) FROM staff AS empl
WHERE empl.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "staff",
"outer_alias": "whs",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_09415 | train | T2 |
v3 | Schema:
shipments (alias: shp)(salary, date, id, amount)
regions(code, status, type, id)
Task: Retrieve value from shipments with salary above the MIN(amount) of regions rows sharing the same code.
SQL: | SELECT value FROM shipments AS shp
WHERE salary > (
SELECT MIN(amount) FROM regions AS rgn
WHERE rgn.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_09416 | train | T2 |
v1 | Schema:
invoices (alias: inv)(id, date, salary, status)
staff(id, amount, date, value)
Task: Select value from invoices where status exists in staff for the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_09417 | train | T1 |
v3 | Schema:
customers (alias: cust)(date, value, status, name)
requests(status, salary, level, code)
Task: Find code from customers where value exceeds the average salary from requests for the same status.
SQL: | SELECT code FROM customers AS cust
WHERE value > (
SELECT MAX(salary) FROM requests AS ordr
WHERE ordr.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_09418 | train | T1 |
v1 | Schema:
categories (alias: catg)(id, amount, value, level)
warehouses(name, salary, id, type)
Task: Find amount from categories where id appears in warehouses entries with matching status.
SQL: | SELECT amount FROM categories AS catg
WHERE id IN (
SELECT id FROM warehouses AS whs
WHERE whs.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "warehouses",
"outer_alias": "catg",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_09419 | train | T2 |
v1 | Schema:
regions (alias: rgn)(amount, salary, id, type)
items(salary, amount, status, date)
Task: Find name from regions where status appears in items entries with matching code.
SQL: | SELECT name FROM regions AS rgn
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_09420 | train | T2 |
v3 | Schema:
employees (alias: emp)(name, value, id, amount)
customers(value, code, salary, type)
Task: Find code from employees where amount exceeds the average value from customers for the same id.
SQL: | SELECT code FROM employees AS emp
WHERE amount > (
SELECT MAX(value) FROM customers AS cust
WHERE cust.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_09421 | train | T1 |
v3 | Schema:
transactions (alias: txn)(date, level, id, code)
staff(value, status, code, salary)
Task: Retrieve code from transactions with salary above the MIN(value) of staff rows sharing the same type.
SQL: | SELECT code FROM transactions AS txn
WHERE salary > (
SELECT MIN(value) FROM staff AS empl
WHERE empl.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_09422 | train | T1 |
v3 | Schema:
invoices (alias: inv)(date, code, type, value)
items(salary, status, amount, id)
Task: Find amount from invoices where value exceeds the average amount from items for the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE value > (
SELECT AVG(amount) FROM items AS lne
WHERE lne.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_09423 | train | T1 |
v2 | Schema:
products (alias: prod)(amount, name, date, level)
services(name, id, level, type)
Task: Retrieve salary from products that have at least one corresponding entry in services sharing the same id.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.id = prod.id
); | {
"outer_table": "products",
"inner_table": "services",
"outer_alias": "prod",
"inner_alias": "srvc",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_09424 | train | T1 |
v2 | Schema:
customers (alias: cust)(level, id, code, value)
schedules(date, name, amount, id)
Task: Find name from customers where a matching record exists in schedules with the same code.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_09425 | train | T1 |
v2 | Schema:
employees (alias: emp)(type, code, salary, amount)
schedules(status, date, name, salary)
Task: Find code from employees where a matching record exists in schedules with the same type.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_09426 | train | T1 |
v2 | Schema:
services (alias: srvc)(level, status, id, name)
employees(date, value, salary, code)
Task: Find code from services where a matching record exists in employees with the same code.
SQL: | SELECT code FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "employees",
"outer_alias": "srvc",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_09427 | train | T2 |
v3 | Schema:
employees (alias: emp)(status, id, type, code)
regions(value, type, date, salary)
Task: Retrieve code from employees with amount above the COUNT(value) of regions rows sharing the same code.
SQL: | SELECT code FROM employees AS emp
WHERE amount > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_09428 | train | T1 |
v1 | Schema:
managers (alias: mgr)(salary, amount, id, code)
budgets(amount, level, type, date)
Task: Select salary from managers where code exists in budgets for the same id.
SQL: | SELECT salary FROM managers AS mgr
WHERE code IN (
SELECT code FROM budgets AS budg
WHERE budg.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "budgets",
"outer_alias": "mgr",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_09429 | train | T1 |
v1 | Schema:
products (alias: prod)(date, type, status, id)
departments(status, salary, name, value)
Task: Retrieve id from products whose status is found in departments rows where type matches the outer record.
SQL: | SELECT id FROM products AS prod
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.type = prod.type
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_09430 | train | T1 |
v2 | Schema:
departments (alias: dept)(id, type, code, salary)
services(status, value, name, amount)
Task: Find id from departments where a matching record exists in services with the same type.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "services",
"outer_alias": "dept",
"inner_alias": "srvc",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_09431 | train | T1 |
v1 | Schema:
orders (alias: ord)(level, salary, amount, value)
categories(type, value, date, amount)
Task: Retrieve code from orders whose code is found in categories rows where id matches the outer record.
SQL: | SELECT code FROM orders AS ord
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_09432 | train | T1 |
v2 | Schema:
sales (alias: sale)(date, name, value, level)
staff(status, amount, level, id)
Task: Find code from sales where a matching record exists in staff with the same level.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_09433 | train | T1 |
v2 | Schema:
regions (alias: rgn)(salary, name, status, code)
shipments(code, level, date, id)
Task: Retrieve salary from regions that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_09434 | train | T2 |
v3 | Schema:
customers (alias: cust)(salary, amount, code, id)
sales(level, status, name, id)
Task: Find id from customers where amount exceeds the average salary from sales for the same status.
SQL: | SELECT id FROM customers AS cust
WHERE amount > (
SELECT SUM(salary) FROM sales AS sale
WHERE sale.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_09435 | train | T1 |
v1 | Schema:
customers (alias: cust)(date, level, status, code)
transactions(id, date, name, amount)
Task: Select id from customers where id exists in transactions for the same id.
SQL: | SELECT id FROM customers AS cust
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_09436 | train | T1 |
v2 | Schema:
shipments (alias: shp)(value, type, level, status)
invoices(date, level, code, name)
Task: Find amount from shipments where a matching record exists in invoices with the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_09437 | train | T2 |
v2 | Schema:
staff (alias: empl)(date, status, amount, value)
budgets(code, amount, value, status)
Task: Find id from staff where a matching record exists in budgets with the same id.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "budgets",
"outer_alias": "empl",
"inner_alias": "budg",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_09438 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(type, salary, id, level)
items(date, id, name, level)
Task: Find id from warehouses where a matching record exists in items with the same level.
SQL: | SELECT id FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "items",
"outer_alias": "whs",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_09439 | train | T2 |
v3 | Schema:
budgets (alias: budg)(salary, value, date, id)
orders(status, code, type, salary)
Task: Retrieve name from budgets with amount above the MIN(value) of orders rows sharing the same code.
SQL: | SELECT name FROM budgets AS budg
WHERE amount > (
SELECT MIN(value) FROM orders AS ord
WHERE ord.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "orders",
"outer_alias": "budg",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_09440 | train | T2 |
v2 | Schema:
regions (alias: rgn)(name, value, status, amount)
categories(value, date, salary, level)
Task: Retrieve amount from regions that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_09441 | train | T2 |
v3 | Schema:
requests (alias: ordr)(level, amount, value, type)
employees(status, date, amount, level)
Task: Retrieve salary from requests with salary above the MAX(amount) of employees rows sharing the same level.
SQL: | SELECT salary FROM requests AS ordr
WHERE salary > (
SELECT MAX(amount) FROM employees AS emp
WHERE emp.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_09442 | train | T2 |
v2 | Schema:
employees (alias: emp)(value, code, amount, level)
services(type, value, amount, date)
Task: Retrieve code from employees that have at least one corresponding entry in services sharing the same id.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "services",
"outer_alias": "emp",
"inner_alias": "srvc",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_09443 | train | T1 |
v1 | Schema:
employees (alias: emp)(id, amount, name, code)
customers(status, name, amount, id)
Task: Retrieve salary from employees whose type is found in customers rows where type matches the outer record.
SQL: | SELECT salary FROM employees AS emp
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_09444 | train | T1 |
v1 | Schema:
customers (alias: cust)(level, value, type, date)
items(salary, value, type, name)
Task: Select id from customers where code exists in items for the same status.
SQL: | SELECT id FROM customers AS cust
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_09445 | train | T1 |
v2 | Schema:
managers (alias: mgr)(value, level, amount, id)
requests(date, value, status, type)
Task: Retrieve code from managers that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_09446 | train | T1 |
v2 | Schema:
staff (alias: empl)(name, level, id, code)
customers(code, level, amount, id)
Task: Retrieve id from staff that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_09447 | train | T2 |
v3 | Schema:
shipments (alias: shp)(amount, value, code, name)
departments(type, amount, code, date)
Task: Find code from shipments where amount exceeds the average salary from departments for the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE amount > (
SELECT MAX(salary) FROM departments AS dept
WHERE dept.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_09448 | train | T2 |
v3 | Schema:
staff (alias: empl)(date, type, value, salary)
accounts(name, date, status, salary)
Task: Find value from staff where amount exceeds the average salary from accounts for the same code.
SQL: | SELECT value FROM staff AS empl
WHERE amount > (
SELECT MIN(salary) FROM accounts AS acct
WHERE acct.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_09449 | train | T2 |
v3 | Schema:
orders (alias: ord)(code, salary, value, type)
services(date, id, level, name)
Task: Retrieve name from orders with amount above the MAX(salary) of services rows sharing the same status.
SQL: | SELECT name FROM orders AS ord
WHERE amount > (
SELECT MAX(salary) FROM services AS srvc
WHERE srvc.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "services",
"outer_alias": "ord",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_09450 | train | T1 |
v1 | Schema:
managers (alias: mgr)(level, salary, date, code)
regions(status, name, value, type)
Task: Find amount from managers where code appears in regions entries with matching status.
SQL: | SELECT amount FROM managers AS mgr
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_09451 | train | T1 |
v2 | Schema:
sales (alias: sale)(type, date, value, status)
departments(code, amount, type, date)
Task: Retrieve salary from sales that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_09452 | train | T1 |
v2 | Schema:
managers (alias: mgr)(id, status, type, amount)
staff(date, code, id, value)
Task: Retrieve code from managers that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_09453 | train | T1 |
v2 | Schema:
services (alias: srvc)(type, status, date, salary)
regions(level, status, date, amount)
Task: Retrieve name from services that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT name FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "regions",
"outer_alias": "srvc",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_09454 | train | T2 |
v1 | Schema:
transactions (alias: txn)(date, level, value, type)
items(name, status, salary, amount)
Task: Find id from transactions where code appears in items entries with matching type.
SQL: | SELECT id FROM transactions AS txn
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_09455 | train | T1 |
v1 | Schema:
shipments (alias: shp)(value, level, date, amount)
departments(value, code, salary, name)
Task: Find amount from shipments where level appears in departments entries with matching type.
SQL: | SELECT amount FROM shipments AS shp
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_09456 | train | T2 |
v1 | Schema:
shipments (alias: shp)(status, value, date, name)
sales(amount, date, name, code)
Task: Find code from shipments where id appears in sales entries with matching code.
SQL: | SELECT code FROM shipments AS shp
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_09457 | train | T2 |
v1 | Schema:
regions (alias: rgn)(date, value, id, code)
employees(salary, name, level, amount)
Task: Select name from regions where level exists in employees for the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_09458 | train | T2 |
v2 | Schema:
shipments (alias: shp)(status, name, level, salary)
employees(name, value, amount, code)
Task: Find code from shipments where a matching record exists in employees with the same code.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_09459 | train | T2 |
v1 | Schema:
shipments (alias: shp)(code, value, name, type)
schedules(level, salary, type, value)
Task: Retrieve id from shipments whose level is found in schedules rows where type matches the outer record.
SQL: | SELECT id FROM shipments AS shp
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_09460 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(type, salary, name, code)
shipments(code, status, salary, name)
Task: Retrieve code from warehouses that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT code FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "shipments",
"outer_alias": "whs",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_09461 | train | T2 |
v3 | Schema:
managers (alias: mgr)(type, level, salary, id)
employees(name, value, type, code)
Task: Retrieve id from managers with salary above the COUNT(salary) of employees rows sharing the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE salary > (
SELECT COUNT(salary) FROM employees AS emp
WHERE emp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_09462 | train | T1 |
v3 | Schema:
orders (alias: ord)(amount, status, salary, name)
employees(date, status, level, name)
Task: Retrieve id from orders with amount above the SUM(salary) of employees rows sharing the same type.
SQL: | SELECT id FROM orders AS ord
WHERE amount > (
SELECT SUM(salary) FROM employees AS emp
WHERE emp.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_09463 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(id, salary, level, amount)
employees(type, id, date, level)
Task: Find name from warehouses where type appears in employees entries with matching code.
SQL: | SELECT name FROM warehouses AS whs
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "employees",
"outer_alias": "whs",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_09464 | train | T2 |
v1 | Schema:
budgets (alias: budg)(type, code, value, date)
invoices(amount, type, status, id)
Task: Retrieve name from budgets whose status is found in invoices rows where level matches the outer record.
SQL: | SELECT name FROM budgets AS budg
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "invoices",
"outer_alias": "budg",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_09465 | train | T2 |
v3 | Schema:
employees (alias: emp)(amount, id, date, level)
budgets(name, level, type, value)
Task: Retrieve code from employees with value above the MAX(value) of budgets rows sharing the same status.
SQL: | SELECT code FROM employees AS emp
WHERE value > (
SELECT MAX(value) FROM budgets AS budg
WHERE budg.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "budgets",
"outer_alias": "emp",
"inner_alias": "budg",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_09466 | train | T1 |
v3 | Schema:
regions (alias: rgn)(code, amount, salary, level)
staff(level, value, type, code)
Task: Find code from regions where salary exceeds the average amount from staff for the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE salary > (
SELECT AVG(amount) FROM staff AS empl
WHERE empl.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_09467 | train | T2 |
v3 | Schema:
invoices (alias: inv)(date, name, salary, type)
items(value, amount, date, code)
Task: Retrieve salary from invoices with value above the SUM(salary) of items rows sharing the same id.
SQL: | SELECT salary FROM invoices AS inv
WHERE value > (
SELECT SUM(salary) FROM items AS lne
WHERE lne.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_09468 | train | T1 |
v2 | Schema:
invoices (alias: inv)(id, code, name, amount)
transactions(amount, date, value, salary)
Task: Retrieve id from invoices that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_09469 | train | T1 |
v3 | Schema:
staff (alias: empl)(type, amount, code, name)
requests(status, name, code, date)
Task: Find code from staff where salary exceeds the average salary from requests for the same code.
SQL: | SELECT code FROM staff AS empl
WHERE salary > (
SELECT MAX(salary) FROM requests AS ordr
WHERE ordr.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_09470 | train | T2 |
v3 | Schema:
invoices (alias: inv)(code, status, name, type)
shipments(name, status, code, level)
Task: Find id from invoices where amount exceeds the average salary from shipments for the same code.
SQL: | SELECT id FROM invoices AS inv
WHERE amount > (
SELECT MAX(salary) FROM shipments AS shp
WHERE shp.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_09471 | train | T1 |
v2 | Schema:
categories (alias: catg)(salary, date, level, value)
services(level, date, value, type)
Task: Retrieve amount from categories that have at least one corresponding entry in services sharing the same status.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "services",
"outer_alias": "catg",
"inner_alias": "srvc",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_09472 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(status, id, value, amount)
accounts(name, status, salary, value)
Task: Find value from warehouses where a matching record exists in accounts with the same level.
SQL: | SELECT value FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "accounts",
"outer_alias": "whs",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_09473 | train | T2 |
v3 | Schema:
services (alias: srvc)(name, salary, amount, date)
categories(code, level, name, salary)
Task: Find code from services where amount exceeds the average amount from categories for the same type.
SQL: | SELECT code FROM services AS srvc
WHERE amount > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "categories",
"outer_alias": "srvc",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_09474 | train | T2 |
v3 | Schema:
invoices (alias: inv)(code, level, date, salary)
sales(code, date, salary, id)
Task: Retrieve amount from invoices with salary above the SUM(value) of sales rows sharing the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE salary > (
SELECT SUM(value) FROM sales AS sale
WHERE sale.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_09475 | train | T1 |
v3 | Schema:
requests (alias: ordr)(type, date, salary, amount)
regions(code, amount, date, salary)
Task: Retrieve amount from requests with amount above the AVG(salary) of regions rows sharing the same level.
SQL: | SELECT amount FROM requests AS ordr
WHERE amount > (
SELECT AVG(salary) FROM regions AS rgn
WHERE rgn.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_09476 | train | T2 |
v3 | Schema:
products (alias: prod)(date, status, type, name)
staff(code, value, name, type)
Task: Retrieve code from products with value above the COUNT(amount) of staff rows sharing the same status.
SQL: | SELECT code FROM products AS prod
WHERE value > (
SELECT COUNT(amount) FROM staff AS empl
WHERE empl.status = prod.status
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_09477 | train | T1 |
v1 | Schema:
employees (alias: emp)(status, salary, value, type)
departments(id, type, value, code)
Task: Select id from employees where status exists in departments for the same code.
SQL: | SELECT id FROM employees AS emp
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_09478 | train | T1 |
v3 | Schema:
customers (alias: cust)(amount, id, value, level)
transactions(code, type, name, status)
Task: Find amount from customers where salary exceeds the average value from transactions for the same type.
SQL: | SELECT amount FROM customers AS cust
WHERE salary > (
SELECT MIN(value) FROM transactions AS txn
WHERE txn.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_09479 | train | T1 |
v3 | Schema:
shipments (alias: shp)(date, id, type, salary)
invoices(amount, status, name, type)
Task: Retrieve value from shipments with amount above the COUNT(value) of invoices rows sharing the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE amount > (
SELECT COUNT(value) FROM invoices AS inv
WHERE inv.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_09480 | train | T2 |
v2 | Schema:
employees (alias: emp)(level, code, name, salary)
orders(value, amount, type, code)
Task: Retrieve value from employees that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_09481 | train | T1 |
v2 | Schema:
accounts (alias: acct)(code, id, level, amount)
items(amount, type, name, status)
Task: Find name from accounts where a matching record exists in items with the same code.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_09482 | train | T1 |
v2 | Schema:
regions (alias: rgn)(code, type, value, status)
services(status, name, type, date)
Task: Retrieve value from regions that have at least one corresponding entry in services sharing the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "services",
"outer_alias": "rgn",
"inner_alias": "srvc",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_09483 | train | T2 |
v1 | Schema:
requests (alias: ordr)(name, id, level, date)
invoices(code, id, level, value)
Task: Retrieve name from requests whose code is found in invoices rows where code matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_09484 | train | T2 |
v2 | Schema:
invoices (alias: inv)(code, name, status, amount)
departments(name, status, amount, level)
Task: Find amount from invoices where a matching record exists in departments with the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_09485 | train | T1 |
v2 | Schema:
requests (alias: ordr)(date, amount, value, id)
items(date, value, salary, level)
Task: Find value from requests where a matching record exists in items with the same status.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_09486 | train | T2 |
v3 | Schema:
budgets (alias: budg)(value, status, date, amount)
accounts(code, level, value, amount)
Task: Retrieve name from budgets with value above the MIN(amount) of accounts rows sharing the same code.
SQL: | SELECT name FROM budgets AS budg
WHERE value > (
SELECT MIN(amount) FROM accounts AS acct
WHERE acct.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "accounts",
"outer_alias": "budg",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_09487 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(amount, id, code, type)
regions(name, code, status, level)
Task: Find code from warehouses where a matching record exists in regions with the same code.
SQL: | SELECT code FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "regions",
"outer_alias": "whs",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_09488 | train | T2 |
v1 | Schema:
staff (alias: empl)(value, type, name, amount)
invoices(code, status, name, amount)
Task: Retrieve code from staff whose status is found in invoices rows where type matches the outer record.
SQL: | SELECT code FROM staff AS empl
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_09489 | train | T2 |
v2 | Schema:
managers (alias: mgr)(salary, type, level, value)
orders(code, salary, amount, date)
Task: Find id from managers where a matching record exists in orders with the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_09490 | train | T1 |
v2 | Schema:
regions (alias: rgn)(salary, name, amount, status)
items(value, name, date, status)
Task: Retrieve salary from regions that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_09491 | train | T2 |
v2 | Schema:
invoices (alias: inv)(id, type, name, amount)
accounts(id, level, value, code)
Task: Retrieve id from invoices that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_09492 | train | T1 |
v1 | Schema:
regions (alias: rgn)(status, salary, name, type)
customers(id, date, salary, level)
Task: Retrieve id from regions whose code is found in customers rows where level matches the outer record.
SQL: | SELECT id FROM regions AS rgn
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_09493 | train | T2 |
v3 | Schema:
items (alias: lne)(date, status, name, code)
managers(status, level, salary, name)
Task: Find value from items where value exceeds the average value from managers for the same code.
SQL: | SELECT value FROM items AS lne
WHERE value > (
SELECT COUNT(value) FROM managers AS mgr
WHERE mgr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_09494 | train | T2 |
v3 | Schema:
services (alias: srvc)(level, id, type, date)
requests(name, code, date, amount)
Task: Find name from services where amount exceeds the average value from requests for the same status.
SQL: | SELECT name FROM services AS srvc
WHERE amount > (
SELECT MIN(value) FROM requests AS ordr
WHERE ordr.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "requests",
"outer_alias": "srvc",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_09495 | train | T2 |
v2 | Schema:
items (alias: lne)(amount, salary, name, value)
employees(level, date, type, status)
Task: Retrieve amount from items that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = lne.level
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_09496 | train | T2 |
v2 | Schema:
products (alias: prod)(id, value, level, type)
managers(name, date, status, amount)
Task: Retrieve name from products that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = prod.type
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_09497 | train | T1 |
v1 | Schema:
managers (alias: mgr)(salary, level, value, code)
services(level, code, name, type)
Task: Find code from managers where code appears in services entries with matching id.
SQL: | SELECT code FROM managers AS mgr
WHERE code IN (
SELECT code FROM services AS srvc
WHERE srvc.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "services",
"outer_alias": "mgr",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_09498 | train | T1 |
v1 | Schema:
services (alias: srvc)(code, id, name, date)
managers(code, name, salary, value)
Task: Find salary from services where code appears in managers entries with matching level.
SQL: | SELECT salary FROM services AS srvc
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "managers",
"outer_alias": "srvc",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_09499 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.