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:
managers (alias: mgr)(value, level, code, amount)
orders(id, date, value, level)
Task: Retrieve name from managers whose level is found in orders rows where type matches the outer record.
SQL: | SELECT name FROM managers AS mgr
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_00500 | train | T1 |
v2 | Schema:
categories (alias: catg)(status, value, date, amount)
employees(level, type, code, name)
Task: Retrieve name from categories that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_00501 | train | T2 |
v2 | Schema:
orders (alias: ord)(type, amount, status, salary)
services(type, amount, date, name)
Task: Find id from orders where a matching record exists in services with the same code.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "services",
"outer_alias": "ord",
"inner_alias": "srvc",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_00502 | train | T1 |
v1 | Schema:
staff (alias: empl)(status, code, level, name)
categories(salary, status, level, amount)
Task: Select name from staff where code exists in categories for the same id.
SQL: | SELECT name FROM staff AS empl
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_00503 | train | T2 |
v1 | Schema:
sales (alias: sale)(amount, type, date, name)
services(id, value, date, type)
Task: Retrieve salary from sales whose type is found in services rows where id matches the outer record.
SQL: | SELECT salary FROM sales AS sale
WHERE type IN (
SELECT type FROM services AS srvc
WHERE srvc.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "services",
"outer_alias": "sale",
"inner_alias": "srvc",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_00504 | train | T1 |
v2 | Schema:
budgets (alias: budg)(name, amount, code, id)
products(id, type, name, code)
Task: Retrieve id from budgets that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT id FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "products",
"outer_alias": "budg",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_00505 | train | T2 |
v3 | Schema:
requests (alias: ordr)(salary, code, amount, id)
departments(level, code, amount, salary)
Task: Find code from requests where salary exceeds the average amount from departments for the same status.
SQL: | SELECT code FROM requests AS ordr
WHERE salary > (
SELECT COUNT(amount) FROM departments AS dept
WHERE dept.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_00506 | train | T2 |
v3 | Schema:
regions (alias: rgn)(date, name, level, status)
departments(code, amount, value, date)
Task: Retrieve name from regions with value above the COUNT(salary) of departments rows sharing the same id.
SQL: | SELECT name FROM regions AS rgn
WHERE value > (
SELECT COUNT(salary) FROM departments AS dept
WHERE dept.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_00507 | train | T2 |
v3 | Schema:
categories (alias: catg)(date, id, amount, value)
warehouses(salary, id, amount, name)
Task: Find salary from categories where salary exceeds the average value from warehouses for the same code.
SQL: | SELECT salary FROM categories AS catg
WHERE salary > (
SELECT COUNT(value) FROM warehouses AS whs
WHERE whs.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "warehouses",
"outer_alias": "catg",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_00508 | train | T2 |
v2 | Schema:
schedules (alias: schd)(salary, value, amount, level)
staff(amount, name, type, id)
Task: Find value from schedules where a matching record exists in staff with the same code.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_00509 | train | T2 |
v2 | Schema:
transactions (alias: txn)(type, id, level, code)
staff(status, value, amount, type)
Task: Find code from transactions where a matching record exists in staff with the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_00510 | train | T1 |
v3 | Schema:
categories (alias: catg)(type, id, status, date)
requests(salary, name, type, level)
Task: Find value from categories where salary exceeds the average salary from requests for the same type.
SQL: | SELECT value FROM categories AS catg
WHERE salary > (
SELECT MIN(salary) FROM requests AS ordr
WHERE ordr.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_00511 | train | T2 |
v1 | Schema:
shipments (alias: shp)(id, level, status, type)
services(code, amount, name, type)
Task: Select amount from shipments where type exists in services for the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE type IN (
SELECT type FROM services AS srvc
WHERE srvc.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "services",
"outer_alias": "shp",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_00512 | train | T2 |
v1 | Schema:
budgets (alias: budg)(id, amount, status, value)
transactions(name, value, salary, id)
Task: Select name from budgets where status exists in transactions for the same type.
SQL: | SELECT name FROM budgets AS budg
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "transactions",
"outer_alias": "budg",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_00513 | train | T2 |
v3 | Schema:
employees (alias: emp)(value, salary, id, type)
staff(amount, type, level, value)
Task: Retrieve salary from employees with amount above the COUNT(amount) of staff rows sharing the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE amount > (
SELECT COUNT(amount) FROM staff AS empl
WHERE empl.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_00514 | train | T1 |
v1 | Schema:
managers (alias: mgr)(type, amount, date, code)
items(type, date, status, id)
Task: Retrieve amount from managers whose status is found in items rows where code matches the outer record.
SQL: | SELECT amount FROM managers AS mgr
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_00515 | train | T1 |
v3 | Schema:
transactions (alias: txn)(id, date, salary, code)
budgets(value, name, type, date)
Task: Retrieve name from transactions with value above the SUM(value) of budgets rows sharing the same level.
SQL: | SELECT name FROM transactions AS txn
WHERE value > (
SELECT SUM(value) FROM budgets AS budg
WHERE budg.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "budgets",
"outer_alias": "txn",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_00516 | train | T1 |
v3 | Schema:
shipments (alias: shp)(salary, code, status, date)
items(level, value, salary, code)
Task: Retrieve salary from shipments with salary above the SUM(amount) of items rows sharing the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE salary > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_00517 | train | T2 |
v1 | Schema:
regions (alias: rgn)(code, type, salary, value)
transactions(code, status, id, amount)
Task: Select name from regions where type exists in transactions for the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_00518 | train | T2 |
v3 | Schema:
transactions (alias: txn)(name, type, id, level)
shipments(name, value, id, status)
Task: Retrieve id from transactions with amount above the SUM(amount) of shipments rows sharing the same level.
SQL: | SELECT id FROM transactions AS txn
WHERE amount > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_00519 | train | T1 |
v1 | Schema:
staff (alias: empl)(level, code, status, amount)
departments(date, type, id, status)
Task: Find amount from staff where code appears in departments entries with matching level.
SQL: | SELECT amount FROM staff AS empl
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_00520 | train | T2 |
v3 | Schema:
orders (alias: ord)(id, type, name, amount)
regions(type, salary, date, level)
Task: Find name from orders where amount exceeds the average amount from regions for the same code.
SQL: | SELECT name FROM orders AS ord
WHERE amount > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_00521 | train | T1 |
v2 | Schema:
transactions (alias: txn)(date, name, id, level)
accounts(name, id, level, amount)
Task: Retrieve amount from transactions that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_00522 | train | T1 |
v2 | Schema:
departments (alias: dept)(level, type, code, amount)
customers(name, type, value, status)
Task: Find salary from departments where a matching record exists in customers with the same code.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_00523 | train | T1 |
v3 | Schema:
employees (alias: emp)(date, name, status, id)
shipments(level, name, code, type)
Task: Find id from employees where value exceeds the average amount from shipments for the same status.
SQL: | SELECT id FROM employees AS emp
WHERE value > (
SELECT MAX(amount) FROM shipments AS shp
WHERE shp.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_00524 | train | T1 |
v3 | Schema:
managers (alias: mgr)(date, amount, type, level)
products(value, status, id, name)
Task: Find id from managers where value exceeds the average salary from products for the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE value > (
SELECT SUM(salary) FROM products AS prod
WHERE prod.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_00525 | train | T1 |
v1 | Schema:
requests (alias: ordr)(name, date, type, level)
departments(name, level, code, date)
Task: Retrieve salary from requests whose status is found in departments rows where code matches the outer record.
SQL: | SELECT salary FROM requests AS ordr
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_00526 | train | T2 |
v1 | Schema:
employees (alias: emp)(date, name, type, status)
staff(amount, salary, id, date)
Task: Find salary from employees where level appears in staff entries with matching id.
SQL: | SELECT salary FROM employees AS emp
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_00527 | train | T1 |
v2 | Schema:
managers (alias: mgr)(name, status, type, id)
transactions(amount, name, date, id)
Task: Find code from managers where a matching record exists in transactions with the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_00528 | train | T1 |
v1 | Schema:
requests (alias: ordr)(type, status, code, date)
customers(name, status, code, value)
Task: Find name from requests where code appears in customers entries with matching id.
SQL: | SELECT name FROM requests AS ordr
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_00529 | train | T2 |
v2 | Schema:
invoices (alias: inv)(date, id, value, code)
warehouses(status, salary, date, name)
Task: Retrieve id from invoices that have at least one corresponding entry in warehouses sharing the same type.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "warehouses",
"outer_alias": "inv",
"inner_alias": "whs",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_00530 | train | T1 |
v1 | Schema:
requests (alias: ordr)(code, salary, date, value)
products(amount, salary, value, status)
Task: Retrieve code from requests whose type is found in products rows where status matches the outer record.
SQL: | SELECT code FROM requests AS ordr
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_00531 | train | T2 |
v2 | Schema:
regions (alias: rgn)(code, type, name, salary)
requests(name, status, level, amount)
Task: Find name from regions where a matching record exists in requests with the same code.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_00532 | train | T2 |
v2 | Schema:
staff (alias: empl)(code, value, id, status)
departments(status, date, name, level)
Task: Find amount from staff where a matching record exists in departments with the same status.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_00533 | train | T2 |
v2 | Schema:
orders (alias: ord)(level, salary, date, code)
budgets(code, value, amount, id)
Task: Find name from orders where a matching record exists in budgets with the same level.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "budgets",
"outer_alias": "ord",
"inner_alias": "budg",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_00534 | train | T1 |
v2 | Schema:
invoices (alias: inv)(name, level, id, code)
shipments(status, value, amount, level)
Task: Find value from invoices where a matching record exists in shipments with the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_00535 | train | T1 |
v2 | Schema:
customers (alias: cust)(amount, code, type, level)
invoices(salary, code, amount, level)
Task: Retrieve amount from customers that have at least one corresponding entry in invoices sharing the same code.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_00536 | train | T1 |
v1 | Schema:
shipments (alias: shp)(salary, id, value, type)
transactions(id, salary, status, level)
Task: Retrieve amount from shipments whose status is found in transactions rows where code matches the outer record.
SQL: | SELECT amount FROM shipments AS shp
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_00537 | train | T2 |
v2 | Schema:
accounts (alias: acct)(value, name, id, level)
budgets(salary, id, level, name)
Task: Find salary from accounts where a matching record exists in budgets with the same level.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "budgets",
"outer_alias": "acct",
"inner_alias": "budg",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_00538 | train | T1 |
v3 | Schema:
requests (alias: ordr)(id, status, amount, level)
invoices(code, type, amount, id)
Task: Find name from requests where value exceeds the average salary from invoices for the same id.
SQL: | SELECT name FROM requests AS ordr
WHERE value > (
SELECT AVG(salary) FROM invoices AS inv
WHERE inv.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_00539 | train | T2 |
v3 | Schema:
sales (alias: sale)(date, amount, salary, level)
departments(date, value, type, level)
Task: Retrieve code from sales with amount above the AVG(value) of departments rows sharing the same status.
SQL: | SELECT code FROM sales AS sale
WHERE amount > (
SELECT AVG(value) FROM departments AS dept
WHERE dept.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_00540 | train | T1 |
v2 | Schema:
employees (alias: emp)(id, value, name, date)
shipments(level, name, amount, date)
Task: Find id from employees where a matching record exists in shipments with the same code.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_00541 | train | T1 |
v2 | Schema:
employees (alias: emp)(name, status, id, code)
transactions(amount, status, date, name)
Task: Retrieve salary from employees that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_00542 | train | T1 |
v1 | Schema:
staff (alias: empl)(code, level, status, name)
departments(status, date, value, type)
Task: Retrieve id from staff whose status is found in departments rows where id matches the outer record.
SQL: | SELECT id FROM staff AS empl
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_00543 | train | T2 |
v2 | Schema:
items (alias: lne)(amount, id, value, type)
categories(name, code, date, salary)
Task: Retrieve name from items that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = lne.type
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_00544 | train | T2 |
v1 | Schema:
sales (alias: sale)(amount, status, id, value)
invoices(date, amount, id, salary)
Task: Select id from sales where type exists in invoices for the same status.
SQL: | SELECT id FROM sales AS sale
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_00545 | train | T1 |
v1 | Schema:
requests (alias: ordr)(type, code, name, amount)
schedules(code, status, name, value)
Task: Select amount from requests where code exists in schedules for the same code.
SQL: | SELECT amount FROM requests AS ordr
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_00546 | train | T2 |
v3 | Schema:
categories (alias: catg)(type, id, level, value)
budgets(salary, status, code, level)
Task: Find name from categories where amount exceeds the average amount from budgets for the same id.
SQL: | SELECT name FROM categories AS catg
WHERE amount > (
SELECT SUM(amount) FROM budgets AS budg
WHERE budg.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "budgets",
"outer_alias": "catg",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_00547 | train | T2 |
v2 | Schema:
requests (alias: ordr)(salary, id, date, amount)
warehouses(id, date, level, value)
Task: Retrieve salary from requests that have at least one corresponding entry in warehouses sharing the same type.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "warehouses",
"outer_alias": "ordr",
"inner_alias": "whs",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_00548 | train | T2 |
v1 | Schema:
services (alias: srvc)(value, code, amount, salary)
transactions(value, type, level, status)
Task: Retrieve id from services whose level is found in transactions rows where type matches the outer record.
SQL: | SELECT id FROM services AS srvc
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "transactions",
"outer_alias": "srvc",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_00549 | train | T2 |
v1 | Schema:
items (alias: lne)(status, name, type, salary)
accounts(code, id, date, value)
Task: Retrieve name from items whose id is found in accounts rows where id matches the outer record.
SQL: | SELECT name FROM items AS lne
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.id = lne.id
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_00550 | train | T2 |
v1 | Schema:
regions (alias: rgn)(salary, level, id, amount)
orders(amount, type, name, value)
Task: Select amount from regions where status exists in orders for the same type.
SQL: | SELECT amount FROM regions AS rgn
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_00551 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(id, date, status, salary)
invoices(name, date, code, level)
Task: Retrieve code from warehouses with amount above the COUNT(salary) of invoices rows sharing the same status.
SQL: | SELECT code FROM warehouses AS whs
WHERE amount > (
SELECT COUNT(salary) FROM invoices AS inv
WHERE inv.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "invoices",
"outer_alias": "whs",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_00552 | train | T2 |
v1 | Schema:
shipments (alias: shp)(amount, code, salary, level)
sales(value, name, salary, type)
Task: Select amount from shipments where id exists in sales for the same level.
SQL: | SELECT amount FROM shipments AS shp
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_00553 | train | T2 |
v2 | Schema:
managers (alias: mgr)(date, level, amount, type)
sales(date, level, value, status)
Task: Retrieve code from managers that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_00554 | train | T1 |
v3 | Schema:
accounts (alias: acct)(status, value, amount, code)
products(status, level, name, type)
Task: Find value from accounts where amount exceeds the average salary from products for the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE amount > (
SELECT MIN(salary) FROM products AS prod
WHERE prod.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_00555 | train | T1 |
v1 | Schema:
staff (alias: empl)(amount, date, id, name)
regions(date, id, type, level)
Task: Retrieve name from staff whose type is found in regions rows where level matches the outer record.
SQL: | SELECT name FROM staff AS empl
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_00556 | train | T2 |
v2 | Schema:
schedules (alias: schd)(amount, name, level, date)
invoices(level, value, amount, name)
Task: Retrieve name from schedules that have at least one corresponding entry in invoices sharing the same code.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_00557 | train | T2 |
v2 | Schema:
services (alias: srvc)(id, name, type, code)
invoices(name, type, status, code)
Task: Retrieve salary from services that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT salary FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "invoices",
"outer_alias": "srvc",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_00558 | train | T2 |
v2 | Schema:
invoices (alias: inv)(code, name, value, amount)
products(amount, salary, id, status)
Task: Find amount from invoices where a matching record exists in products with the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_00559 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(amount, name, salary, date)
staff(id, code, value, type)
Task: Select amount from warehouses where level exists in staff for the same type.
SQL: | SELECT amount FROM warehouses AS whs
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "staff",
"outer_alias": "whs",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_00560 | train | T2 |
v2 | Schema:
requests (alias: ordr)(value, status, date, salary)
transactions(id, level, amount, salary)
Task: Find amount from requests where a matching record exists in transactions with the same type.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_00561 | train | T2 |
v1 | Schema:
accounts (alias: acct)(level, value, salary, amount)
employees(status, code, value, level)
Task: Find value from accounts where type appears in employees entries with matching type.
SQL: | SELECT value FROM accounts AS acct
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_00562 | train | T1 |
v2 | Schema:
regions (alias: rgn)(level, name, date, salary)
services(salary, status, type, amount)
Task: Find id from regions where a matching record exists in services with the same code.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "services",
"outer_alias": "rgn",
"inner_alias": "srvc",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_00563 | train | T2 |
v1 | Schema:
orders (alias: ord)(date, id, amount, level)
schedules(status, type, code, name)
Task: Select value from orders where code exists in schedules for the same level.
SQL: | SELECT value FROM orders AS ord
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_00564 | train | T1 |
v3 | Schema:
sales (alias: sale)(name, date, type, id)
departments(id, name, date, level)
Task: Retrieve amount from sales with value above the SUM(value) of departments rows sharing the same status.
SQL: | SELECT amount FROM sales AS sale
WHERE value > (
SELECT SUM(value) FROM departments AS dept
WHERE dept.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_00565 | train | T1 |
v1 | Schema:
accounts (alias: acct)(date, status, type, salary)
departments(name, type, value, code)
Task: Select amount from accounts where level exists in departments for the same id.
SQL: | SELECT amount FROM accounts AS acct
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_00566 | train | T1 |
v1 | Schema:
invoices (alias: inv)(id, code, status, date)
employees(code, date, amount, type)
Task: Find salary from invoices where level appears in employees entries with matching status.
SQL: | SELECT salary FROM invoices AS inv
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_00567 | train | T1 |
v2 | Schema:
customers (alias: cust)(id, name, amount, code)
services(type, level, amount, id)
Task: Find salary from customers where a matching record exists in services with the same type.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "services",
"outer_alias": "cust",
"inner_alias": "srvc",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_00568 | train | T1 |
v3 | Schema:
schedules (alias: schd)(status, date, type, salary)
transactions(amount, name, level, date)
Task: Find salary from schedules where salary exceeds the average salary from transactions for the same code.
SQL: | SELECT salary FROM schedules AS schd
WHERE salary > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_00569 | train | T2 |
v3 | Schema:
departments (alias: dept)(code, level, date, salary)
categories(amount, name, type, code)
Task: Retrieve code from departments with value above the SUM(salary) of categories rows sharing the same status.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT SUM(salary) FROM categories AS catg
WHERE catg.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_00570 | train | T1 |
v2 | Schema:
orders (alias: ord)(date, level, salary, type)
regions(salary, code, level, id)
Task: Retrieve value from orders that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_00571 | train | T1 |
v1 | Schema:
items (alias: lne)(amount, id, date, level)
managers(code, value, amount, id)
Task: Select value from items where level exists in managers for the same code.
SQL: | SELECT value FROM items AS lne
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_00572 | train | T2 |
v2 | Schema:
orders (alias: ord)(salary, id, amount, code)
accounts(status, salary, date, level)
Task: Find id from orders where a matching record exists in accounts with the same status.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_00573 | train | T1 |
v1 | Schema:
accounts (alias: acct)(date, level, type, code)
customers(code, id, amount, name)
Task: Select salary from accounts where id exists in customers for the same level.
SQL: | SELECT salary FROM accounts AS acct
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_00574 | train | T1 |
v3 | Schema:
invoices (alias: inv)(value, status, type, level)
accounts(name, value, status, date)
Task: Retrieve value from invoices with salary above the MIN(amount) of accounts rows sharing the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE salary > (
SELECT MIN(amount) FROM accounts AS acct
WHERE acct.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_00575 | train | T1 |
v2 | Schema:
accounts (alias: acct)(value, date, code, level)
items(value, name, salary, amount)
Task: Find id from accounts where a matching record exists in items with the same type.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_00576 | train | T1 |
v2 | Schema:
invoices (alias: inv)(salary, level, name, status)
schedules(code, salary, status, id)
Task: Find name from invoices where a matching record exists in schedules with 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_00577 | train | T1 |
v1 | Schema:
staff (alias: empl)(date, status, salary, type)
warehouses(level, salary, status, code)
Task: Retrieve amount from staff whose id is found in warehouses rows where level matches the outer record.
SQL: | SELECT amount FROM staff AS empl
WHERE id IN (
SELECT id FROM warehouses AS whs
WHERE whs.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "warehouses",
"outer_alias": "empl",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_00578 | train | T2 |
v3 | Schema:
items (alias: lne)(id, name, date, status)
invoices(level, date, name, code)
Task: Retrieve id from items with value above the SUM(amount) of invoices rows sharing the same status.
SQL: | SELECT id FROM items AS lne
WHERE value > (
SELECT SUM(amount) FROM invoices AS inv
WHERE inv.status = lne.status
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_00579 | train | T2 |
v2 | Schema:
sales (alias: sale)(salary, status, type, name)
shipments(value, type, status, date)
Task: Retrieve id from sales that have at least one corresponding entry in shipments sharing the same level.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_00580 | train | T1 |
v2 | Schema:
schedules (alias: schd)(value, code, name, id)
customers(status, code, id, amount)
Task: Find value from schedules where a matching record exists in customers with the same level.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_00581 | train | T2 |
v1 | Schema:
regions (alias: rgn)(name, value, level, id)
services(status, amount, value, code)
Task: Retrieve id from regions whose level is found in services rows where id matches the outer record.
SQL: | SELECT id FROM regions AS rgn
WHERE level IN (
SELECT level FROM services AS srvc
WHERE srvc.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "services",
"outer_alias": "rgn",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_00582 | train | T2 |
v1 | Schema:
regions (alias: rgn)(date, level, value, id)
orders(id, salary, amount, code)
Task: Find amount from regions where status appears in orders entries with matching status.
SQL: | SELECT amount FROM regions AS rgn
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_00583 | train | T2 |
v1 | Schema:
transactions (alias: txn)(id, salary, type, level)
products(amount, type, code, salary)
Task: Select code from transactions where level exists in products for the same id.
SQL: | SELECT code FROM transactions AS txn
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_00584 | train | T1 |
v3 | Schema:
products (alias: prod)(status, type, level, salary)
accounts(salary, amount, id, name)
Task: Retrieve amount from products with amount above the MAX(salary) of accounts rows sharing the same status.
SQL: | SELECT amount FROM products AS prod
WHERE amount > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.status = prod.status
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_00585 | train | T1 |
v3 | Schema:
categories (alias: catg)(code, type, date, name)
customers(date, level, amount, value)
Task: Find amount from categories where amount exceeds the average salary from customers for the same code.
SQL: | SELECT amount FROM categories AS catg
WHERE amount > (
SELECT MIN(salary) FROM customers AS cust
WHERE cust.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_00586 | train | T2 |
v3 | Schema:
staff (alias: empl)(id, status, type, value)
transactions(salary, date, id, name)
Task: Find amount from staff where value exceeds the average amount from transactions for the same status.
SQL: | SELECT amount FROM staff AS empl
WHERE value > (
SELECT MAX(amount) FROM transactions AS txn
WHERE txn.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_00587 | train | T2 |
v3 | Schema:
invoices (alias: inv)(salary, date, name, amount)
orders(id, amount, level, type)
Task: Find amount from invoices where salary exceeds the average salary from orders for the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE salary > (
SELECT MIN(salary) FROM orders AS ord
WHERE ord.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_00588 | train | T1 |
v3 | Schema:
departments (alias: dept)(type, code, name, amount)
orders(id, name, value, code)
Task: Find name from departments where value exceeds the average salary from orders for the same status.
SQL: | SELECT name FROM departments AS dept
WHERE value > (
SELECT AVG(salary) FROM orders AS ord
WHERE ord.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_00589 | train | T1 |
v3 | Schema:
staff (alias: empl)(id, salary, value, level)
transactions(type, date, name, amount)
Task: Find value from staff where salary exceeds the average value from transactions for the same type.
SQL: | SELECT value FROM staff AS empl
WHERE salary > (
SELECT MIN(value) FROM transactions AS txn
WHERE txn.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_00590 | train | T2 |
v2 | Schema:
orders (alias: ord)(value, name, type, status)
requests(date, amount, id, type)
Task: Retrieve value from orders that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_00591 | train | T1 |
v3 | Schema:
invoices (alias: inv)(salary, date, id, amount)
accounts(name, id, salary, type)
Task: Retrieve code from invoices with salary above the MAX(amount) of accounts rows sharing the same code.
SQL: | SELECT code FROM invoices AS inv
WHERE salary > (
SELECT MAX(amount) FROM accounts AS acct
WHERE acct.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_00592 | train | T1 |
v3 | Schema:
employees (alias: emp)(level, code, type, name)
managers(level, date, id, code)
Task: Retrieve name from employees with amount above the AVG(amount) of managers rows sharing the same status.
SQL: | SELECT name FROM employees AS emp
WHERE amount > (
SELECT AVG(amount) FROM managers AS mgr
WHERE mgr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_00593 | train | T1 |
v3 | Schema:
services (alias: srvc)(level, type, id, salary)
transactions(date, value, type, name)
Task: Retrieve salary from services with amount above the SUM(value) of transactions rows sharing the same code.
SQL: | SELECT salary FROM services AS srvc
WHERE amount > (
SELECT SUM(value) FROM transactions AS txn
WHERE txn.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "transactions",
"outer_alias": "srvc",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_00594 | train | T2 |
v2 | Schema:
orders (alias: ord)(date, level, status, id)
shipments(level, salary, amount, id)
Task: Find name from orders where a matching record exists in shipments with the same status.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_00595 | train | T1 |
v3 | Schema:
accounts (alias: acct)(code, name, level, id)
invoices(date, amount, value, name)
Task: Retrieve id from accounts with salary above the COUNT(salary) of invoices rows sharing the same id.
SQL: | SELECT id FROM accounts AS acct
WHERE salary > (
SELECT COUNT(salary) FROM invoices AS inv
WHERE inv.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_00596 | train | T1 |
v3 | Schema:
services (alias: srvc)(code, salary, status, type)
categories(value, code, level, id)
Task: Retrieve amount from services with value above the MAX(value) of categories rows sharing the same id.
SQL: | SELECT amount FROM services AS srvc
WHERE value > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "categories",
"outer_alias": "srvc",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_00597 | train | T2 |
v2 | Schema:
orders (alias: ord)(name, code, amount, date)
warehouses(code, amount, type, name)
Task: Retrieve id from orders that have at least one corresponding entry in warehouses sharing the same type.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "warehouses",
"outer_alias": "ord",
"inner_alias": "whs",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_00598 | train | T1 |
v3 | Schema:
schedules (alias: schd)(type, value, id, name)
employees(id, level, type, value)
Task: Retrieve value from schedules with value above the MAX(amount) of employees rows sharing the same code.
SQL: | SELECT value FROM schedules AS schd
WHERE value > (
SELECT MAX(amount) FROM employees AS emp
WHERE emp.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_00599 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.