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:
accounts (alias: acct)(date, id, value, type)
invoices(name, code, level, date)
Task: Retrieve name from accounts whose status is found in invoices rows where id matches the outer record.
SQL: | SELECT name FROM accounts AS acct
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_10800 | train | T1 |
v2 | Schema:
invoices (alias: inv)(type, name, value, status)
categories(salary, id, type, value)
Task: Retrieve salary from invoices that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_10801 | train | T1 |
v3 | Schema:
accounts (alias: acct)(name, level, status, amount)
schedules(type, code, value, id)
Task: Find amount from accounts where value exceeds the average value from schedules for the same id.
SQL: | SELECT amount FROM accounts AS acct
WHERE value > (
SELECT AVG(value) FROM schedules AS schd
WHERE schd.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_10802 | train | T1 |
v1 | Schema:
invoices (alias: inv)(id, type, level, value)
customers(type, code, salary, status)
Task: Find value from invoices where id appears in customers entries with matching level.
SQL: | SELECT value FROM invoices AS inv
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_10803 | train | T1 |
v3 | Schema:
employees (alias: emp)(type, id, status, amount)
staff(id, salary, amount, level)
Task: Retrieve amount from employees with value above the SUM(amount) of staff rows sharing the same code.
SQL: | SELECT amount FROM employees AS emp
WHERE value > (
SELECT SUM(amount) FROM staff AS empl
WHERE empl.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_10804 | train | T1 |
v1 | Schema:
accounts (alias: acct)(date, value, level, type)
managers(name, code, amount, id)
Task: Select name from accounts where type exists in managers for the same level.
SQL: | SELECT name FROM accounts AS acct
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_10805 | train | T1 |
v2 | Schema:
orders (alias: ord)(name, value, status, level)
sales(status, code, date, id)
Task: Retrieve value from orders that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_10806 | train | T1 |
v1 | Schema:
regions (alias: rgn)(amount, code, salary, name)
employees(date, level, id, salary)
Task: Retrieve code from regions whose level is found in employees rows where status matches the outer record.
SQL: | SELECT code FROM regions AS rgn
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_10807 | train | T2 |
v3 | Schema:
transactions (alias: txn)(value, id, salary, code)
managers(type, code, status, level)
Task: Retrieve amount from transactions with value above the MIN(value) of managers rows sharing the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE value > (
SELECT MIN(value) FROM managers AS mgr
WHERE mgr.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_10808 | train | T1 |
v1 | Schema:
budgets (alias: budg)(date, name, amount, type)
staff(id, amount, date, code)
Task: Retrieve salary from budgets whose id is found in staff rows where status matches the outer record.
SQL: | SELECT salary FROM budgets AS budg
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "staff",
"outer_alias": "budg",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_10809 | train | T2 |
v2 | Schema:
services (alias: srvc)(name, amount, value, code)
items(id, type, date, name)
Task: Retrieve amount from services that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT amount FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "items",
"outer_alias": "srvc",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_10810 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(amount, id, status, value)
schedules(type, id, salary, value)
Task: Find amount from warehouses where amount exceeds the average amount from schedules for the same status.
SQL: | SELECT amount FROM warehouses AS whs
WHERE amount > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "schedules",
"outer_alias": "whs",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_10811 | train | T2 |
v2 | Schema:
transactions (alias: txn)(date, amount, name, status)
requests(name, id, type, status)
Task: Retrieve salary from transactions that have at least one corresponding entry in requests sharing the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_10812 | train | T1 |
v2 | Schema:
schedules (alias: schd)(code, amount, status, value)
sales(salary, amount, level, id)
Task: Find id from schedules where a matching record exists in sales with the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_10813 | train | T2 |
v3 | Schema:
departments (alias: dept)(amount, level, name, code)
schedules(amount, level, type, id)
Task: Find salary from departments where value exceeds the average value from schedules for the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE value > (
SELECT SUM(value) FROM schedules AS schd
WHERE schd.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_10814 | train | T1 |
v1 | Schema:
budgets (alias: budg)(salary, id, code, amount)
products(status, name, date, id)
Task: Select id from budgets where id exists in products for the same id.
SQL: | SELECT id FROM budgets AS budg
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "products",
"outer_alias": "budg",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_10815 | train | T2 |
v2 | Schema:
customers (alias: cust)(type, value, date, code)
schedules(salary, value, type, date)
Task: Find salary from customers where a matching record exists in schedules with the same type.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_10816 | train | T1 |
v3 | Schema:
invoices (alias: inv)(value, salary, amount, type)
departments(code, value, id, type)
Task: Find name from invoices where salary exceeds the average amount from departments for the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE salary > (
SELECT MAX(amount) FROM departments AS dept
WHERE dept.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_10817 | train | T1 |
v3 | Schema:
categories (alias: catg)(date, status, amount, level)
staff(id, value, status, name)
Task: Find amount from categories where value exceeds the average salary from staff for the same code.
SQL: | SELECT amount FROM categories AS catg
WHERE value > (
SELECT SUM(salary) FROM staff AS empl
WHERE empl.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_10818 | train | T2 |
v3 | Schema:
employees (alias: emp)(salary, value, code, type)
invoices(id, type, status, amount)
Task: Retrieve amount from employees with value above the SUM(salary) of invoices rows sharing the same status.
SQL: | SELECT amount FROM employees AS emp
WHERE value > (
SELECT SUM(salary) FROM invoices AS inv
WHERE inv.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_10819 | train | T1 |
v3 | Schema:
staff (alias: empl)(value, name, id, type)
warehouses(level, date, amount, name)
Task: Find salary from staff where salary exceeds the average value from warehouses for the same id.
SQL: | SELECT salary FROM staff AS empl
WHERE salary > (
SELECT SUM(value) FROM warehouses AS whs
WHERE whs.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "warehouses",
"outer_alias": "empl",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_10820 | train | T2 |
v1 | Schema:
items (alias: lne)(code, type, level, date)
regions(status, level, date, value)
Task: Select name from items where type exists in regions for the same level.
SQL: | SELECT name FROM items AS lne
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_10821 | train | T2 |
v1 | Schema:
budgets (alias: budg)(name, amount, value, status)
managers(salary, level, amount, type)
Task: Select id from budgets where status exists in managers for the same id.
SQL: | SELECT id FROM budgets AS budg
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "managers",
"outer_alias": "budg",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_10822 | train | T2 |
v2 | Schema:
accounts (alias: acct)(name, level, value, amount)
items(value, level, salary, date)
Task: Find code from accounts where a matching record exists in items with the same status.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_10823 | train | T1 |
v2 | Schema:
shipments (alias: shp)(id, level, amount, type)
items(status, date, level, value)
Task: Find name from shipments where a matching record exists in items with the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_10824 | train | T2 |
v2 | Schema:
staff (alias: empl)(level, amount, code, id)
orders(level, amount, value, type)
Task: Find value from staff where a matching record exists in orders with the same status.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_10825 | train | T2 |
v3 | Schema:
accounts (alias: acct)(id, level, code, type)
shipments(amount, date, type, level)
Task: Retrieve code from accounts with amount above the MAX(salary) of shipments rows sharing the same id.
SQL: | SELECT code FROM accounts AS acct
WHERE amount > (
SELECT MAX(salary) FROM shipments AS shp
WHERE shp.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_10826 | train | T1 |
v1 | Schema:
transactions (alias: txn)(name, value, level, id)
categories(name, code, value, id)
Task: Find name from transactions where status appears in categories entries with matching id.
SQL: | SELECT name FROM transactions AS txn
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_10827 | train | T1 |
v3 | Schema:
budgets (alias: budg)(status, amount, value, date)
accounts(status, date, level, id)
Task: Retrieve salary from budgets with value above the MAX(amount) of accounts rows sharing the same status.
SQL: | SELECT salary FROM budgets AS budg
WHERE value > (
SELECT MAX(amount) FROM accounts AS acct
WHERE acct.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "accounts",
"outer_alias": "budg",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_10828 | train | T2 |
v3 | Schema:
shipments (alias: shp)(status, amount, level, value)
accounts(code, date, id, salary)
Task: Find code from shipments where value exceeds the average value from accounts for the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE value > (
SELECT COUNT(value) FROM accounts AS acct
WHERE acct.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_10829 | train | T2 |
v1 | Schema:
budgets (alias: budg)(status, salary, code, level)
transactions(amount, level, value, salary)
Task: Select code from budgets where code exists in transactions for the same id.
SQL: | SELECT code FROM budgets AS budg
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "transactions",
"outer_alias": "budg",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_10830 | train | T2 |
v1 | Schema:
sales (alias: sale)(status, type, date, id)
managers(type, amount, code, value)
Task: Select salary from sales where status exists in managers for the same type.
SQL: | SELECT salary FROM sales AS sale
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_10831 | train | T1 |
v2 | Schema:
services (alias: srvc)(id, value, level, amount)
requests(date, id, value, salary)
Task: Find amount from services where a matching record exists in requests with the same type.
SQL: | SELECT amount FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "requests",
"outer_alias": "srvc",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_10832 | train | T2 |
v3 | Schema:
regions (alias: rgn)(name, code, amount, salary)
requests(value, salary, code, amount)
Task: Retrieve salary from regions with salary above the AVG(salary) of requests rows sharing the same code.
SQL: | SELECT salary FROM regions AS rgn
WHERE salary > (
SELECT AVG(salary) FROM requests AS ordr
WHERE ordr.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_10833 | train | T2 |
v1 | Schema:
transactions (alias: txn)(name, amount, id, salary)
products(code, value, amount, status)
Task: Find id from transactions where level appears in products entries with matching status.
SQL: | SELECT id FROM transactions AS txn
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_10834 | train | T1 |
v1 | Schema:
orders (alias: ord)(code, date, level, value)
shipments(type, code, amount, id)
Task: Retrieve id from orders whose status is found in shipments rows where code matches the outer record.
SQL: | SELECT id FROM orders AS ord
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_10835 | train | T1 |
v3 | Schema:
budgets (alias: budg)(level, name, type, code)
orders(amount, value, id, type)
Task: Retrieve salary from budgets with salary above the MIN(amount) of orders rows sharing the same status.
SQL: | SELECT salary FROM budgets AS budg
WHERE salary > (
SELECT MIN(amount) FROM orders AS ord
WHERE ord.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "orders",
"outer_alias": "budg",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_10836 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(name, amount, value, type)
orders(status, value, type, amount)
Task: Retrieve amount from warehouses whose status is found in orders rows where status matches the outer record.
SQL: | SELECT amount FROM warehouses AS whs
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "orders",
"outer_alias": "whs",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_10837 | train | T2 |
v3 | Schema:
managers (alias: mgr)(date, name, salary, level)
accounts(name, salary, level, code)
Task: Retrieve name from managers with amount above the COUNT(amount) of accounts rows sharing the same code.
SQL: | SELECT name FROM managers AS mgr
WHERE amount > (
SELECT COUNT(amount) FROM accounts AS acct
WHERE acct.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_10838 | train | T1 |
v2 | Schema:
employees (alias: emp)(status, date, level, type)
schedules(level, id, status, value)
Task: Retrieve code from employees that have at least one corresponding entry in schedules sharing 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_10839 | train | T1 |
v2 | Schema:
regions (alias: rgn)(salary, type, id, level)
managers(status, type, amount, salary)
Task: Find code from regions where a matching record exists in managers with the same status.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_10840 | train | T2 |
v2 | Schema:
staff (alias: empl)(id, level, date, status)
customers(amount, id, status, date)
Task: Find salary from staff where a matching record exists in customers with the same code.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_10841 | train | T2 |
v3 | Schema:
transactions (alias: txn)(id, value, salary, name)
managers(code, date, salary, status)
Task: Find name from transactions where amount exceeds the average amount from managers for the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE amount > (
SELECT AVG(amount) FROM managers AS mgr
WHERE mgr.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_10842 | train | T1 |
v1 | Schema:
regions (alias: rgn)(amount, id, name, level)
budgets(name, id, date, status)
Task: Select name from regions where code exists in budgets for the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE code IN (
SELECT code FROM budgets AS budg
WHERE budg.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "budgets",
"outer_alias": "rgn",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_10843 | train | T2 |
v3 | Schema:
transactions (alias: txn)(status, id, code, name)
departments(amount, level, code, name)
Task: Find id from transactions where salary exceeds the average value from departments for the same level.
SQL: | SELECT id FROM transactions AS txn
WHERE salary > (
SELECT AVG(value) FROM departments AS dept
WHERE dept.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_10844 | train | T1 |
v1 | Schema:
sales (alias: sale)(amount, value, name, id)
customers(amount, value, id, code)
Task: Select name from sales where level exists in customers for the same status.
SQL: | SELECT name FROM sales AS sale
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_10845 | train | T1 |
v1 | Schema:
categories (alias: catg)(salary, type, amount, value)
departments(type, id, level, name)
Task: Find salary from categories where id appears in departments entries with matching type.
SQL: | SELECT salary FROM categories AS catg
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_10846 | train | T2 |
v3 | Schema:
items (alias: lne)(level, id, date, status)
warehouses(type, code, salary, name)
Task: Find amount from items where amount exceeds the average amount from warehouses for the same code.
SQL: | SELECT amount FROM items AS lne
WHERE amount > (
SELECT SUM(amount) FROM warehouses AS whs
WHERE whs.code = lne.code
); | {
"outer_table": "items",
"inner_table": "warehouses",
"outer_alias": "lne",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_10847 | train | T2 |
v3 | Schema:
schedules (alias: schd)(value, status, type, amount)
employees(date, code, value, amount)
Task: Retrieve name from schedules with value above the MAX(salary) of employees rows sharing the same id.
SQL: | SELECT name FROM schedules AS schd
WHERE value > (
SELECT MAX(salary) FROM employees AS emp
WHERE emp.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_10848 | train | T2 |
v1 | Schema:
invoices (alias: inv)(code, salary, date, type)
shipments(salary, amount, status, value)
Task: Find salary from invoices where level appears in shipments entries with matching code.
SQL: | SELECT salary FROM invoices AS inv
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_10849 | train | T1 |
v2 | Schema:
items (alias: lne)(value, code, name, level)
shipments(status, salary, level, name)
Task: Find amount from items where a matching record exists in shipments with the same type.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = lne.type
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_10850 | train | T2 |
v1 | Schema:
orders (alias: ord)(level, name, code, date)
managers(value, salary, date, type)
Task: Select value from orders where level exists in managers for the same code.
SQL: | SELECT value FROM orders AS ord
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_10851 | train | T1 |
v3 | Schema:
budgets (alias: budg)(code, type, name, level)
shipments(type, date, code, value)
Task: Retrieve name from budgets with salary above the MAX(salary) of shipments rows sharing the same level.
SQL: | SELECT name FROM budgets AS budg
WHERE salary > (
SELECT MAX(salary) FROM shipments AS shp
WHERE shp.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "shipments",
"outer_alias": "budg",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_10852 | train | T2 |
v2 | Schema:
shipments (alias: shp)(salary, status, type, code)
items(id, status, code, type)
Task: Find id from shipments where a matching record exists in items with the same id.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_10853 | train | T2 |
v2 | Schema:
shipments (alias: shp)(salary, code, amount, level)
products(status, name, code, date)
Task: Find salary from shipments where a matching record exists in products with the same code.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_10854 | train | T2 |
v2 | Schema:
services (alias: srvc)(code, id, salary, amount)
requests(level, id, type, code)
Task: Find id from services where a matching record exists in requests with the same status.
SQL: | SELECT id FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "requests",
"outer_alias": "srvc",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_10855 | train | T2 |
v3 | Schema:
accounts (alias: acct)(type, level, status, salary)
services(name, date, status, id)
Task: Find name from accounts where salary exceeds the average value from services for the same level.
SQL: | SELECT name FROM accounts AS acct
WHERE salary > (
SELECT MAX(value) FROM services AS srvc
WHERE srvc.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "services",
"outer_alias": "acct",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_10856 | train | T1 |
v1 | Schema:
invoices (alias: inv)(salary, date, level, value)
managers(salary, level, id, status)
Task: Find code from invoices where type appears in managers entries with matching level.
SQL: | SELECT code FROM invoices AS inv
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_10857 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(amount, code, type, name)
managers(value, id, status, salary)
Task: Select id from warehouses where level exists in managers for the same level.
SQL: | SELECT id FROM warehouses AS whs
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "managers",
"outer_alias": "whs",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_10858 | train | T2 |
v2 | Schema:
customers (alias: cust)(status, code, salary, name)
managers(code, type, status, id)
Task: Find salary from customers where a matching record exists in managers with the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_10859 | train | T1 |
v2 | Schema:
shipments (alias: shp)(amount, value, name, type)
customers(id, type, amount, salary)
Task: Find amount from shipments where a matching record exists in customers with the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_10860 | train | T2 |
v2 | Schema:
requests (alias: ordr)(id, salary, amount, name)
employees(type, salary, code, value)
Task: Retrieve code from requests that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_10861 | train | T2 |
v2 | Schema:
customers (alias: cust)(date, amount, value, type)
regions(value, name, id, salary)
Task: Retrieve salary from customers that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_10862 | train | T1 |
v1 | Schema:
products (alias: prod)(level, code, date, type)
departments(value, name, id, code)
Task: Select code from products where code exists in departments for the same code.
SQL: | SELECT code FROM products AS prod
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.code = prod.code
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_10863 | train | T1 |
v3 | Schema:
accounts (alias: acct)(date, amount, id, status)
sales(code, amount, salary, id)
Task: Find name from accounts where salary exceeds the average amount from sales for the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE salary > (
SELECT AVG(amount) FROM sales AS sale
WHERE sale.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_10864 | train | T1 |
v2 | Schema:
regions (alias: rgn)(name, code, type, status)
categories(type, level, date, id)
Task: Retrieve id from regions that have at least one corresponding entry in categories sharing the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_10865 | train | T2 |
v1 | Schema:
shipments (alias: shp)(amount, code, name, salary)
products(level, amount, code, salary)
Task: Select salary from shipments where id exists in products for the same level.
SQL: | SELECT salary FROM shipments AS shp
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_10866 | train | T2 |
v3 | Schema:
staff (alias: empl)(level, status, date, name)
schedules(salary, code, date, value)
Task: Find name from staff where salary exceeds the average salary from schedules for the same id.
SQL: | SELECT name FROM staff AS empl
WHERE salary > (
SELECT MIN(salary) FROM schedules AS schd
WHERE schd.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_10867 | train | T2 |
v1 | Schema:
requests (alias: ordr)(date, name, status, type)
accounts(type, code, status, id)
Task: Find salary from requests where status appears in accounts entries with matching level.
SQL: | SELECT salary FROM requests AS ordr
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_10868 | train | T2 |
v1 | Schema:
sales (alias: sale)(value, amount, status, name)
departments(type, value, name, id)
Task: Select value from sales where level exists in departments for the same level.
SQL: | SELECT value FROM sales AS sale
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_10869 | train | T1 |
v2 | Schema:
sales (alias: sale)(id, type, level, salary)
schedules(type, value, status, level)
Task: Retrieve code from sales that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_10870 | train | T1 |
v1 | Schema:
items (alias: lne)(date, id, name, amount)
sales(id, status, date, level)
Task: Find code from items where type appears in sales entries with matching id.
SQL: | SELECT code FROM items AS lne
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.id = lne.id
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_10871 | train | T2 |
v3 | Schema:
staff (alias: empl)(name, type, id, status)
items(level, date, salary, name)
Task: Retrieve id from staff with amount above the COUNT(value) of items rows sharing the same id.
SQL: | SELECT id FROM staff AS empl
WHERE amount > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_10872 | train | T2 |
v1 | Schema:
regions (alias: rgn)(value, name, salary, status)
managers(code, salary, status, amount)
Task: Retrieve code from regions whose status is found in managers rows where id matches the outer record.
SQL: | SELECT code FROM regions AS rgn
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_10873 | train | T2 |
v1 | Schema:
orders (alias: ord)(value, amount, date, status)
employees(level, type, id, value)
Task: Select salary from orders where level exists in employees for the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_10874 | train | T1 |
v2 | Schema:
items (alias: lne)(code, id, type, status)
schedules(level, value, type, name)
Task: Find salary from items where a matching record exists in schedules with the same type.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = lne.type
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_10875 | train | T2 |
v1 | Schema:
schedules (alias: schd)(name, amount, salary, type)
categories(name, level, type, date)
Task: Select id from schedules where level exists in categories for the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_10876 | train | T2 |
v3 | Schema:
requests (alias: ordr)(salary, level, amount, type)
customers(code, type, value, name)
Task: Retrieve code from requests with value above the MAX(salary) of customers rows sharing the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE value > (
SELECT MAX(salary) FROM customers AS cust
WHERE cust.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_10877 | train | T2 |
v1 | Schema:
categories (alias: catg)(code, type, value, level)
staff(value, amount, salary, id)
Task: Find amount from categories where code appears in staff entries with matching type.
SQL: | SELECT amount FROM categories AS catg
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_10878 | train | T2 |
v1 | Schema:
accounts (alias: acct)(date, code, status, amount)
warehouses(type, level, id, code)
Task: Select code from accounts where type exists in warehouses for the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE type IN (
SELECT type FROM warehouses AS whs
WHERE whs.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "warehouses",
"outer_alias": "acct",
"inner_alias": "whs",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_10879 | train | T1 |
v3 | Schema:
departments (alias: dept)(type, amount, code, name)
employees(date, name, value, type)
Task: Retrieve id from departments with amount above the COUNT(amount) of employees rows sharing the same status.
SQL: | SELECT id FROM departments AS dept
WHERE amount > (
SELECT COUNT(amount) FROM employees AS emp
WHERE emp.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_10880 | train | T1 |
v1 | Schema:
employees (alias: emp)(level, date, amount, status)
orders(id, amount, code, status)
Task: Retrieve value from employees whose type is found in orders rows where type matches the outer record.
SQL: | SELECT value FROM employees AS emp
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_10881 | train | T1 |
v1 | Schema:
departments (alias: dept)(status, date, code, salary)
items(value, amount, level, type)
Task: Find code from departments where level appears in items entries with matching code.
SQL: | SELECT code FROM departments AS dept
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_10882 | train | T1 |
v3 | Schema:
items (alias: lne)(status, date, level, code)
budgets(status, salary, amount, type)
Task: Find salary from items where amount exceeds the average amount from budgets for the same code.
SQL: | SELECT salary FROM items AS lne
WHERE amount > (
SELECT COUNT(amount) FROM budgets AS budg
WHERE budg.code = lne.code
); | {
"outer_table": "items",
"inner_table": "budgets",
"outer_alias": "lne",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_10883 | train | T2 |
v1 | Schema:
sales (alias: sale)(amount, id, status, type)
products(salary, value, amount, id)
Task: Select code from sales where type exists in products for the same code.
SQL: | SELECT code FROM sales AS sale
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_10884 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(amount, level, name, code)
shipments(date, status, amount, value)
Task: Retrieve amount from warehouses whose id is found in shipments rows where status matches the outer record.
SQL: | SELECT amount FROM warehouses AS whs
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "shipments",
"outer_alias": "whs",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_10885 | train | T2 |
v2 | Schema:
schedules (alias: schd)(id, salary, amount, level)
warehouses(code, status, salary, id)
Task: Retrieve amount from schedules that have at least one corresponding entry in warehouses sharing the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "warehouses",
"outer_alias": "schd",
"inner_alias": "whs",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_10886 | train | T2 |
v3 | Schema:
invoices (alias: inv)(code, name, amount, value)
customers(status, type, name, id)
Task: Retrieve code from invoices with amount above the AVG(value) of customers rows sharing the same status.
SQL: | SELECT code FROM invoices AS inv
WHERE amount > (
SELECT AVG(value) FROM customers AS cust
WHERE cust.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_10887 | train | T1 |
v3 | Schema:
managers (alias: mgr)(date, id, salary, name)
shipments(type, level, amount, date)
Task: Find value from managers where salary exceeds the average amount from shipments for the same id.
SQL: | SELECT value FROM managers AS mgr
WHERE salary > (
SELECT COUNT(amount) FROM shipments AS shp
WHERE shp.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_10888 | train | T1 |
v3 | Schema:
items (alias: lne)(type, code, id, level)
categories(id, value, name, status)
Task: Find amount from items where value exceeds the average salary from categories for the same code.
SQL: | SELECT amount FROM items AS lne
WHERE value > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.code = lne.code
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_10889 | train | T2 |
v2 | Schema:
categories (alias: catg)(level, value, code, status)
sales(id, value, name, salary)
Task: Retrieve value from categories that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_10890 | train | T2 |
v1 | Schema:
products (alias: prod)(level, status, salary, type)
accounts(date, name, value, salary)
Task: Retrieve id from products whose type is found in accounts rows where status matches the outer record.
SQL: | SELECT id FROM products AS prod
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.status = prod.status
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_10891 | train | T1 |
v2 | Schema:
shipments (alias: shp)(value, code, type, status)
warehouses(type, amount, level, salary)
Task: Find id from shipments where a matching record exists in warehouses with the same level.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "warehouses",
"outer_alias": "shp",
"inner_alias": "whs",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_10892 | train | T2 |
v3 | Schema:
managers (alias: mgr)(status, name, salary, date)
categories(id, name, code, value)
Task: Find amount from managers where value exceeds the average value from categories for the same code.
SQL: | SELECT amount FROM managers AS mgr
WHERE value > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_10893 | train | T1 |
v1 | Schema:
requests (alias: ordr)(level, code, status, type)
orders(status, type, code, id)
Task: Retrieve amount from requests whose type is found in orders rows where code matches the outer record.
SQL: | SELECT amount FROM requests AS ordr
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_10894 | train | T2 |
v2 | Schema:
regions (alias: rgn)(salary, name, amount, id)
shipments(name, value, salary, amount)
Task: Retrieve amount from regions that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT amount 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": "amount",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_10895 | train | T2 |
v2 | Schema:
customers (alias: cust)(level, value, code, amount)
services(status, level, type, date)
Task: Find value from customers where a matching record exists in services with the same level.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "services",
"outer_alias": "cust",
"inner_alias": "srvc",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_10896 | train | T1 |
v3 | Schema:
regions (alias: rgn)(value, status, id, level)
departments(salary, date, id, amount)
Task: Find name from regions where salary exceeds the average value from departments for the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE salary > (
SELECT MIN(value) FROM departments AS dept
WHERE dept.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_10897 | train | T2 |
v1 | Schema:
items (alias: lne)(name, amount, status, type)
orders(type, id, salary, status)
Task: Select code from items where code exists in orders for the same id.
SQL: | SELECT code FROM items AS lne
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.id = lne.id
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_10898 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(name, salary, date, level)
categories(level, value, status, code)
Task: Retrieve salary from warehouses that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT salary FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "categories",
"outer_alias": "whs",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_10899 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.