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:
warehouses (alias: whs)(status, date, id, amount)
invoices(id, level, type, salary)
Task: Retrieve name from warehouses whose status is found in invoices rows where code matches the outer record.
SQL: | SELECT name FROM warehouses AS whs
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "invoices",
"outer_alias": "whs",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_03500 | train | T2 |
v2 | Schema:
invoices (alias: inv)(name, value, date, amount)
products(status, date, name, type)
Task: Retrieve name from invoices that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_03501 | train | T1 |
v2 | Schema:
items (alias: lne)(value, code, level, type)
orders(level, date, name, value)
Task: Retrieve salary from items that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = lne.code
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_03502 | train | T2 |
v3 | Schema:
sales (alias: sale)(id, salary, value, amount)
services(value, type, id, name)
Task: Find salary from sales where salary exceeds the average salary from services for the same type.
SQL: | SELECT salary FROM sales AS sale
WHERE salary > (
SELECT COUNT(salary) FROM services AS srvc
WHERE srvc.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "services",
"outer_alias": "sale",
"inner_alias": "srvc",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_03503 | train | T1 |
v3 | Schema:
regions (alias: rgn)(amount, type, status, name)
accounts(name, value, id, date)
Task: Find id from regions where amount exceeds the average value from accounts for the same type.
SQL: | SELECT id FROM regions AS rgn
WHERE amount > (
SELECT MIN(value) FROM accounts AS acct
WHERE acct.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_03504 | train | T2 |
v2 | Schema:
schedules (alias: schd)(id, code, date, salary)
orders(type, code, date, amount)
Task: Find value from schedules where a matching record exists in orders with the same level.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_03505 | train | T2 |
v3 | Schema:
requests (alias: ordr)(name, id, status, code)
services(type, value, salary, date)
Task: Find id from requests where amount exceeds the average salary from services for the same level.
SQL: | SELECT id FROM requests AS ordr
WHERE amount > (
SELECT SUM(salary) FROM services AS srvc
WHERE srvc.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "services",
"outer_alias": "ordr",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_03506 | train | T2 |
v1 | Schema:
shipments (alias: shp)(name, status, amount, code)
services(name, amount, date, status)
Task: Find salary from shipments where level appears in services entries with matching code.
SQL: | SELECT salary FROM shipments AS shp
WHERE level IN (
SELECT level FROM services AS srvc
WHERE srvc.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "services",
"outer_alias": "shp",
"inner_alias": "srvc",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_03507 | train | T2 |
v1 | Schema:
budgets (alias: budg)(status, code, name, level)
regions(code, amount, id, level)
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_03508 | train | T2 |
v2 | Schema:
transactions (alias: txn)(status, id, amount, salary)
staff(id, name, level, code)
Task: Find amount from transactions where a matching record exists in staff with the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_03509 | train | T1 |
v2 | Schema:
requests (alias: ordr)(status, level, name, code)
staff(code, id, value, name)
Task: Find salary from requests where a matching record exists in staff with the same level.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_03510 | train | T2 |
v3 | Schema:
items (alias: lne)(value, id, status, name)
requests(status, level, salary, type)
Task: Retrieve name from items with value above the MAX(salary) of requests rows sharing the same code.
SQL: | SELECT name FROM items AS lne
WHERE value > (
SELECT MAX(salary) FROM requests AS ordr
WHERE ordr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_03511 | train | T2 |
v2 | Schema:
shipments (alias: shp)(amount, id, name, code)
categories(code, type, status, amount)
Task: Retrieve code from shipments that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_03512 | train | T2 |
v1 | Schema:
shipments (alias: shp)(level, value, salary, date)
invoices(date, status, amount, name)
Task: Retrieve salary from shipments whose type is found in invoices rows where id matches the outer record.
SQL: | SELECT salary FROM shipments AS shp
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_03513 | train | T2 |
v1 | Schema:
orders (alias: ord)(status, code, type, id)
items(type, value, status, name)
Task: Select value from orders where code exists in items for the same code.
SQL: | SELECT value FROM orders AS ord
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_03514 | train | T1 |
v2 | Schema:
shipments (alias: shp)(name, level, code, amount)
items(code, salary, id, type)
Task: Retrieve amount from shipments that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_03515 | train | T2 |
v1 | Schema:
requests (alias: ordr)(id, amount, value, level)
items(name, status, amount, type)
Task: Retrieve salary from requests whose id is found in items rows where level matches the outer record.
SQL: | SELECT salary FROM requests AS ordr
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_03516 | train | T2 |
v3 | Schema:
categories (alias: catg)(id, code, salary, amount)
transactions(date, name, amount, type)
Task: Retrieve name from categories with value above the COUNT(salary) of transactions rows sharing the same id.
SQL: | SELECT name FROM categories AS catg
WHERE value > (
SELECT COUNT(salary) FROM transactions AS txn
WHERE txn.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_03517 | train | T2 |
v1 | Schema:
products (alias: prod)(value, amount, code, status)
shipments(level, amount, status, type)
Task: Find value from products where type appears in shipments entries with matching status.
SQL: | SELECT value FROM products AS prod
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.status = prod.status
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_03518 | train | T1 |
v1 | Schema:
staff (alias: empl)(id, salary, date, value)
orders(type, code, status, value)
Task: Find name from staff where id appears in orders entries with matching code.
SQL: | SELECT name FROM staff AS empl
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_03519 | train | T2 |
v2 | Schema:
transactions (alias: txn)(level, date, code, salary)
staff(type, level, status, date)
Task: Retrieve amount from transactions that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_03520 | train | T1 |
v2 | Schema:
transactions (alias: txn)(id, name, status, type)
accounts(code, name, status, id)
Task: Find code from transactions where a matching record exists in accounts with the same id.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_03521 | train | T1 |
v1 | Schema:
items (alias: lne)(value, id, date, status)
employees(value, code, date, status)
Task: Find name from items where type appears in employees entries with matching id.
SQL: | SELECT name FROM items AS lne
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.id = lne.id
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_03522 | train | T2 |
v3 | Schema:
services (alias: srvc)(name, status, amount, code)
requests(salary, level, amount, value)
Task: Retrieve id from services with amount above the SUM(amount) of requests rows sharing the same type.
SQL: | SELECT id FROM services AS srvc
WHERE amount > (
SELECT SUM(amount) FROM requests AS ordr
WHERE ordr.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "requests",
"outer_alias": "srvc",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_03523 | train | T2 |
v2 | Schema:
shipments (alias: shp)(code, type, value, name)
staff(status, level, salary, date)
Task: Find value from shipments where a matching record exists in staff with the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_03524 | train | T2 |
v1 | Schema:
customers (alias: cust)(id, name, status, value)
transactions(code, name, id, date)
Task: Retrieve code from customers whose level is found in transactions rows where code matches the outer record.
SQL: | SELECT code FROM customers AS cust
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_03525 | train | T1 |
v2 | Schema:
requests (alias: ordr)(date, id, status, value)
invoices(code, status, level, amount)
Task: Find code from requests where a matching record exists in invoices with the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_03526 | train | T2 |
v2 | Schema:
requests (alias: ordr)(date, code, id, name)
accounts(salary, type, amount, code)
Task: Retrieve value from requests that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT value 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": "value",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_03527 | train | T2 |
v2 | Schema:
services (alias: srvc)(level, code, value, name)
warehouses(value, salary, date, type)
Task: Find name from services where a matching record exists in warehouses with the same type.
SQL: | SELECT name FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "warehouses",
"outer_alias": "srvc",
"inner_alias": "whs",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_03528 | train | T2 |
v3 | Schema:
accounts (alias: acct)(level, id, type, date)
staff(id, name, type, salary)
Task: Find amount from accounts where amount exceeds the average salary from staff for the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE amount > (
SELECT COUNT(salary) FROM staff AS empl
WHERE empl.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_03529 | train | T1 |
v2 | Schema:
customers (alias: cust)(amount, id, code, value)
budgets(date, id, type, name)
Task: Retrieve id from customers that have at least one corresponding entry in budgets sharing the same level.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "budgets",
"outer_alias": "cust",
"inner_alias": "budg",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_03530 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(salary, value, status, amount)
regions(date, salary, type, level)
Task: Find name from warehouses where amount exceeds the average value from regions for the same type.
SQL: | SELECT name FROM warehouses AS whs
WHERE amount > (
SELECT MAX(value) FROM regions AS rgn
WHERE rgn.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "regions",
"outer_alias": "whs",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_03531 | train | T2 |
v2 | Schema:
orders (alias: ord)(code, salary, status, level)
schedules(date, amount, salary, type)
Task: Retrieve value from orders that have at least one corresponding entry in schedules sharing the same status.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_03532 | train | T1 |
v1 | Schema:
requests (alias: ordr)(value, code, level, date)
budgets(salary, code, value, date)
Task: Find code from requests where type appears in budgets entries with matching status.
SQL: | SELECT code FROM requests AS ordr
WHERE type IN (
SELECT type FROM budgets AS budg
WHERE budg.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "budgets",
"outer_alias": "ordr",
"inner_alias": "budg",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_03533 | train | T2 |
v2 | Schema:
transactions (alias: txn)(status, type, id, value)
schedules(name, value, salary, id)
Task: Find value from transactions where a matching record exists in schedules with the same type.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_03534 | train | T1 |
v3 | Schema:
items (alias: lne)(date, value, amount, id)
transactions(id, code, type, level)
Task: Retrieve code from items with amount above the MIN(value) of transactions rows sharing the same code.
SQL: | SELECT code FROM items AS lne
WHERE amount > (
SELECT MIN(value) FROM transactions AS txn
WHERE txn.code = lne.code
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_03535 | train | T2 |
v1 | Schema:
sales (alias: sale)(type, salary, id, date)
employees(date, name, amount, salary)
Task: Retrieve value from sales whose status is found in employees rows where type matches the outer record.
SQL: | SELECT value FROM sales AS sale
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_03536 | train | T1 |
v3 | Schema:
invoices (alias: inv)(value, name, id, amount)
transactions(salary, code, value, level)
Task: Retrieve salary from invoices with value above the AVG(value) of transactions rows sharing the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE value > (
SELECT AVG(value) FROM transactions AS txn
WHERE txn.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_03537 | train | T1 |
v3 | Schema:
customers (alias: cust)(name, id, amount, salary)
accounts(level, salary, type, value)
Task: Find code from customers where amount exceeds the average amount from accounts for the same id.
SQL: | SELECT code FROM customers AS cust
WHERE amount > (
SELECT MAX(amount) FROM accounts AS acct
WHERE acct.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_03538 | train | T1 |
v3 | Schema:
budgets (alias: budg)(name, code, status, type)
staff(name, id, date, salary)
Task: Find name from budgets where value exceeds the average value from staff for the same id.
SQL: | SELECT name FROM budgets AS budg
WHERE value > (
SELECT SUM(value) FROM staff AS empl
WHERE empl.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "staff",
"outer_alias": "budg",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_03539 | train | T2 |
v3 | Schema:
departments (alias: dept)(type, value, level, id)
products(type, value, level, code)
Task: Find name from departments where amount exceeds the average amount from products for the same status.
SQL: | SELECT name FROM departments AS dept
WHERE amount > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_03540 | train | T1 |
v3 | Schema:
departments (alias: dept)(amount, level, id, type)
transactions(salary, id, amount, date)
Task: Retrieve name from departments with value above the MAX(value) of transactions rows sharing the same level.
SQL: | SELECT name FROM departments AS dept
WHERE value > (
SELECT MAX(value) FROM transactions AS txn
WHERE txn.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_03541 | train | T1 |
v3 | Schema:
products (alias: prod)(name, type, id, date)
regions(salary, status, date, value)
Task: Retrieve name from products with amount above the AVG(value) of regions rows sharing the same id.
SQL: | SELECT name FROM products AS prod
WHERE amount > (
SELECT AVG(value) FROM regions AS rgn
WHERE rgn.id = prod.id
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_03542 | train | T1 |
v3 | Schema:
managers (alias: mgr)(type, status, amount, level)
staff(value, date, id, status)
Task: Find salary from managers where value exceeds the average value from staff for the same level.
SQL: | SELECT salary FROM managers AS mgr
WHERE value > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_03543 | train | T1 |
v2 | Schema:
staff (alias: empl)(salary, amount, code, level)
warehouses(value, status, level, salary)
Task: Retrieve code from staff that have at least one corresponding entry in warehouses sharing the same status.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "warehouses",
"outer_alias": "empl",
"inner_alias": "whs",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_03544 | train | T2 |
v1 | Schema:
schedules (alias: schd)(id, amount, level, date)
requests(id, level, date, status)
Task: Retrieve id from schedules whose status is found in requests rows where code matches the outer record.
SQL: | SELECT id FROM schedules AS schd
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_03545 | train | T2 |
v3 | Schema:
managers (alias: mgr)(value, date, code, amount)
regions(type, amount, name, status)
Task: Find id from managers where amount exceeds the average salary from regions for the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE amount > (
SELECT SUM(salary) FROM regions AS rgn
WHERE rgn.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_03546 | train | T1 |
v1 | Schema:
departments (alias: dept)(amount, salary, level, date)
categories(amount, id, type, status)
Task: Find id from departments where status appears in categories entries with matching id.
SQL: | SELECT id FROM departments AS dept
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_03547 | train | T1 |
v1 | Schema:
categories (alias: catg)(status, type, salary, value)
products(name, date, value, salary)
Task: Retrieve id from categories whose status is found in products rows where code matches the outer record.
SQL: | SELECT id FROM categories AS catg
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_03548 | train | T2 |
v1 | Schema:
budgets (alias: budg)(code, date, salary, id)
sales(status, type, date, name)
Task: Find salary from budgets where status appears in sales entries with matching type.
SQL: | SELECT salary FROM budgets AS budg
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "sales",
"outer_alias": "budg",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_03549 | train | T2 |
v3 | Schema:
items (alias: lne)(value, level, type, status)
managers(salary, code, status, type)
Task: Retrieve value from items with value above the MIN(value) of managers rows sharing the same status.
SQL: | SELECT value FROM items AS lne
WHERE value > (
SELECT MIN(value) FROM managers AS mgr
WHERE mgr.status = lne.status
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_03550 | train | T2 |
v3 | Schema:
customers (alias: cust)(value, level, salary, amount)
managers(salary, name, date, value)
Task: Retrieve id from customers with salary above the AVG(salary) of managers rows sharing the same type.
SQL: | SELECT id FROM customers AS cust
WHERE salary > (
SELECT AVG(salary) FROM managers AS mgr
WHERE mgr.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_03551 | train | T1 |
v3 | Schema:
departments (alias: dept)(status, value, code, salary)
products(name, level, status, value)
Task: Find amount from departments where salary exceeds the average amount from products for the same level.
SQL: | SELECT amount FROM departments AS dept
WHERE salary > (
SELECT AVG(amount) FROM products AS prod
WHERE prod.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_03552 | train | T1 |
v1 | Schema:
shipments (alias: shp)(status, date, amount, type)
customers(level, type, name, date)
Task: Retrieve salary from shipments whose code is found in customers rows where status matches the outer record.
SQL: | SELECT salary FROM shipments AS shp
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_03553 | train | T2 |
v3 | Schema:
employees (alias: emp)(value, level, salary, status)
staff(name, status, value, salary)
Task: Find id from employees where amount exceeds the average amount from staff for the same code.
SQL: | SELECT id FROM employees AS emp
WHERE amount > (
SELECT AVG(amount) FROM staff AS empl
WHERE empl.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_03554 | train | T1 |
v2 | Schema:
requests (alias: ordr)(id, date, status, code)
schedules(value, level, salary, name)
Task: Retrieve code from requests that have at least one corresponding entry in schedules sharing the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_03555 | train | T2 |
v1 | Schema:
shipments (alias: shp)(status, date, id, level)
managers(value, status, code, amount)
Task: Retrieve name from shipments whose id is found in managers rows where code matches the outer record.
SQL: | SELECT name FROM shipments AS shp
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_03556 | train | T2 |
v3 | Schema:
shipments (alias: shp)(id, date, status, salary)
accounts(code, salary, type, amount)
Task: Find salary from shipments where value exceeds the average salary from accounts for the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE value > (
SELECT MIN(salary) FROM accounts AS acct
WHERE acct.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_03557 | train | T2 |
v1 | Schema:
customers (alias: cust)(code, salary, amount, value)
categories(status, level, type, value)
Task: Retrieve id from customers whose status is found in categories rows where id matches the outer record.
SQL: | SELECT id FROM customers AS cust
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_03558 | train | T1 |
v1 | Schema:
services (alias: srvc)(type, level, status, amount)
managers(value, level, amount, salary)
Task: Select code from services where type exists in managers for the same code.
SQL: | SELECT code FROM services AS srvc
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "managers",
"outer_alias": "srvc",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_03559 | train | T2 |
v3 | Schema:
categories (alias: catg)(date, id, name, type)
accounts(date, value, code, id)
Task: Find salary from categories where salary exceeds the average amount from accounts for the same status.
SQL: | SELECT salary FROM categories AS catg
WHERE salary > (
SELECT MIN(amount) FROM accounts AS acct
WHERE acct.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_03560 | train | T2 |
v3 | Schema:
transactions (alias: txn)(id, level, date, salary)
customers(amount, value, date, name)
Task: Find salary from transactions where amount exceeds the average value from customers for the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE amount > (
SELECT MIN(value) FROM customers AS cust
WHERE cust.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_03561 | train | T1 |
v2 | Schema:
shipments (alias: shp)(value, date, amount, level)
regions(level, date, type, code)
Task: Find name from shipments where a matching record exists in regions with the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_03562 | train | T2 |
v1 | Schema:
budgets (alias: budg)(code, status, amount, value)
accounts(level, date, amount, code)
Task: Retrieve amount from budgets whose status is found in accounts rows where id matches the outer record.
SQL: | SELECT amount FROM budgets AS budg
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "accounts",
"outer_alias": "budg",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_03563 | train | T2 |
v3 | Schema:
customers (alias: cust)(salary, date, code, level)
budgets(value, level, date, amount)
Task: Find salary from customers where salary exceeds the average salary from budgets for the same id.
SQL: | SELECT salary FROM customers AS cust
WHERE salary > (
SELECT MAX(salary) FROM budgets AS budg
WHERE budg.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "budgets",
"outer_alias": "cust",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_03564 | train | T1 |
v2 | Schema:
services (alias: srvc)(salary, amount, id, code)
managers(level, amount, id, status)
Task: Find amount from services where a matching record exists in managers with the same id.
SQL: | SELECT amount FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "managers",
"outer_alias": "srvc",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_03565 | train | T2 |
v3 | Schema:
regions (alias: rgn)(level, name, type, status)
invoices(value, status, id, code)
Task: Find name from regions where value exceeds the average amount from invoices for the same id.
SQL: | SELECT name FROM regions AS rgn
WHERE value > (
SELECT MIN(amount) FROM invoices AS inv
WHERE inv.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_03566 | train | T2 |
v1 | Schema:
categories (alias: catg)(id, type, status, salary)
warehouses(amount, name, date, id)
Task: Find value from categories where id appears in warehouses entries with matching type.
SQL: | SELECT value FROM categories AS catg
WHERE id IN (
SELECT id FROM warehouses AS whs
WHERE whs.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "warehouses",
"outer_alias": "catg",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_03567 | train | T2 |
v2 | Schema:
orders (alias: ord)(salary, date, level, status)
products(name, id, salary, date)
Task: Find code from orders where a matching record exists in products with the same code.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_03568 | train | T1 |
v1 | Schema:
requests (alias: ordr)(amount, value, salary, level)
regions(type, name, amount, value)
Task: Select id from requests where level exists in regions for the same level.
SQL: | SELECT id FROM requests AS ordr
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_03569 | train | T2 |
v3 | Schema:
departments (alias: dept)(amount, status, type, name)
orders(level, amount, type, salary)
Task: Retrieve amount from departments with amount above the SUM(value) of orders rows sharing the same code.
SQL: | SELECT amount FROM departments AS dept
WHERE amount > (
SELECT SUM(value) FROM orders AS ord
WHERE ord.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_03570 | train | T1 |
v2 | Schema:
customers (alias: cust)(amount, date, id, salary)
managers(amount, name, status, level)
Task: Find name from customers where a matching record exists in managers with the same level.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_03571 | train | T1 |
v1 | Schema:
employees (alias: emp)(value, status, level, code)
services(date, type, level, status)
Task: Select value from employees where level exists in services for the same id.
SQL: | SELECT value FROM employees AS emp
WHERE level IN (
SELECT level FROM services AS srvc
WHERE srvc.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "services",
"outer_alias": "emp",
"inner_alias": "srvc",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_03572 | train | T1 |
v1 | Schema:
requests (alias: ordr)(salary, value, date, level)
regions(salary, date, code, type)
Task: Select amount from requests where code exists in regions for the same type.
SQL: | SELECT amount FROM requests AS ordr
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_03573 | train | T2 |
v3 | Schema:
budgets (alias: budg)(code, salary, name, date)
sales(status, name, amount, type)
Task: Retrieve salary from budgets with salary above the MAX(amount) of sales rows sharing the same type.
SQL: | SELECT salary FROM budgets AS budg
WHERE salary > (
SELECT MAX(amount) FROM sales AS sale
WHERE sale.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "sales",
"outer_alias": "budg",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_03574 | train | T2 |
v1 | Schema:
accounts (alias: acct)(salary, status, type, id)
schedules(value, date, name, status)
Task: Select amount from accounts where status exists in schedules for the same code.
SQL: | SELECT amount FROM accounts AS acct
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_03575 | train | T1 |
v2 | Schema:
categories (alias: catg)(salary, value, id, status)
accounts(name, value, status, type)
Task: Retrieve code from categories that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_03576 | train | T2 |
v1 | Schema:
budgets (alias: budg)(value, type, code, level)
shipments(date, level, name, salary)
Task: Find code from budgets where status appears in shipments entries with matching id.
SQL: | SELECT code FROM budgets AS budg
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "shipments",
"outer_alias": "budg",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_03577 | train | T2 |
v1 | Schema:
requests (alias: ordr)(name, type, salary, level)
customers(value, name, amount, salary)
Task: Select salary from requests where status exists in customers for the same level.
SQL: | SELECT salary FROM requests AS ordr
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_03578 | train | T2 |
v2 | Schema:
budgets (alias: budg)(name, salary, status, amount)
customers(name, level, status, date)
Task: Find salary from budgets where a matching record exists in customers with the same type.
SQL: | SELECT salary FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "customers",
"outer_alias": "budg",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_03579 | train | T2 |
v1 | Schema:
items (alias: lne)(salary, code, level, status)
schedules(value, status, date, id)
Task: Select id from items where id exists in schedules for the same status.
SQL: | SELECT id FROM items AS lne
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.status = lne.status
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_03580 | train | T2 |
v3 | Schema:
transactions (alias: txn)(value, date, code, amount)
orders(code, status, amount, salary)
Task: Find salary from transactions where value exceeds the average amount from orders for the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE value > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_03581 | train | T1 |
v1 | Schema:
employees (alias: emp)(type, name, date, salary)
departments(id, salary, level, code)
Task: Retrieve code from employees whose code is found in departments rows where type matches the outer record.
SQL: | SELECT code FROM employees AS emp
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_03582 | train | T1 |
v2 | Schema:
accounts (alias: acct)(code, salary, date, value)
items(status, type, salary, value)
Task: Retrieve amount from accounts that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_03583 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(value, name, date, amount)
orders(name, date, salary, amount)
Task: Find code from warehouses where value exceeds the average amount from orders for the same level.
SQL: | SELECT code FROM warehouses AS whs
WHERE value > (
SELECT COUNT(amount) FROM orders AS ord
WHERE ord.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "orders",
"outer_alias": "whs",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_03584 | train | T2 |
v3 | Schema:
managers (alias: mgr)(name, code, date, id)
items(code, type, amount, level)
Task: Find amount from managers where amount exceeds the average value from items for the same id.
SQL: | SELECT amount FROM managers AS mgr
WHERE amount > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_03585 | train | T1 |
v3 | Schema:
departments (alias: dept)(code, type, level, salary)
shipments(salary, status, date, value)
Task: Retrieve salary from departments with amount above the MAX(salary) of shipments rows sharing the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE amount > (
SELECT MAX(salary) FROM shipments AS shp
WHERE shp.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_03586 | train | T1 |
v3 | Schema:
products (alias: prod)(type, amount, level, code)
accounts(amount, type, date, id)
Task: Find salary from products where salary exceeds the average value from accounts for the same id.
SQL: | SELECT salary FROM products AS prod
WHERE salary > (
SELECT MIN(value) FROM accounts AS acct
WHERE acct.id = prod.id
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_03587 | train | T1 |
v1 | Schema:
shipments (alias: shp)(salary, name, value, status)
services(value, level, name, salary)
Task: Find name from shipments where code appears in services entries with matching code.
SQL: | SELECT name FROM shipments AS shp
WHERE code IN (
SELECT code FROM services AS srvc
WHERE srvc.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "services",
"outer_alias": "shp",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_03588 | train | T2 |
v2 | Schema:
transactions (alias: txn)(level, status, amount, date)
regions(level, id, name, code)
Task: Retrieve code from transactions that have at least one corresponding entry in regions sharing the same code.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_03589 | train | T1 |
v3 | Schema:
staff (alias: empl)(name, amount, type, id)
regions(level, status, salary, type)
Task: Find id from staff where value exceeds the average salary from regions for the same code.
SQL: | SELECT id FROM staff AS empl
WHERE value > (
SELECT COUNT(salary) FROM regions AS rgn
WHERE rgn.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_03590 | train | T2 |
v3 | Schema:
invoices (alias: inv)(level, date, id, salary)
regions(code, level, name, salary)
Task: Find amount from invoices where amount exceeds the average amount from regions for the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE amount > (
SELECT MAX(amount) FROM regions AS rgn
WHERE rgn.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_03591 | train | T1 |
v2 | Schema:
items (alias: lne)(name, level, id, date)
regions(value, status, date, type)
Task: Retrieve amount from items that have at least one corresponding entry in regions sharing the same code.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = lne.code
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_03592 | train | T2 |
v3 | Schema:
departments (alias: dept)(code, level, value, status)
requests(id, type, status, value)
Task: Retrieve salary from departments with salary above the AVG(amount) of requests rows sharing the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE salary > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_03593 | train | T1 |
v3 | Schema:
shipments (alias: shp)(name, id, salary, status)
warehouses(salary, status, value, type)
Task: Retrieve name from shipments with amount above the MAX(salary) of warehouses rows sharing the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE amount > (
SELECT MAX(salary) FROM warehouses AS whs
WHERE whs.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "warehouses",
"outer_alias": "shp",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_03594 | train | T2 |
v2 | Schema:
services (alias: srvc)(status, id, salary, type)
departments(value, level, amount, code)
Task: Find salary from services where a matching record exists in departments with the same id.
SQL: | SELECT salary FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "departments",
"outer_alias": "srvc",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_03595 | train | T2 |
v1 | Schema:
transactions (alias: txn)(code, id, date, status)
customers(status, name, type, level)
Task: Find value from transactions where type appears in customers entries with matching status.
SQL: | SELECT value FROM transactions AS txn
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_03596 | train | T1 |
v3 | Schema:
regions (alias: rgn)(amount, name, code, level)
warehouses(name, level, amount, value)
Task: Find name from regions where value exceeds the average salary from warehouses for the same status.
SQL: | SELECT name FROM regions AS rgn
WHERE value > (
SELECT COUNT(salary) FROM warehouses AS whs
WHERE whs.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "warehouses",
"outer_alias": "rgn",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_03597 | train | T2 |
v1 | Schema:
accounts (alias: acct)(name, type, level, code)
products(id, salary, status, name)
Task: Select name from accounts where status exists in products for the same id.
SQL: | SELECT name FROM accounts AS acct
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_03598 | train | T1 |
v2 | Schema:
products (alias: prod)(id, salary, status, type)
employees(value, amount, type, salary)
Task: Retrieve id from products that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = prod.status
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_03599 | train | T1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.