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:
transactions (alias: txn)(level, value, date, name)
customers(level, date, name, id)
Task: Retrieve amount from transactions whose id is found in customers rows where code matches the outer record.
SQL: | SELECT amount FROM transactions AS txn
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_10700 | train | T1 |
v3 | Schema:
regions (alias: rgn)(value, amount, status, name)
budgets(name, date, code, salary)
Task: Find id from regions where amount exceeds the average salary from budgets for the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE amount > (
SELECT COUNT(salary) FROM budgets AS budg
WHERE budg.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "budgets",
"outer_alias": "rgn",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_10701 | train | T2 |
v1 | Schema:
managers (alias: mgr)(id, code, type, value)
employees(value, date, type, id)
Task: Retrieve code from managers whose code is found in employees rows where type matches the outer record.
SQL: | SELECT code FROM managers AS mgr
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_10702 | train | T1 |
v1 | Schema:
sales (alias: sale)(status, code, name, value)
services(level, status, amount, type)
Task: Find name from sales where id appears in services entries with matching type.
SQL: | SELECT name FROM sales AS sale
WHERE id IN (
SELECT id FROM services AS srvc
WHERE srvc.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "services",
"outer_alias": "sale",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_10703 | train | T1 |
v3 | Schema:
budgets (alias: budg)(id, status, name, amount)
accounts(date, salary, value, id)
Task: Retrieve amount from budgets with salary above the AVG(value) of accounts rows sharing the same id.
SQL: | SELECT amount FROM budgets AS budg
WHERE salary > (
SELECT AVG(value) FROM accounts AS acct
WHERE acct.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "accounts",
"outer_alias": "budg",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_10704 | train | T2 |
v1 | Schema:
items (alias: lne)(status, date, code, type)
customers(code, amount, value, type)
Task: Retrieve salary from items whose level is found in customers rows where level matches the outer record.
SQL: | SELECT salary FROM items AS lne
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.level = lne.level
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_10705 | train | T2 |
v1 | Schema:
departments (alias: dept)(salary, status, code, level)
requests(date, amount, id, name)
Task: Retrieve salary from departments whose code is found in requests rows where code matches the outer record.
SQL: | SELECT salary FROM departments AS dept
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_10706 | train | T1 |
v2 | Schema:
orders (alias: ord)(date, status, name, level)
customers(code, name, level, amount)
Task: Find name from orders where a matching record exists in customers with the same level.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_10707 | train | T1 |
v2 | Schema:
departments (alias: dept)(type, id, code, salary)
employees(salary, code, amount, level)
Task: Retrieve name from departments that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_10708 | train | T1 |
v3 | Schema:
items (alias: lne)(level, code, id, date)
categories(amount, status, salary, type)
Task: Retrieve amount from items with value above the MIN(amount) of categories rows sharing the same status.
SQL: | SELECT amount FROM items AS lne
WHERE value > (
SELECT MIN(amount) FROM categories AS catg
WHERE catg.status = lne.status
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_10709 | train | T2 |
v2 | Schema:
staff (alias: empl)(amount, name, id, salary)
products(id, value, type, salary)
Task: Find name from staff where a matching record exists in products with the same code.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_10710 | train | T2 |
v3 | Schema:
sales (alias: sale)(status, amount, name, date)
warehouses(name, value, date, code)
Task: Retrieve salary from sales with salary above the MIN(amount) of warehouses rows sharing the same id.
SQL: | SELECT salary FROM sales AS sale
WHERE salary > (
SELECT MIN(amount) FROM warehouses AS whs
WHERE whs.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "warehouses",
"outer_alias": "sale",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_10711 | train | T1 |
v3 | Schema:
schedules (alias: schd)(value, id, level, type)
warehouses(type, date, code, salary)
Task: Find code from schedules where amount exceeds the average salary from warehouses for the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE amount > (
SELECT COUNT(salary) FROM warehouses AS whs
WHERE whs.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "warehouses",
"outer_alias": "schd",
"inner_alias": "whs",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_10712 | train | T2 |
v2 | Schema:
managers (alias: mgr)(id, type, status, value)
departments(date, name, amount, value)
Task: Find name from managers where a matching record exists in departments with the same type.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_10713 | train | T1 |
v2 | Schema:
products (alias: prod)(amount, code, status, value)
requests(date, amount, name, status)
Task: Retrieve code from products that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = prod.code
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_10714 | train | T1 |
v3 | Schema:
orders (alias: ord)(id, salary, code, value)
staff(level, status, id, name)
Task: Retrieve amount from orders with value above the MAX(amount) of staff rows sharing the same code.
SQL: | SELECT amount FROM orders AS ord
WHERE value > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_10715 | train | T1 |
v1 | Schema:
schedules (alias: schd)(id, amount, code, value)
products(name, type, level, date)
Task: Find value from schedules where code appears in products entries with matching type.
SQL: | SELECT value FROM schedules AS schd
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_10716 | train | T2 |
v3 | Schema:
accounts (alias: acct)(salary, code, amount, type)
categories(amount, status, name, type)
Task: Retrieve value from accounts with amount above the MAX(value) of categories rows sharing the same code.
SQL: | SELECT value FROM accounts AS acct
WHERE amount > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_10717 | train | T1 |
v1 | Schema:
accounts (alias: acct)(id, name, status, level)
customers(date, name, code, id)
Task: Retrieve amount from accounts whose status is found in customers rows where status matches the outer record.
SQL: | SELECT amount FROM accounts AS acct
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_10718 | train | T1 |
v2 | Schema:
transactions (alias: txn)(value, date, status, name)
budgets(status, date, code, name)
Task: Retrieve name from transactions that have at least one corresponding entry in budgets sharing the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "budgets",
"outer_alias": "txn",
"inner_alias": "budg",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_10719 | train | T1 |
v2 | Schema:
managers (alias: mgr)(code, status, id, salary)
shipments(name, status, value, amount)
Task: Retrieve id from managers that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_10720 | train | T1 |
v3 | Schema:
services (alias: srvc)(name, code, amount, value)
schedules(level, salary, amount, name)
Task: Find id from services where salary exceeds the average salary from schedules for the same type.
SQL: | SELECT id FROM services AS srvc
WHERE salary > (
SELECT AVG(salary) FROM schedules AS schd
WHERE schd.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "schedules",
"outer_alias": "srvc",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_10721 | train | T2 |
v3 | Schema:
requests (alias: ordr)(code, id, name, level)
staff(code, amount, salary, date)
Task: Retrieve code from requests with amount above the AVG(value) of staff rows sharing the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE amount > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_10722 | train | T2 |
v3 | Schema:
employees (alias: emp)(date, code, amount, type)
customers(date, id, salary, level)
Task: Find name from employees where value exceeds the average salary from customers for the same code.
SQL: | SELECT name FROM employees AS emp
WHERE value > (
SELECT MAX(salary) FROM customers AS cust
WHERE cust.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_10723 | train | T1 |
v1 | Schema:
regions (alias: rgn)(id, code, value, amount)
departments(amount, id, type, status)
Task: Select value from regions where type exists in departments for the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_10724 | train | T2 |
v2 | Schema:
accounts (alias: acct)(id, name, type, amount)
managers(name, id, amount, code)
Task: Find amount from accounts where a matching record exists in managers with the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_10725 | train | T1 |
v1 | Schema:
invoices (alias: inv)(value, status, salary, type)
warehouses(status, level, date, name)
Task: Select amount from invoices where code exists in warehouses for the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE code IN (
SELECT code FROM warehouses AS whs
WHERE whs.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "warehouses",
"outer_alias": "inv",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_10726 | train | T1 |
v2 | Schema:
budgets (alias: budg)(code, id, type, level)
managers(date, amount, value, name)
Task: Find salary from budgets where a matching record exists in managers with the same level.
SQL: | SELECT salary FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "managers",
"outer_alias": "budg",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_10727 | train | T2 |
v3 | Schema:
services (alias: srvc)(amount, code, status, type)
categories(code, level, name, id)
Task: Find name from services where salary exceeds the average salary from categories for the same id.
SQL: | SELECT name FROM services AS srvc
WHERE salary > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "categories",
"outer_alias": "srvc",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_10728 | train | T2 |
v2 | Schema:
transactions (alias: txn)(value, name, code, date)
customers(code, value, date, status)
Task: Find name from transactions where a matching record exists in customers with the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_10729 | train | T1 |
v1 | Schema:
budgets (alias: budg)(name, id, code, type)
departments(type, value, name, level)
Task: Select salary from budgets where code exists in departments for the same id.
SQL: | SELECT salary FROM budgets AS budg
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "departments",
"outer_alias": "budg",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_10730 | train | T2 |
v3 | Schema:
managers (alias: mgr)(value, level, name, amount)
schedules(type, id, value, amount)
Task: Retrieve value from managers with value above the SUM(amount) of schedules rows sharing the same code.
SQL: | SELECT value FROM managers AS mgr
WHERE value > (
SELECT SUM(amount) FROM schedules AS schd
WHERE schd.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_10731 | train | T1 |
v3 | Schema:
customers (alias: cust)(name, type, salary, date)
products(salary, level, code, status)
Task: Find name from customers where value exceeds the average amount from products for the same status.
SQL: | SELECT name FROM customers AS cust
WHERE value > (
SELECT MIN(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": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_10732 | train | T1 |
v3 | Schema:
categories (alias: catg)(date, id, value, status)
managers(value, code, level, type)
Task: Retrieve value from categories with value above the SUM(value) of managers rows sharing the same id.
SQL: | SELECT value FROM categories AS catg
WHERE value > (
SELECT SUM(value) FROM managers AS mgr
WHERE mgr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_10733 | train | T2 |
v1 | Schema:
products (alias: prod)(level, type, date, id)
staff(type, id, amount, value)
Task: Find value from products where level appears in staff entries with matching type.
SQL: | SELECT value FROM products AS prod
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.type = prod.type
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_10734 | train | T1 |
v2 | Schema:
budgets (alias: budg)(value, date, amount, id)
regions(name, level, id, status)
Task: Retrieve code from budgets that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT code FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "regions",
"outer_alias": "budg",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_10735 | train | T2 |
v3 | Schema:
products (alias: prod)(value, amount, code, level)
managers(status, id, type, code)
Task: Find salary from products where value exceeds the average amount from managers for the same level.
SQL: | SELECT salary FROM products AS prod
WHERE value > (
SELECT SUM(amount) FROM managers AS mgr
WHERE mgr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_10736 | train | T1 |
v2 | Schema:
sales (alias: sale)(salary, id, date, status)
transactions(id, value, salary, status)
Task: Retrieve code from sales that have at least one corresponding entry in transactions sharing the same type.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_10737 | train | T1 |
v2 | Schema:
categories (alias: catg)(value, salary, id, code)
employees(salary, status, date, id)
Task: Retrieve code from categories that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_10738 | train | T2 |
v2 | Schema:
services (alias: srvc)(type, status, amount, name)
shipments(level, type, salary, id)
Task: Retrieve value from services that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT value FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "shipments",
"outer_alias": "srvc",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_10739 | train | T2 |
v3 | Schema:
departments (alias: dept)(value, name, salary, id)
warehouses(date, status, type, level)
Task: Retrieve salary from departments with salary above the COUNT(amount) of warehouses rows sharing the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE salary > (
SELECT COUNT(amount) FROM warehouses AS whs
WHERE whs.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "warehouses",
"outer_alias": "dept",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_10740 | train | T1 |
v2 | Schema:
items (alias: lne)(code, status, salary, amount)
accounts(code, status, salary, level)
Task: Find value from items where a matching record exists in accounts with the same code.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = lne.code
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_10741 | train | T2 |
v2 | Schema:
categories (alias: catg)(date, id, amount, status)
warehouses(status, type, name, value)
Task: Retrieve name from categories that have at least one corresponding entry in warehouses sharing the same level.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "warehouses",
"outer_alias": "catg",
"inner_alias": "whs",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_10742 | train | T2 |
v2 | Schema:
invoices (alias: inv)(type, status, id, name)
schedules(id, code, level, status)
Task: Retrieve name from invoices that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_10743 | train | T1 |
v3 | Schema:
budgets (alias: budg)(status, name, date, amount)
customers(type, date, amount, id)
Task: Find name from budgets where amount exceeds the average value from customers for the same status.
SQL: | SELECT name FROM budgets AS budg
WHERE amount > (
SELECT MIN(value) FROM customers AS cust
WHERE cust.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "customers",
"outer_alias": "budg",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_10744 | train | T2 |
v1 | Schema:
employees (alias: emp)(amount, date, code, salary)
shipments(amount, value, date, name)
Task: Select id from employees where id exists in shipments for the same id.
SQL: | SELECT id FROM employees AS emp
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_10745 | train | T1 |
v2 | Schema:
departments (alias: dept)(salary, date, id, name)
products(salary, type, level, amount)
Task: Find id from departments where a matching record exists in products with the same type.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_10746 | train | T1 |
v2 | Schema:
services (alias: srvc)(date, value, type, amount)
customers(level, date, salary, amount)
Task: Find salary from services where a matching record exists in customers with the same type.
SQL: | SELECT salary FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "customers",
"outer_alias": "srvc",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_10747 | train | T2 |
v2 | Schema:
employees (alias: emp)(amount, status, value, name)
services(level, type, name, salary)
Task: Find id from employees where a matching record exists in services with the same code.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "services",
"outer_alias": "emp",
"inner_alias": "srvc",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_10748 | train | T1 |
v1 | Schema:
accounts (alias: acct)(status, level, type, code)
products(date, name, status, type)
Task: Retrieve id from accounts whose level is found in products rows where level matches the outer record.
SQL: | SELECT id FROM accounts AS acct
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_10749 | train | T1 |
v1 | Schema:
accounts (alias: acct)(type, level, name, salary)
departments(code, name, level, salary)
Task: Retrieve salary from accounts whose id is found in departments rows where code matches the outer record.
SQL: | SELECT salary FROM accounts AS acct
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_10750 | train | T1 |
v3 | Schema:
requests (alias: ordr)(name, status, salary, value)
sales(amount, id, type, salary)
Task: Find code from requests where amount exceeds the average salary from sales for the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE amount > (
SELECT MAX(salary) FROM sales AS sale
WHERE sale.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_10751 | train | T2 |
v3 | Schema:
services (alias: srvc)(amount, level, name, code)
sales(value, type, status, date)
Task: Retrieve amount from services with amount above the COUNT(amount) of sales rows sharing the same level.
SQL: | SELECT amount FROM services AS srvc
WHERE amount > (
SELECT COUNT(amount) FROM sales AS sale
WHERE sale.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "sales",
"outer_alias": "srvc",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_10752 | train | T2 |
v2 | Schema:
requests (alias: ordr)(code, status, id, date)
accounts(type, date, id, amount)
Task: Find id from requests where a matching record exists in accounts with the same code.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_10753 | train | T2 |
v2 | Schema:
shipments (alias: shp)(name, value, id, type)
accounts(id, name, level, value)
Task: Retrieve value from shipments that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_10754 | train | T2 |
v2 | Schema:
customers (alias: cust)(date, code, level, salary)
regions(name, date, value, amount)
Task: Find name from customers where a matching record exists in regions with the same status.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_10755 | train | T1 |
v3 | Schema:
transactions (alias: txn)(type, level, name, status)
requests(date, status, code, level)
Task: Find id from transactions where salary exceeds the average amount from requests for the same id.
SQL: | SELECT id FROM transactions AS txn
WHERE salary > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_10756 | train | T1 |
v1 | Schema:
items (alias: lne)(name, type, amount, date)
requests(status, value, code, salary)
Task: Find name from items where id appears in requests entries with matching id.
SQL: | SELECT name FROM items AS lne
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.id = lne.id
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_10757 | train | T2 |
v2 | Schema:
shipments (alias: shp)(status, id, salary, value)
staff(status, value, amount, date)
Task: Retrieve value from shipments that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_10758 | train | T2 |
v2 | Schema:
products (alias: prod)(salary, value, type, id)
staff(name, value, level, id)
Task: Retrieve amount from products that have at least one corresponding entry in staff sharing the same type.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = prod.type
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_10759 | train | T1 |
v1 | Schema:
accounts (alias: acct)(date, level, code, type)
transactions(status, code, name, salary)
Task: Select amount from accounts where code exists in transactions for the same level.
SQL: | SELECT amount FROM accounts AS acct
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_10760 | train | T1 |
v2 | Schema:
regions (alias: rgn)(name, type, level, salary)
customers(date, code, salary, level)
Task: Retrieve value from regions that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_10761 | train | T2 |
v3 | Schema:
customers (alias: cust)(status, name, date, id)
departments(name, code, date, status)
Task: Find salary from customers where value exceeds the average salary from departments for the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE value > (
SELECT COUNT(salary) FROM departments AS dept
WHERE dept.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_10762 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(type, amount, status, level)
categories(status, amount, name, level)
Task: Find code from warehouses where a matching record exists in categories with the same type.
SQL: | SELECT code FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "categories",
"outer_alias": "whs",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_10763 | train | T2 |
v3 | Schema:
services (alias: srvc)(type, code, amount, id)
accounts(date, code, name, status)
Task: Find code from services where salary exceeds the average value from accounts for the same level.
SQL: | SELECT code FROM services AS srvc
WHERE salary > (
SELECT MIN(value) FROM accounts AS acct
WHERE acct.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "accounts",
"outer_alias": "srvc",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_10764 | train | T2 |
v1 | Schema:
accounts (alias: acct)(amount, status, date, value)
departments(level, value, salary, amount)
Task: Retrieve salary from accounts whose code is found in departments rows where id matches the outer record.
SQL: | SELECT salary FROM accounts AS acct
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_10765 | train | T1 |
v1 | Schema:
categories (alias: catg)(level, type, status, code)
managers(date, amount, salary, status)
Task: Select id from categories where status exists in managers for the same level.
SQL: | SELECT id FROM categories AS catg
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_10766 | train | T2 |
v2 | Schema:
sales (alias: sale)(name, date, code, salary)
employees(status, date, value, salary)
Task: Retrieve id from sales that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_10767 | train | T1 |
v1 | Schema:
regions (alias: rgn)(type, salary, date, status)
accounts(type, level, salary, amount)
Task: Find salary from regions where status appears in accounts entries with matching code.
SQL: | SELECT salary FROM regions AS rgn
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_10768 | train | T2 |
v1 | Schema:
transactions (alias: txn)(code, type, name, date)
warehouses(value, salary, type, code)
Task: Select amount from transactions where code exists in warehouses for the same type.
SQL: | SELECT amount FROM transactions AS txn
WHERE code IN (
SELECT code FROM warehouses AS whs
WHERE whs.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "warehouses",
"outer_alias": "txn",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_10769 | train | T1 |
v1 | Schema:
orders (alias: ord)(salary, code, amount, status)
requests(salary, status, value, level)
Task: Select value from orders where code exists in requests for the same code.
SQL: | SELECT value FROM orders AS ord
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_10770 | train | T1 |
v3 | Schema:
staff (alias: empl)(salary, id, status, code)
schedules(type, amount, code, level)
Task: Retrieve code from staff with salary above the COUNT(salary) of schedules rows sharing the same type.
SQL: | SELECT code FROM staff AS empl
WHERE salary > (
SELECT COUNT(salary) FROM schedules AS schd
WHERE schd.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_10771 | train | T2 |
v3 | Schema:
departments (alias: dept)(name, date, value, level)
regions(code, salary, name, value)
Task: Find amount from departments where salary exceeds the average value from regions for the same id.
SQL: | SELECT amount FROM departments AS dept
WHERE salary > (
SELECT MIN(value) FROM regions AS rgn
WHERE rgn.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_10772 | train | T1 |
v3 | Schema:
regions (alias: rgn)(code, value, salary, amount)
shipments(date, code, amount, name)
Task: Retrieve amount from regions with salary above the SUM(amount) of shipments rows sharing the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE salary > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_10773 | train | T2 |
v1 | Schema:
employees (alias: emp)(type, status, name, salary)
accounts(name, code, date, salary)
Task: Select salary from employees where id exists in accounts for the same level.
SQL: | SELECT salary FROM employees AS emp
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_10774 | train | T1 |
v3 | Schema:
customers (alias: cust)(value, amount, type, id)
shipments(date, type, level, salary)
Task: Retrieve code from customers with salary above the MIN(value) of shipments rows sharing the same code.
SQL: | SELECT code FROM customers AS cust
WHERE salary > (
SELECT MIN(value) 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": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_10775 | train | T1 |
v2 | Schema:
regions (alias: rgn)(value, type, salary, status)
items(date, name, code, salary)
Task: Find salary from regions where a matching record exists in items with 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_10776 | train | T2 |
v3 | Schema:
customers (alias: cust)(status, date, amount, code)
transactions(status, code, date, amount)
Task: Retrieve amount from customers with salary above the COUNT(value) of transactions rows sharing the same type.
SQL: | SELECT amount FROM customers AS cust
WHERE salary > (
SELECT COUNT(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": "COUNT",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_10777 | train | T1 |
v2 | Schema:
budgets (alias: budg)(name, salary, id, value)
customers(type, amount, status, level)
Task: Find code from budgets where a matching record exists in customers with the same status.
SQL: | SELECT code FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "customers",
"outer_alias": "budg",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_10778 | train | T2 |
v2 | Schema:
regions (alias: rgn)(type, date, name, salary)
categories(level, type, id, amount)
Task: Retrieve salary from regions that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_10779 | train | T2 |
v2 | Schema:
customers (alias: cust)(type, salary, code, level)
warehouses(level, name, date, amount)
Task: Retrieve amount from customers that have at least one corresponding entry in warehouses sharing the same level.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "warehouses",
"outer_alias": "cust",
"inner_alias": "whs",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_10780 | train | T1 |
v3 | Schema:
managers (alias: mgr)(level, name, salary, value)
employees(id, level, type, salary)
Task: Retrieve amount from managers with amount above the MAX(salary) of employees rows sharing the same level.
SQL: | SELECT amount FROM managers AS mgr
WHERE amount > (
SELECT MAX(salary) FROM employees AS emp
WHERE emp.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_10781 | train | T1 |
v3 | Schema:
requests (alias: ordr)(level, code, id, type)
items(status, name, value, date)
Task: Retrieve name from requests with salary above the SUM(salary) of items rows sharing the same code.
SQL: | SELECT name FROM requests AS ordr
WHERE salary > (
SELECT SUM(salary) FROM items AS lne
WHERE lne.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_10782 | train | T2 |
v2 | Schema:
items (alias: lne)(value, level, name, amount)
schedules(amount, level, date, id)
Task: Find salary from items where a matching record exists in schedules with the same id.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = lne.id
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_10783 | train | T2 |
v2 | Schema:
customers (alias: cust)(level, id, name, type)
managers(name, date, id, amount)
Task: Find id from customers where a matching record exists in managers with the same status.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_10784 | train | T1 |
v3 | Schema:
categories (alias: catg)(type, code, date, status)
departments(id, salary, status, date)
Task: Retrieve salary from categories with amount above the COUNT(value) of departments rows sharing the same id.
SQL: | SELECT salary FROM categories AS catg
WHERE amount > (
SELECT COUNT(value) FROM departments AS dept
WHERE dept.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_10785 | train | T2 |
v1 | Schema:
services (alias: srvc)(salary, value, name, amount)
invoices(type, id, value, salary)
Task: Select amount from services where status exists in invoices for the same id.
SQL: | SELECT amount FROM services AS srvc
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "invoices",
"outer_alias": "srvc",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_10786 | train | T2 |
v2 | Schema:
categories (alias: catg)(level, type, value, status)
shipments(id, amount, date, name)
Task: Find code from categories where a matching record exists in shipments with the same status.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_10787 | train | T2 |
v1 | Schema:
transactions (alias: txn)(salary, level, id, value)
schedules(salary, code, name, level)
Task: Retrieve salary from transactions whose code is found in schedules rows where code matches the outer record.
SQL: | SELECT salary FROM transactions AS txn
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_10788 | train | T1 |
v3 | Schema:
orders (alias: ord)(amount, code, type, date)
warehouses(amount, level, name, code)
Task: Retrieve amount from orders with value above the MIN(salary) of warehouses rows sharing the same id.
SQL: | SELECT amount FROM orders AS ord
WHERE value > (
SELECT MIN(salary) FROM warehouses AS whs
WHERE whs.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "warehouses",
"outer_alias": "ord",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_10789 | train | T1 |
v2 | Schema:
orders (alias: ord)(value, level, salary, status)
transactions(value, level, id, amount)
Task: Find id from orders where a matching record exists in transactions with the same id.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_10790 | train | T1 |
v3 | Schema:
orders (alias: ord)(name, type, level, salary)
customers(code, name, date, id)
Task: Retrieve name from orders with amount above the SUM(amount) of customers rows sharing the same id.
SQL: | SELECT name FROM orders AS ord
WHERE amount > (
SELECT SUM(amount) FROM customers AS cust
WHERE cust.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_10791 | train | T1 |
v3 | Schema:
schedules (alias: schd)(type, id, name, status)
transactions(level, salary, value, code)
Task: Find code from schedules where salary exceeds the average value from transactions for the same status.
SQL: | SELECT code FROM schedules AS schd
WHERE salary > (
SELECT SUM(value) FROM transactions AS txn
WHERE txn.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_10792 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(id, value, status, salary)
services(code, amount, id, type)
Task: Select amount from warehouses where status exists in services for the same type.
SQL: | SELECT amount FROM warehouses AS whs
WHERE status IN (
SELECT status FROM services AS srvc
WHERE srvc.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "services",
"outer_alias": "whs",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_10793 | train | T2 |
v3 | Schema:
schedules (alias: schd)(amount, status, level, id)
customers(code, status, date, salary)
Task: Find amount from schedules where value exceeds the average salary from customers for the same id.
SQL: | SELECT amount FROM schedules AS schd
WHERE value > (
SELECT MIN(salary) FROM customers AS cust
WHERE cust.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_10794 | train | T2 |
v3 | Schema:
customers (alias: cust)(id, salary, level, value)
services(code, value, name, status)
Task: Find code from customers where amount exceeds the average salary from services for the same id.
SQL: | SELECT code FROM customers AS cust
WHERE amount > (
SELECT SUM(salary) FROM services AS srvc
WHERE srvc.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "services",
"outer_alias": "cust",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_10795 | train | T1 |
v3 | Schema:
managers (alias: mgr)(date, status, id, amount)
invoices(name, type, status, date)
Task: Find id from managers where salary exceeds the average value from invoices for the same type.
SQL: | SELECT id FROM managers AS mgr
WHERE salary > (
SELECT MAX(value) FROM invoices AS inv
WHERE inv.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_10796 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(amount, type, value, level)
customers(code, type, value, level)
Task: Retrieve id from warehouses with value above the COUNT(value) of customers rows sharing the same code.
SQL: | SELECT id FROM warehouses AS whs
WHERE value > (
SELECT COUNT(value) FROM customers AS cust
WHERE cust.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "customers",
"outer_alias": "whs",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_10797 | train | T2 |
v1 | Schema:
shipments (alias: shp)(date, amount, id, value)
sales(salary, amount, status, date)
Task: Find salary from shipments where id appears in sales entries with matching code.
SQL: | SELECT salary 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": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_10798 | train | T2 |
v3 | Schema:
sales (alias: sale)(level, type, id, code)
items(code, amount, name, type)
Task: Find amount from sales where salary exceeds the average value from items for the same status.
SQL: | SELECT amount FROM sales AS sale
WHERE salary > (
SELECT MAX(value) FROM items AS lne
WHERE lne.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_10799 | train | T1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.