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 |
|---|---|---|---|---|---|---|
v2 | Schema:
orders (alias: ord)(level, salary, status, code)
items(level, amount, id, date)
Task: Find name from orders where a matching record exists in items with the same type.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_00400 | train | T1 |
v1 | Schema:
managers (alias: mgr)(type, code, name, salary)
requests(type, status, code, date)
Task: Find name from managers where id appears in requests entries with matching code.
SQL: | SELECT name FROM managers AS mgr
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_00401 | train | T1 |
v3 | Schema:
regions (alias: rgn)(amount, value, code, name)
invoices(id, salary, value, status)
Task: Retrieve id from regions with salary above the MAX(amount) of invoices rows sharing the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE salary > (
SELECT MAX(amount) FROM invoices AS inv
WHERE inv.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_00402 | train | T2 |
v1 | Schema:
managers (alias: mgr)(salary, value, status, date)
shipments(amount, value, name, type)
Task: Retrieve value from managers whose id is found in shipments rows where code matches the outer record.
SQL: | SELECT value FROM managers AS mgr
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_00403 | train | T1 |
v3 | Schema:
sales (alias: sale)(type, code, name, value)
accounts(date, name, id, value)
Task: Find amount from sales where salary exceeds the average value from accounts for the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE salary > (
SELECT COUNT(value) FROM accounts AS acct
WHERE acct.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_00404 | train | T1 |
v3 | Schema:
accounts (alias: acct)(type, status, date, salary)
managers(name, date, type, id)
Task: Retrieve code from accounts with value above the MIN(salary) of managers rows sharing the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE value > (
SELECT MIN(salary) FROM managers AS mgr
WHERE mgr.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_00405 | train | T1 |
v3 | Schema:
requests (alias: ordr)(type, value, salary, level)
categories(salary, code, level, status)
Task: Find value from requests where salary exceeds the average value from categories for the same id.
SQL: | SELECT value FROM requests AS ordr
WHERE salary > (
SELECT SUM(value) FROM categories AS catg
WHERE catg.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_00406 | train | T2 |
v1 | Schema:
categories (alias: catg)(salary, date, code, id)
requests(code, value, type, id)
Task: Retrieve name from categories whose id is found in requests rows where type matches the outer record.
SQL: | SELECT name FROM categories AS catg
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_00407 | train | T2 |
v2 | Schema:
regions (alias: rgn)(value, type, salary, level)
staff(status, value, name, code)
Task: Retrieve id from regions that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_00408 | train | T2 |
v1 | Schema:
schedules (alias: schd)(status, value, id, date)
items(id, value, status, amount)
Task: Retrieve code from schedules whose level is found in items rows where level matches the outer record.
SQL: | SELECT code FROM schedules AS schd
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_00409 | train | T2 |
v2 | Schema:
regions (alias: rgn)(date, status, salary, type)
orders(date, name, amount, type)
Task: Retrieve id from regions that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_00410 | train | T2 |
v2 | Schema:
shipments (alias: shp)(code, name, amount, type)
sales(amount, value, date, code)
Task: Find code from shipments where a matching record exists in sales with the same id.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_00411 | train | T2 |
v3 | Schema:
managers (alias: mgr)(value, id, status, name)
customers(name, amount, status, value)
Task: Retrieve salary from managers with value above the AVG(value) of customers rows sharing the same code.
SQL: | SELECT salary FROM managers AS mgr
WHERE value > (
SELECT AVG(value) FROM customers AS cust
WHERE cust.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_00412 | train | T1 |
v1 | Schema:
transactions (alias: txn)(level, amount, type, id)
schedules(amount, id, date, name)
Task: Select id from transactions where level exists in schedules for the same id.
SQL: | SELECT id FROM transactions AS txn
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_00413 | train | T1 |
v3 | Schema:
accounts (alias: acct)(level, status, salary, id)
services(value, level, code, status)
Task: Find code from accounts where salary exceeds the average amount from services for the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE salary > (
SELECT MAX(amount) FROM services AS srvc
WHERE srvc.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "services",
"outer_alias": "acct",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_00414 | train | T1 |
v3 | Schema:
budgets (alias: budg)(name, salary, id, code)
shipments(level, status, value, salary)
Task: Retrieve code from budgets with salary above the SUM(amount) of shipments rows sharing the same status.
SQL: | SELECT code FROM budgets AS budg
WHERE salary > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "shipments",
"outer_alias": "budg",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_00415 | train | T2 |
v1 | Schema:
accounts (alias: acct)(value, id, date, level)
shipments(status, id, salary, date)
Task: Find code from accounts where level appears in shipments entries with matching status.
SQL: | SELECT code FROM accounts AS acct
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_00416 | train | T1 |
v2 | Schema:
shipments (alias: shp)(id, level, code, value)
products(status, type, date, code)
Task: Find name from shipments where a matching record exists in products with the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_00417 | train | T2 |
v3 | Schema:
requests (alias: ordr)(amount, status, level, id)
warehouses(level, status, type, code)
Task: Find value from requests where salary exceeds the average value from warehouses for the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE salary > (
SELECT AVG(value) FROM warehouses AS whs
WHERE whs.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "warehouses",
"outer_alias": "ordr",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_00418 | train | T2 |
v1 | Schema:
accounts (alias: acct)(value, status, name, type)
invoices(type, name, salary, value)
Task: Retrieve value from accounts whose level is found in invoices rows where id matches the outer record.
SQL: | SELECT value FROM accounts AS acct
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_00419 | train | T1 |
v1 | Schema:
orders (alias: ord)(code, name, date, level)
customers(date, type, code, amount)
Task: Find value from orders where id appears in customers entries with matching id.
SQL: | SELECT value FROM orders AS ord
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_00420 | train | T1 |
v3 | Schema:
shipments (alias: shp)(amount, value, level, salary)
staff(type, date, level, id)
Task: Find amount from shipments where value exceeds the average value from staff for the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE value > (
SELECT SUM(value) FROM staff AS empl
WHERE empl.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_00421 | train | T2 |
v1 | Schema:
accounts (alias: acct)(level, type, id, salary)
shipments(status, date, type, name)
Task: Select name from accounts where code exists in shipments for the same id.
SQL: | SELECT name FROM accounts AS acct
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_00422 | train | T1 |
v2 | Schema:
departments (alias: dept)(salary, value, level, id)
employees(status, id, code, salary)
Task: Retrieve amount from departments that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_00423 | train | T1 |
v3 | Schema:
departments (alias: dept)(id, code, salary, type)
schedules(value, date, status, name)
Task: Find value from departments where amount exceeds the average salary from schedules for the same type.
SQL: | SELECT value FROM departments AS dept
WHERE amount > (
SELECT SUM(salary) FROM schedules AS schd
WHERE schd.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_00424 | train | T1 |
v2 | Schema:
departments (alias: dept)(code, date, amount, value)
schedules(amount, level, type, status)
Task: Find salary from departments where a matching record exists in schedules with the same code.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_00425 | train | T1 |
v1 | Schema:
shipments (alias: shp)(amount, id, salary, status)
accounts(value, name, level, type)
Task: Retrieve value from shipments whose type is found in accounts rows where status matches the outer record.
SQL: | SELECT value FROM shipments AS shp
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_00426 | train | T2 |
v2 | Schema:
requests (alias: ordr)(level, amount, type, salary)
accounts(amount, code, salary, id)
Task: Retrieve code from requests that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_00427 | train | T2 |
v1 | Schema:
sales (alias: sale)(level, date, name, value)
orders(salary, amount, id, type)
Task: Find name from sales where level appears in orders entries with matching status.
SQL: | SELECT name FROM sales AS sale
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_00428 | train | T1 |
v1 | Schema:
budgets (alias: budg)(amount, code, status, level)
regions(id, code, type, status)
Task: Find name from budgets where level appears in regions entries with matching code.
SQL: | SELECT name FROM budgets AS budg
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "regions",
"outer_alias": "budg",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_00429 | train | T2 |
v3 | Schema:
departments (alias: dept)(id, code, amount, type)
transactions(date, salary, id, name)
Task: Find id from departments where amount exceeds the average amount from transactions for the same code.
SQL: | SELECT id FROM departments AS dept
WHERE amount > (
SELECT MAX(amount) FROM transactions AS txn
WHERE txn.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_00430 | train | T1 |
v1 | Schema:
invoices (alias: inv)(status, salary, amount, value)
items(level, code, type, status)
Task: Select code from invoices where status exists in items for the same id.
SQL: | SELECT code FROM invoices AS inv
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_00431 | train | T1 |
v3 | Schema:
categories (alias: catg)(code, salary, level, value)
regions(date, status, salary, id)
Task: Retrieve id from categories with amount above the MAX(salary) of regions rows sharing the same level.
SQL: | SELECT id FROM categories AS catg
WHERE amount > (
SELECT MAX(salary) FROM regions AS rgn
WHERE rgn.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_00432 | train | T2 |
v2 | Schema:
accounts (alias: acct)(type, value, id, level)
categories(salary, level, amount, name)
Task: Retrieve code from accounts that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_00433 | train | T1 |
v1 | Schema:
invoices (alias: inv)(status, value, type, code)
staff(amount, value, id, salary)
Task: Retrieve name from invoices whose id is found in staff rows where level matches the outer record.
SQL: | SELECT name FROM invoices AS inv
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_00434 | train | T1 |
v1 | Schema:
products (alias: prod)(type, date, status, amount)
employees(status, level, amount, code)
Task: Retrieve id from products whose status is found in employees rows where status matches the outer record.
SQL: | SELECT id FROM products AS prod
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.status = prod.status
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_00435 | train | T1 |
v2 | Schema:
orders (alias: ord)(level, name, type, salary)
customers(type, value, status, id)
Task: Retrieve code from orders that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_00436 | train | T1 |
v2 | Schema:
invoices (alias: inv)(amount, status, type, value)
products(name, id, status, amount)
Task: Retrieve id from invoices that have at least one corresponding entry in products sharing the same code.
SQL: | SELECT id 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": "id",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_00437 | train | T1 |
v3 | Schema:
requests (alias: ordr)(value, type, level, code)
items(salary, type, value, code)
Task: Find code from requests where value exceeds the average amount from items for the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE value > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_00438 | train | T2 |
v1 | Schema:
services (alias: srvc)(code, amount, date, id)
regions(salary, type, value, date)
Task: Retrieve value from services whose type is found in regions rows where status matches the outer record.
SQL: | SELECT value FROM services AS srvc
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "regions",
"outer_alias": "srvc",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_00439 | train | T2 |
v1 | Schema:
budgets (alias: budg)(level, id, value, code)
transactions(date, salary, level, status)
Task: Select id from budgets where id exists in transactions for the same type.
SQL: | SELECT id FROM budgets AS budg
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "transactions",
"outer_alias": "budg",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_00440 | train | T2 |
v2 | Schema:
categories (alias: catg)(status, id, salary, amount)
shipments(name, status, type, id)
Task: Find amount from categories where a matching record exists in shipments with the same type.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_00441 | train | T2 |
v3 | Schema:
customers (alias: cust)(status, level, code, value)
employees(id, name, amount, date)
Task: Retrieve salary from customers with salary above the COUNT(amount) of employees rows sharing the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE salary > (
SELECT COUNT(amount) FROM employees AS emp
WHERE emp.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_00442 | train | T1 |
v2 | Schema:
categories (alias: catg)(value, date, code, type)
invoices(amount, level, salary, id)
Task: Find id from categories where a matching record exists in invoices with the same status.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_00443 | train | T2 |
v2 | Schema:
employees (alias: emp)(value, amount, level, date)
categories(code, id, value, type)
Task: Retrieve name from employees that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_00444 | train | T1 |
v2 | Schema:
employees (alias: emp)(status, code, name, value)
warehouses(date, value, type, status)
Task: Find name from employees where a matching record exists in warehouses with the same status.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "warehouses",
"outer_alias": "emp",
"inner_alias": "whs",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_00445 | train | T1 |
v2 | Schema:
shipments (alias: shp)(level, value, code, name)
warehouses(salary, value, status, code)
Task: Find name from shipments where a matching record exists in warehouses with the same level.
SQL: | SELECT name 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": "name",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_00446 | train | T2 |
v3 | Schema:
regions (alias: rgn)(status, type, salary, id)
departments(amount, salary, date, status)
Task: Retrieve salary from regions with amount above the MIN(value) of departments rows sharing the same status.
SQL: | SELECT salary FROM regions AS rgn
WHERE amount > (
SELECT MIN(value) FROM departments AS dept
WHERE dept.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_00447 | train | T2 |
v1 | Schema:
requests (alias: ordr)(level, status, amount, name)
transactions(name, value, status, salary)
Task: Select amount from requests where level exists in transactions for the same type.
SQL: | SELECT amount FROM requests AS ordr
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_00448 | train | T2 |
v1 | Schema:
orders (alias: ord)(salary, name, status, amount)
departments(value, type, date, id)
Task: Select name from orders where status exists in departments for the same type.
SQL: | SELECT name FROM orders AS ord
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_00449 | train | T1 |
v3 | Schema:
accounts (alias: acct)(value, salary, level, amount)
employees(salary, id, level, date)
Task: Retrieve code from accounts with salary above the MAX(value) of employees rows sharing the same status.
SQL: | SELECT code FROM accounts AS acct
WHERE salary > (
SELECT MAX(value) FROM employees AS emp
WHERE emp.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_00450 | train | T1 |
v3 | Schema:
accounts (alias: acct)(name, date, id, salary)
schedules(name, level, amount, type)
Task: Retrieve id from accounts with salary above the MIN(salary) of schedules rows sharing the same id.
SQL: | SELECT id FROM accounts AS acct
WHERE salary > (
SELECT MIN(salary) FROM schedules AS schd
WHERE schd.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_00451 | train | T1 |
v2 | Schema:
regions (alias: rgn)(date, level, amount, type)
orders(type, id, name, level)
Task: Retrieve id from regions that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_00452 | train | T2 |
v1 | Schema:
products (alias: prod)(value, name, amount, salary)
staff(value, salary, id, code)
Task: Find code from products where status appears in staff entries with matching code.
SQL: | SELECT code FROM products AS prod
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.code = prod.code
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_00453 | train | T1 |
v3 | Schema:
managers (alias: mgr)(level, type, amount, status)
accounts(amount, date, type, status)
Task: Find id from managers where amount exceeds the average amount from accounts for the same type.
SQL: | SELECT id FROM managers AS mgr
WHERE amount > (
SELECT MAX(amount) FROM accounts AS acct
WHERE acct.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_00454 | train | T1 |
v3 | Schema:
employees (alias: emp)(amount, type, value, name)
orders(amount, id, name, level)
Task: Retrieve salary from employees with value above the MAX(value) of orders rows sharing the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE value > (
SELECT MAX(value) FROM orders AS ord
WHERE ord.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_00455 | train | T1 |
v1 | Schema:
items (alias: lne)(status, code, date, level)
invoices(value, status, salary, type)
Task: Find value from items where id appears in invoices entries with matching code.
SQL: | SELECT value FROM items AS lne
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.code = lne.code
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_00456 | train | T2 |
v1 | Schema:
regions (alias: rgn)(type, level, date, value)
accounts(type, amount, salary, code)
Task: Select id from regions where status exists in accounts for the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_00457 | train | T2 |
v2 | Schema:
regions (alias: rgn)(salary, status, name, date)
schedules(name, value, code, level)
Task: Retrieve code from regions that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_00458 | train | T2 |
v1 | Schema:
managers (alias: mgr)(id, type, code, date)
requests(code, amount, salary, id)
Task: Find code from managers where code appears in requests entries with matching status.
SQL: | SELECT code FROM managers AS mgr
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_00459 | train | T1 |
v1 | Schema:
services (alias: srvc)(value, level, type, name)
categories(amount, date, salary, id)
Task: Retrieve salary from services whose status is found in categories rows where status matches the outer record.
SQL: | SELECT salary FROM services AS srvc
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "categories",
"outer_alias": "srvc",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_00460 | train | T2 |
v1 | Schema:
items (alias: lne)(level, status, name, id)
invoices(status, salary, id, value)
Task: Find code from items where status appears in invoices entries with matching level.
SQL: | SELECT code FROM items AS lne
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.level = lne.level
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_00461 | train | T2 |
v3 | Schema:
managers (alias: mgr)(level, code, type, value)
staff(value, level, id, date)
Task: Find name from managers where value exceeds the average value from staff for the same level.
SQL: | SELECT name FROM managers AS mgr
WHERE value > (
SELECT COUNT(value) FROM staff AS empl
WHERE empl.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_00462 | train | T1 |
v1 | Schema:
schedules (alias: schd)(id, level, value, code)
managers(status, code, name, salary)
Task: Retrieve id from schedules whose id is found in managers rows where status matches the outer record.
SQL: | SELECT id FROM schedules AS schd
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_00463 | train | T2 |
v3 | Schema:
items (alias: lne)(status, salary, id, value)
regions(value, date, id, code)
Task: Find amount from items where amount exceeds the average amount from regions for the same type.
SQL: | SELECT amount FROM items AS lne
WHERE amount > (
SELECT MIN(amount) FROM regions AS rgn
WHERE rgn.type = lne.type
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_00464 | train | T2 |
v3 | Schema:
schedules (alias: schd)(status, amount, id, name)
accounts(type, name, salary, amount)
Task: Find value from schedules where value exceeds the average value from accounts for the same id.
SQL: | SELECT value FROM schedules AS schd
WHERE value > (
SELECT MIN(value) FROM accounts AS acct
WHERE acct.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_00465 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(amount, status, id, level)
categories(amount, type, level, name)
Task: Find name from warehouses where a matching record exists in categories with the same code.
SQL: | SELECT name FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "categories",
"outer_alias": "whs",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_00466 | train | T2 |
v1 | Schema:
products (alias: prod)(type, value, amount, salary)
schedules(value, salary, type, id)
Task: Select code from products where status exists in schedules for the same id.
SQL: | SELECT code FROM products AS prod
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.id = prod.id
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_00467 | train | T1 |
v3 | Schema:
schedules (alias: schd)(name, salary, level, code)
shipments(salary, date, code, name)
Task: Retrieve name from schedules with value above the MAX(amount) of shipments rows sharing the same type.
SQL: | SELECT name FROM schedules AS schd
WHERE value > (
SELECT MAX(amount) FROM shipments AS shp
WHERE shp.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_00468 | train | T2 |
v2 | Schema:
schedules (alias: schd)(salary, level, date, value)
shipments(amount, status, value, name)
Task: Find value from schedules where a matching record exists in shipments with the same id.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_00469 | train | T2 |
v1 | Schema:
departments (alias: dept)(value, level, amount, id)
warehouses(level, salary, value, date)
Task: Retrieve id from departments whose code is found in warehouses rows where code matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE code IN (
SELECT code FROM warehouses AS whs
WHERE whs.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "warehouses",
"outer_alias": "dept",
"inner_alias": "whs",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_00470 | train | T1 |
v2 | Schema:
budgets (alias: budg)(date, id, code, type)
requests(date, salary, status, value)
Task: Find salary from budgets where a matching record exists in requests with the same type.
SQL: | SELECT salary FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "requests",
"outer_alias": "budg",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_00471 | train | T2 |
v1 | Schema:
customers (alias: cust)(date, salary, value, code)
departments(level, name, salary, date)
Task: Retrieve value from customers whose level is found in departments rows where type matches the outer record.
SQL: | SELECT value FROM customers AS cust
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_00472 | train | T1 |
v3 | Schema:
items (alias: lne)(level, status, code, name)
departments(id, type, name, status)
Task: Find id from items where amount exceeds the average amount from departments for the same level.
SQL: | SELECT id FROM items AS lne
WHERE amount > (
SELECT MIN(amount) FROM departments AS dept
WHERE dept.level = lne.level
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_00473 | train | T2 |
v1 | Schema:
invoices (alias: inv)(salary, value, name, date)
categories(date, amount, code, id)
Task: Find id from invoices where type appears in categories entries with matching status.
SQL: | SELECT id FROM invoices AS inv
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_00474 | train | T1 |
v1 | Schema:
budgets (alias: budg)(id, name, date, type)
managers(salary, type, id, code)
Task: Select id from budgets where type exists in managers for the same code.
SQL: | SELECT id FROM budgets AS budg
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "managers",
"outer_alias": "budg",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_00475 | train | T2 |
v1 | Schema:
requests (alias: ordr)(salary, level, type, code)
warehouses(value, status, name, id)
Task: Select code from requests where level exists in warehouses for the same status.
SQL: | SELECT code FROM requests AS ordr
WHERE level IN (
SELECT level FROM warehouses AS whs
WHERE whs.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "warehouses",
"outer_alias": "ordr",
"inner_alias": "whs",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_00476 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(date, level, name, amount)
budgets(value, name, status, date)
Task: Find code from warehouses where a matching record exists in budgets with the same type.
SQL: | SELECT code FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "budgets",
"outer_alias": "whs",
"inner_alias": "budg",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_00477 | train | T2 |
v3 | Schema:
items (alias: lne)(date, value, status, amount)
employees(level, date, name, id)
Task: Find value from items where value exceeds the average value from employees for the same id.
SQL: | SELECT value FROM items AS lne
WHERE value > (
SELECT MAX(value) FROM employees AS emp
WHERE emp.id = lne.id
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_00478 | train | T2 |
v2 | Schema:
sales (alias: sale)(code, amount, status, salary)
warehouses(level, type, id, date)
Task: Retrieve code from sales that have at least one corresponding entry in warehouses sharing the same code.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "warehouses",
"outer_alias": "sale",
"inner_alias": "whs",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_00479 | train | T1 |
v2 | Schema:
orders (alias: ord)(salary, code, type, value)
invoices(type, salary, level, amount)
Task: Find value from orders where a matching record exists in invoices with the same level.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_00480 | train | T1 |
v3 | Schema:
services (alias: srvc)(value, name, id, level)
warehouses(status, amount, salary, type)
Task: Retrieve value from services with amount above the COUNT(amount) of warehouses rows sharing the same type.
SQL: | SELECT value FROM services AS srvc
WHERE amount > (
SELECT COUNT(amount) FROM warehouses AS whs
WHERE whs.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "warehouses",
"outer_alias": "srvc",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_00481 | train | T2 |
v3 | Schema:
budgets (alias: budg)(value, name, type, level)
regions(status, type, salary, id)
Task: Retrieve salary from budgets with amount above the MAX(value) of regions rows sharing the same id.
SQL: | SELECT salary FROM budgets AS budg
WHERE amount > (
SELECT MAX(value) FROM regions AS rgn
WHERE rgn.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "regions",
"outer_alias": "budg",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_00482 | train | T2 |
v2 | Schema:
invoices (alias: inv)(code, name, value, amount)
departments(code, status, level, type)
Task: Find amount from invoices where a matching record exists in departments with the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_00483 | train | T1 |
v2 | Schema:
employees (alias: emp)(status, amount, value, code)
managers(value, salary, type, level)
Task: Retrieve id from employees that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_00484 | train | T1 |
v2 | Schema:
items (alias: lne)(level, value, type, date)
budgets(name, id, code, type)
Task: Retrieve value from items that have at least one corresponding entry in budgets sharing the same level.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.level = lne.level
); | {
"outer_table": "items",
"inner_table": "budgets",
"outer_alias": "lne",
"inner_alias": "budg",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_00485 | train | T2 |
v3 | Schema:
orders (alias: ord)(type, id, salary, status)
departments(salary, level, type, id)
Task: Find amount from orders where amount exceeds the average salary from departments for the same type.
SQL: | SELECT amount FROM orders AS ord
WHERE amount > (
SELECT AVG(salary) FROM departments AS dept
WHERE dept.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_00486 | train | T1 |
v3 | Schema:
regions (alias: rgn)(date, code, level, status)
items(id, type, amount, name)
Task: Find name from regions where salary exceeds the average amount from items for the same code.
SQL: | SELECT name FROM regions AS rgn
WHERE salary > (
SELECT COUNT(amount) FROM items AS lne
WHERE lne.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_00487 | train | T2 |
v1 | Schema:
transactions (alias: txn)(date, type, value, salary)
budgets(date, value, amount, id)
Task: Retrieve salary from transactions whose status is found in budgets rows where type matches the outer record.
SQL: | SELECT salary FROM transactions AS txn
WHERE status IN (
SELECT status FROM budgets AS budg
WHERE budg.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "budgets",
"outer_alias": "txn",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_00488 | train | T1 |
v3 | Schema:
products (alias: prod)(date, salary, status, amount)
employees(date, type, status, level)
Task: Retrieve value from products with value above the COUNT(value) of employees rows sharing the same code.
SQL: | SELECT value FROM products AS prod
WHERE value > (
SELECT COUNT(value) FROM employees AS emp
WHERE emp.code = prod.code
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_00489 | train | T1 |
v2 | Schema:
managers (alias: mgr)(level, value, status, salary)
employees(date, status, id, value)
Task: Find value from managers where a matching record exists in employees with the same id.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_00490 | train | T1 |
v3 | Schema:
transactions (alias: txn)(type, code, id, level)
managers(date, salary, id, level)
Task: Find id from transactions where value exceeds the average value from managers for the same id.
SQL: | SELECT id FROM transactions AS txn
WHERE value > (
SELECT MAX(value) FROM managers AS mgr
WHERE mgr.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_00491 | train | T1 |
v2 | Schema:
requests (alias: ordr)(amount, name, id, code)
employees(level, date, type, status)
Task: Retrieve id from requests that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_00492 | train | T2 |
v3 | Schema:
requests (alias: ordr)(code, status, level, date)
items(name, date, amount, salary)
Task: Retrieve amount from requests with salary above the MIN(value) of items rows sharing the same status.
SQL: | SELECT amount FROM requests AS ordr
WHERE salary > (
SELECT MIN(value) FROM items AS lne
WHERE lne.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_00493 | train | T2 |
v3 | Schema:
regions (alias: rgn)(id, value, name, amount)
items(level, status, id, amount)
Task: Find amount from regions where amount exceeds the average salary from items for the same id.
SQL: | SELECT amount FROM regions AS rgn
WHERE amount > (
SELECT MAX(salary) FROM items AS lne
WHERE lne.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_00494 | train | T2 |
v2 | Schema:
products (alias: prod)(level, value, status, date)
regions(amount, type, date, value)
Task: Retrieve amount from products that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = prod.id
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_00495 | train | T1 |
v2 | Schema:
categories (alias: catg)(type, status, level, code)
shipments(status, id, type, salary)
Task: Find name from categories where a matching record exists in shipments with the same code.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_00496 | train | T2 |
v1 | Schema:
departments (alias: dept)(name, value, date, salary)
requests(date, id, type, level)
Task: Retrieve salary from departments whose status is found in requests rows where id matches the outer record.
SQL: | SELECT salary FROM departments AS dept
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_00497 | train | T1 |
v2 | Schema:
sales (alias: sale)(level, id, amount, date)
items(date, level, salary, code)
Task: Retrieve amount from sales that have at least one corresponding entry in items sharing the same code.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_00498 | train | T1 |
v1 | Schema:
categories (alias: catg)(status, id, amount, code)
services(status, id, amount, type)
Task: Retrieve id from categories whose code is found in services rows where level matches the outer record.
SQL: | SELECT id FROM categories AS catg
WHERE code IN (
SELECT code FROM services AS srvc
WHERE srvc.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "services",
"outer_alias": "catg",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_00499 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.