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:
customers (alias: cust)(id, value, amount, salary)
warehouses(code, date, amount, status)
Task: Find value from customers where code appears in warehouses entries with matching code.
SQL: | SELECT value FROM customers AS cust
WHERE code IN (
SELECT code FROM warehouses AS whs
WHERE whs.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "warehouses",
"outer_alias": "cust",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_02500 | train | T1 |
v2 | Schema:
transactions (alias: txn)(id, salary, name, value)
products(name, id, salary, status)
Task: Find salary from transactions where a matching record exists in products with the same status.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_02501 | train | T1 |
v1 | Schema:
managers (alias: mgr)(salary, level, status, date)
customers(date, id, salary, code)
Task: Select value from managers where code exists in customers for the same type.
SQL: | SELECT value FROM managers AS mgr
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_02502 | train | T1 |
v1 | Schema:
categories (alias: catg)(salary, type, code, value)
budgets(status, code, amount, name)
Task: Find id from categories where code appears in budgets entries with matching status.
SQL: | SELECT id FROM categories AS catg
WHERE code IN (
SELECT code FROM budgets AS budg
WHERE budg.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "budgets",
"outer_alias": "catg",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_02503 | train | T2 |
v2 | Schema:
regions (alias: rgn)(value, level, code, salary)
requests(type, salary, code, amount)
Task: Retrieve value from regions that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_02504 | train | T2 |
v3 | Schema:
services (alias: srvc)(amount, status, salary, date)
customers(id, amount, name, status)
Task: Find value from services where amount exceeds the average amount from customers for the same id.
SQL: | SELECT value FROM services AS srvc
WHERE amount > (
SELECT SUM(amount) FROM customers AS cust
WHERE cust.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "customers",
"outer_alias": "srvc",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_02505 | train | T2 |
v3 | Schema:
accounts (alias: acct)(code, salary, date, level)
schedules(name, salary, id, amount)
Task: Find amount from accounts where salary exceeds the average salary from schedules for the same status.
SQL: | SELECT amount FROM accounts AS acct
WHERE salary > (
SELECT SUM(salary) FROM schedules AS schd
WHERE schd.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_02506 | train | T1 |
v1 | Schema:
schedules (alias: schd)(type, id, name, code)
warehouses(salary, date, status, amount)
Task: Retrieve name from schedules whose level is found in warehouses rows where code matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE level IN (
SELECT level FROM warehouses AS whs
WHERE whs.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "warehouses",
"outer_alias": "schd",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_02507 | train | T2 |
v3 | Schema:
requests (alias: ordr)(id, code, name, amount)
services(type, name, date, value)
Task: Retrieve salary from requests with value above the MAX(value) of services rows sharing the same code.
SQL: | SELECT salary FROM requests AS ordr
WHERE value > (
SELECT MAX(value) FROM services AS srvc
WHERE srvc.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "services",
"outer_alias": "ordr",
"inner_alias": "srvc",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_02508 | train | T2 |
v2 | Schema:
staff (alias: empl)(date, value, amount, type)
budgets(id, date, amount, salary)
Task: Find amount from staff where a matching record exists in budgets with the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "budgets",
"outer_alias": "empl",
"inner_alias": "budg",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_02509 | train | T2 |
v3 | Schema:
invoices (alias: inv)(type, amount, level, id)
departments(salary, amount, code, status)
Task: Find salary from invoices where value exceeds the average salary from departments for the same type.
SQL: | SELECT salary FROM invoices AS inv
WHERE value > (
SELECT MIN(salary) FROM departments AS dept
WHERE dept.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_02510 | train | T1 |
v2 | Schema:
products (alias: prod)(code, type, name, id)
shipments(salary, name, amount, status)
Task: Find code from products where a matching record exists in shipments with the same type.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = prod.type
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_02511 | train | T1 |
v2 | Schema:
transactions (alias: txn)(level, name, code, status)
accounts(status, level, amount, salary)
Task: Find value from transactions where a matching record exists in accounts with the same status.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_02512 | train | T1 |
v3 | Schema:
budgets (alias: budg)(value, amount, id, code)
items(date, id, status, salary)
Task: Retrieve code from budgets with amount above the SUM(amount) of items rows sharing the same id.
SQL: | SELECT code FROM budgets AS budg
WHERE amount > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "items",
"outer_alias": "budg",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_02513 | train | T2 |
v2 | Schema:
staff (alias: empl)(amount, status, date, type)
transactions(date, id, code, amount)
Task: Find amount from staff where a matching record exists in transactions with the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_02514 | train | T2 |
v3 | Schema:
categories (alias: catg)(type, date, value, status)
services(status, amount, type, level)
Task: Find amount from categories where amount exceeds the average amount from services for the same id.
SQL: | SELECT amount FROM categories AS catg
WHERE amount > (
SELECT COUNT(amount) FROM services AS srvc
WHERE srvc.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "services",
"outer_alias": "catg",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_02515 | train | T2 |
v3 | Schema:
products (alias: prod)(status, name, salary, date)
warehouses(name, amount, value, date)
Task: Retrieve name from products with amount above the MIN(amount) of warehouses rows sharing the same level.
SQL: | SELECT name FROM products AS prod
WHERE amount > (
SELECT MIN(amount) FROM warehouses AS whs
WHERE whs.level = prod.level
); | {
"outer_table": "products",
"inner_table": "warehouses",
"outer_alias": "prod",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_02516 | train | T1 |
v1 | Schema:
regions (alias: rgn)(status, date, code, value)
budgets(type, date, amount, id)
Task: Retrieve id from regions whose code is found in budgets rows where code matches the outer record.
SQL: | SELECT id FROM regions AS rgn
WHERE code IN (
SELECT code FROM budgets AS budg
WHERE budg.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "budgets",
"outer_alias": "rgn",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_02517 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(type, date, name, value)
orders(level, salary, amount, type)
Task: Retrieve code from warehouses whose id is found in orders rows where id matches the outer record.
SQL: | SELECT code FROM warehouses AS whs
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "orders",
"outer_alias": "whs",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_02518 | train | T2 |
v1 | Schema:
customers (alias: cust)(name, value, salary, date)
categories(name, salary, id, amount)
Task: Find value from customers where code appears in categories entries with matching type.
SQL: | SELECT value FROM customers AS cust
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_02519 | train | T1 |
v2 | Schema:
regions (alias: rgn)(value, salary, code, status)
sales(name, salary, value, status)
Task: Find value from regions where a matching record exists in sales with the same status.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_02520 | train | T2 |
v1 | Schema:
regions (alias: rgn)(status, level, name, code)
services(status, code, level, amount)
Task: Retrieve salary from regions whose id is found in services rows where code matches the outer record.
SQL: | SELECT salary FROM regions AS rgn
WHERE id IN (
SELECT id FROM services AS srvc
WHERE srvc.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "services",
"outer_alias": "rgn",
"inner_alias": "srvc",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_02521 | train | T2 |
v1 | Schema:
budgets (alias: budg)(status, id, salary, code)
requests(amount, type, level, date)
Task: Select id from budgets where id exists in requests for the same type.
SQL: | SELECT id FROM budgets AS budg
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "requests",
"outer_alias": "budg",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_02522 | train | T2 |
v3 | Schema:
orders (alias: ord)(amount, status, name, level)
sales(status, date, code, value)
Task: Find code from orders where salary exceeds the average amount from sales for the same id.
SQL: | SELECT code FROM orders AS ord
WHERE salary > (
SELECT MIN(amount) FROM sales AS sale
WHERE sale.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_02523 | train | T1 |
v3 | Schema:
transactions (alias: txn)(type, value, id, salary)
managers(date, type, id, status)
Task: Retrieve amount from transactions with value above the MAX(salary) of managers rows sharing the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE value > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_02524 | train | T1 |
v1 | Schema:
categories (alias: catg)(level, date, value, code)
shipments(level, date, name, status)
Task: Retrieve name from categories whose code is found in shipments rows where id matches the outer record.
SQL: | SELECT name FROM categories AS catg
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_02525 | train | T2 |
v3 | Schema:
transactions (alias: txn)(level, salary, value, status)
items(amount, salary, code, status)
Task: Find value from transactions where salary exceeds the average amount from items for the same status.
SQL: | SELECT value FROM transactions AS txn
WHERE salary > (
SELECT AVG(amount) FROM items AS lne
WHERE lne.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_02526 | train | T1 |
v1 | Schema:
invoices (alias: inv)(type, salary, code, amount)
items(level, id, status, date)
Task: Select value from invoices where status exists in items for the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_02527 | train | T1 |
v1 | Schema:
regions (alias: rgn)(status, amount, value, type)
budgets(amount, value, status, salary)
Task: Find amount from regions where status appears in budgets entries with matching id.
SQL: | SELECT amount FROM regions AS rgn
WHERE status IN (
SELECT status FROM budgets AS budg
WHERE budg.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "budgets",
"outer_alias": "rgn",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_02528 | train | T2 |
v1 | Schema:
items (alias: lne)(status, level, code, type)
requests(salary, code, status, name)
Task: Select salary from items where status exists in requests for the same level.
SQL: | SELECT salary FROM items AS lne
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.level = lne.level
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_02529 | train | T2 |
v1 | Schema:
requests (alias: ordr)(date, id, level, name)
products(code, amount, status, value)
Task: Select code from requests where code exists in products for the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_02530 | train | T2 |
v3 | Schema:
departments (alias: dept)(id, date, salary, type)
employees(status, id, code, level)
Task: Find amount from departments where salary exceeds the average value from employees for the same type.
SQL: | SELECT amount FROM departments AS dept
WHERE salary > (
SELECT MAX(value) FROM employees AS emp
WHERE emp.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_02531 | train | T1 |
v3 | Schema:
accounts (alias: acct)(code, level, value, status)
orders(type, value, id, status)
Task: Retrieve value from accounts with salary above the MAX(value) of orders rows sharing the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE salary > (
SELECT MAX(value) FROM orders AS ord
WHERE ord.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_02532 | train | T1 |
v2 | Schema:
managers (alias: mgr)(level, type, status, id)
staff(salary, type, name, value)
Task: Retrieve id from managers that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_02533 | train | T1 |
v3 | Schema:
staff (alias: empl)(value, code, salary, level)
orders(status, name, level, value)
Task: Retrieve salary from staff with value above the MAX(amount) of orders rows sharing the same id.
SQL: | SELECT salary FROM staff AS empl
WHERE value > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_02534 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(salary, name, value, type)
categories(id, type, name, amount)
Task: Find salary from warehouses where a matching record exists in categories with the same level.
SQL: | SELECT salary FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "categories",
"outer_alias": "whs",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_02535 | train | T2 |
v2 | Schema:
products (alias: prod)(type, status, salary, amount)
shipments(value, status, salary, date)
Task: Retrieve id from products that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = prod.type
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_02536 | train | T1 |
v2 | Schema:
requests (alias: ordr)(level, id, type, salary)
employees(name, salary, id, value)
Task: Find amount from requests where a matching record exists in employees with the same id.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_02537 | train | T2 |
v1 | Schema:
budgets (alias: budg)(salary, status, amount, name)
customers(code, type, status, salary)
Task: Retrieve code from budgets whose level is found in customers rows where code matches the outer record.
SQL: | SELECT code FROM budgets AS budg
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "customers",
"outer_alias": "budg",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_02538 | train | T2 |
v1 | Schema:
requests (alias: ordr)(name, code, salary, type)
budgets(salary, date, name, id)
Task: Find code from requests where status appears in budgets entries with matching code.
SQL: | SELECT code FROM requests AS ordr
WHERE status IN (
SELECT status FROM budgets AS budg
WHERE budg.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "budgets",
"outer_alias": "ordr",
"inner_alias": "budg",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_02539 | train | T2 |
v3 | Schema:
shipments (alias: shp)(id, code, name, value)
sales(salary, name, date, type)
Task: Retrieve amount from shipments with value above the MIN(amount) of sales rows sharing the same code.
SQL: | SELECT amount FROM shipments AS shp
WHERE value > (
SELECT MIN(amount) FROM sales AS sale
WHERE sale.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_02540 | train | T2 |
v3 | Schema:
transactions (alias: txn)(level, amount, date, status)
customers(amount, salary, code, value)
Task: Retrieve amount from transactions with amount above the SUM(amount) of customers rows sharing the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE amount > (
SELECT SUM(amount) FROM customers AS cust
WHERE cust.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_02541 | train | T1 |
v3 | Schema:
requests (alias: ordr)(salary, id, status, code)
budgets(name, code, value, amount)
Task: Find amount from requests where value exceeds the average amount from budgets for the same level.
SQL: | SELECT amount FROM requests AS ordr
WHERE value > (
SELECT MAX(amount) FROM budgets AS budg
WHERE budg.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "budgets",
"outer_alias": "ordr",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_02542 | train | T2 |
v1 | Schema:
products (alias: prod)(amount, id, date, status)
sales(name, date, type, salary)
Task: Find amount from products where code appears in sales entries with matching type.
SQL: | SELECT amount FROM products AS prod
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.type = prod.type
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_02543 | train | T1 |
v3 | Schema:
employees (alias: emp)(value, id, salary, status)
shipments(value, type, name, status)
Task: Find code from employees where salary exceeds the average amount from shipments for the same type.
SQL: | SELECT code FROM employees AS emp
WHERE salary > (
SELECT MIN(amount) FROM shipments AS shp
WHERE shp.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_02544 | train | T1 |
v2 | Schema:
regions (alias: rgn)(code, salary, amount, type)
departments(code, id, value, salary)
Task: Retrieve name from regions that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_02545 | train | T2 |
v3 | Schema:
departments (alias: dept)(level, type, date, code)
schedules(code, salary, level, value)
Task: Find name from departments where salary exceeds the average amount from schedules for the same code.
SQL: | SELECT name FROM departments AS dept
WHERE salary > (
SELECT MAX(amount) FROM schedules AS schd
WHERE schd.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_02546 | train | T1 |
v2 | Schema:
schedules (alias: schd)(amount, type, date, salary)
services(value, id, amount, status)
Task: Retrieve salary from schedules that have at least one corresponding entry in services sharing the same code.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "services",
"outer_alias": "schd",
"inner_alias": "srvc",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_02547 | train | T2 |
v3 | Schema:
departments (alias: dept)(name, type, status, salary)
customers(name, date, level, code)
Task: Retrieve salary from departments with amount above the COUNT(salary) of customers rows sharing the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE amount > (
SELECT COUNT(salary) FROM customers AS cust
WHERE cust.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_02548 | train | T1 |
v2 | Schema:
products (alias: prod)(salary, name, id, status)
staff(name, salary, value, status)
Task: Retrieve name from products that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = prod.status
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_02549 | train | T1 |
v2 | Schema:
orders (alias: ord)(value, salary, date, code)
requests(date, level, salary, value)
Task: Find value from orders where a matching record exists in requests with the same status.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_02550 | train | T1 |
v3 | Schema:
transactions (alias: txn)(date, amount, status, type)
categories(level, name, status, type)
Task: Find name from transactions where value exceeds the average salary from categories for the same level.
SQL: | SELECT name FROM transactions AS txn
WHERE value > (
SELECT MAX(salary) FROM categories AS catg
WHERE catg.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_02551 | train | T1 |
v2 | Schema:
staff (alias: empl)(id, value, status, level)
services(level, type, status, amount)
Task: Find value from staff where a matching record exists in services with the same level.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "services",
"outer_alias": "empl",
"inner_alias": "srvc",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_02552 | train | T2 |
v3 | Schema:
invoices (alias: inv)(amount, code, level, date)
transactions(level, type, value, salary)
Task: Find id from invoices where value exceeds the average salary from transactions for the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE value > (
SELECT COUNT(salary) FROM transactions AS txn
WHERE txn.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_02553 | train | T1 |
v3 | Schema:
budgets (alias: budg)(type, level, name, status)
managers(code, status, value, id)
Task: Retrieve amount from budgets with value above the MAX(value) of managers rows sharing the same code.
SQL: | SELECT amount FROM budgets AS budg
WHERE value > (
SELECT MAX(value) FROM managers AS mgr
WHERE mgr.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "managers",
"outer_alias": "budg",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_02554 | train | T2 |
v1 | Schema:
invoices (alias: inv)(value, type, salary, status)
sales(salary, status, level, code)
Task: Find salary from invoices where code appears in sales entries with matching level.
SQL: | SELECT salary FROM invoices AS inv
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_02555 | train | T1 |
v3 | Schema:
accounts (alias: acct)(amount, type, status, level)
customers(name, status, id, level)
Task: Find salary from accounts where value exceeds the average amount from customers for the same type.
SQL: | SELECT salary FROM accounts AS acct
WHERE value > (
SELECT COUNT(amount) FROM customers AS cust
WHERE cust.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_02556 | train | T1 |
v3 | Schema:
invoices (alias: inv)(type, status, code, value)
shipments(code, status, id, name)
Task: Retrieve name from invoices with amount above the AVG(amount) of shipments rows sharing the same code.
SQL: | SELECT name FROM invoices AS inv
WHERE amount > (
SELECT AVG(amount) FROM shipments AS shp
WHERE shp.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_02557 | train | T1 |
v2 | Schema:
orders (alias: ord)(status, name, level, date)
services(amount, salary, value, name)
Task: Find salary from orders where a matching record exists in services with the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "services",
"outer_alias": "ord",
"inner_alias": "srvc",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_02558 | train | T1 |
v2 | Schema:
schedules (alias: schd)(code, level, amount, salary)
shipments(type, salary, status, name)
Task: Retrieve id from schedules that have at least one corresponding entry in shipments sharing the same level.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_02559 | train | T2 |
v3 | Schema:
invoices (alias: inv)(level, type, salary, value)
managers(salary, date, amount, status)
Task: Find amount from invoices where value exceeds the average amount from managers for the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE value > (
SELECT MIN(amount) FROM managers AS mgr
WHERE mgr.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_02560 | train | T1 |
v1 | Schema:
employees (alias: emp)(value, status, amount, type)
requests(value, name, level, salary)
Task: Find salary from employees where id appears in requests entries with matching status.
SQL: | SELECT salary FROM employees AS emp
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_02561 | train | T1 |
v1 | Schema:
staff (alias: empl)(salary, amount, id, level)
managers(salary, amount, id, date)
Task: Select value from staff where level exists in managers for the same level.
SQL: | SELECT value FROM staff AS empl
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_02562 | train | T2 |
v3 | Schema:
transactions (alias: txn)(name, type, code, status)
orders(status, date, type, id)
Task: Retrieve value from transactions with value above the COUNT(salary) of orders rows sharing the same type.
SQL: | SELECT value FROM transactions AS txn
WHERE value > (
SELECT COUNT(salary) FROM orders AS ord
WHERE ord.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_02563 | train | T1 |
v3 | Schema:
products (alias: prod)(date, type, salary, name)
warehouses(status, id, value, code)
Task: Retrieve code from products with amount above the MAX(value) of warehouses rows sharing the same level.
SQL: | SELECT code FROM products AS prod
WHERE amount > (
SELECT MAX(value) FROM warehouses AS whs
WHERE whs.level = prod.level
); | {
"outer_table": "products",
"inner_table": "warehouses",
"outer_alias": "prod",
"inner_alias": "whs",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_02564 | train | T1 |
v3 | Schema:
departments (alias: dept)(type, id, level, salary)
invoices(status, level, value, id)
Task: Find value from departments where amount exceeds the average salary from invoices for the same type.
SQL: | SELECT value FROM departments AS dept
WHERE amount > (
SELECT MAX(salary) FROM invoices AS inv
WHERE inv.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "invoices",
"outer_alias": "dept",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_02565 | train | T1 |
v1 | Schema:
regions (alias: rgn)(salary, name, amount, date)
shipments(type, code, amount, name)
Task: Find value from regions where type appears in shipments entries with matching id.
SQL: | SELECT value FROM regions AS rgn
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_02566 | train | T2 |
v3 | Schema:
accounts (alias: acct)(salary, name, type, id)
schedules(name, level, code, salary)
Task: Retrieve id from accounts with value above the SUM(amount) of schedules rows sharing the same code.
SQL: | SELECT id FROM accounts AS acct
WHERE value > (
SELECT SUM(amount) FROM schedules AS schd
WHERE schd.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_02567 | train | T1 |
v1 | Schema:
customers (alias: cust)(salary, code, type, id)
orders(type, code, status, level)
Task: Select id from customers where id exists in orders for the same status.
SQL: | SELECT id FROM customers AS cust
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_02568 | train | T1 |
v1 | Schema:
categories (alias: catg)(id, name, value, amount)
invoices(amount, salary, type, status)
Task: Find amount from categories where type appears in invoices entries with matching status.
SQL: | SELECT amount FROM categories AS catg
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_02569 | train | T2 |
v3 | Schema:
budgets (alias: budg)(status, code, salary, date)
schedules(salary, amount, date, name)
Task: Retrieve amount from budgets with amount above the MIN(salary) of schedules rows sharing the same status.
SQL: | SELECT amount FROM budgets AS budg
WHERE amount > (
SELECT MIN(salary) FROM schedules AS schd
WHERE schd.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "schedules",
"outer_alias": "budg",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_02570 | train | T2 |
v1 | Schema:
services (alias: srvc)(date, status, id, value)
sales(date, code, level, salary)
Task: Retrieve id from services whose type is found in sales rows where id matches the outer record.
SQL: | SELECT id FROM services AS srvc
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "sales",
"outer_alias": "srvc",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_02571 | train | T2 |
v2 | Schema:
managers (alias: mgr)(salary, value, date, code)
transactions(level, amount, salary, id)
Task: Retrieve name from managers that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_02572 | train | T1 |
v3 | Schema:
customers (alias: cust)(amount, status, code, level)
transactions(value, level, code, amount)
Task: Find salary from customers where value exceeds the average value from transactions for the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE value > (
SELECT AVG(value) FROM transactions AS txn
WHERE txn.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_02573 | train | T1 |
v3 | Schema:
sales (alias: sale)(code, date, amount, value)
regions(date, status, type, id)
Task: Find code from sales where value exceeds the average amount from regions for the same code.
SQL: | SELECT code FROM sales AS sale
WHERE value > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_02574 | train | T1 |
v3 | Schema:
items (alias: lne)(id, level, salary, code)
customers(id, salary, date, code)
Task: Retrieve id from items with amount above the COUNT(salary) of customers rows sharing the same code.
SQL: | SELECT id FROM items AS lne
WHERE amount > (
SELECT COUNT(salary) FROM customers AS cust
WHERE cust.code = lne.code
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_02575 | train | T2 |
v3 | Schema:
staff (alias: empl)(value, name, status, salary)
departments(type, status, id, name)
Task: Find id from staff where value exceeds the average value from departments for the same type.
SQL: | SELECT id FROM staff AS empl
WHERE value > (
SELECT COUNT(value) FROM departments AS dept
WHERE dept.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_02576 | train | T2 |
v2 | Schema:
customers (alias: cust)(name, code, amount, level)
sales(level, amount, type, status)
Task: Find salary from customers where a matching record exists in sales with the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_02577 | train | T1 |
v1 | Schema:
staff (alias: empl)(status, id, level, name)
accounts(status, date, code, level)
Task: Select name from staff where id exists in accounts for the same id.
SQL: | SELECT name FROM staff AS empl
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_02578 | train | T2 |
v2 | Schema:
staff (alias: empl)(id, salary, code, date)
shipments(name, status, level, salary)
Task: Retrieve amount from staff that have at least one corresponding entry in shipments sharing the same status.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_02579 | train | T2 |
v3 | Schema:
employees (alias: emp)(salary, code, date, id)
requests(name, salary, date, amount)
Task: Retrieve amount from employees with amount above the SUM(amount) of requests rows sharing the same id.
SQL: | SELECT amount FROM employees AS emp
WHERE amount > (
SELECT SUM(amount) FROM requests AS ordr
WHERE ordr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_02580 | train | T1 |
v3 | Schema:
shipments (alias: shp)(salary, amount, name, level)
customers(amount, code, id, value)
Task: Find code from shipments where amount exceeds the average salary from customers for the same level.
SQL: | SELECT code FROM shipments AS shp
WHERE amount > (
SELECT SUM(salary) FROM customers AS cust
WHERE cust.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_02581 | train | T2 |
v1 | Schema:
employees (alias: emp)(code, name, salary, amount)
budgets(type, code, status, level)
Task: Retrieve salary from employees whose id is found in budgets rows where id matches the outer record.
SQL: | SELECT salary FROM employees AS emp
WHERE id IN (
SELECT id FROM budgets AS budg
WHERE budg.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "budgets",
"outer_alias": "emp",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_02582 | train | T1 |
v3 | Schema:
requests (alias: ordr)(date, value, code, salary)
categories(code, value, amount, level)
Task: Find value from requests where salary exceeds the average value from categories for the same status.
SQL: | SELECT value FROM requests AS ordr
WHERE salary > (
SELECT COUNT(value) FROM categories AS catg
WHERE catg.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_02583 | train | T2 |
v3 | Schema:
employees (alias: emp)(salary, date, code, status)
requests(id, status, salary, level)
Task: Retrieve name from employees with value above the AVG(salary) of requests rows sharing the same id.
SQL: | SELECT name FROM employees AS emp
WHERE value > (
SELECT AVG(salary) FROM requests AS ordr
WHERE ordr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_02584 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(salary, type, code, id)
employees(amount, name, id, level)
Task: Retrieve salary from warehouses that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT salary FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "employees",
"outer_alias": "whs",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_02585 | train | T2 |
v2 | Schema:
budgets (alias: budg)(id, value, amount, code)
items(value, level, type, date)
Task: Retrieve value from budgets that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT value FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "items",
"outer_alias": "budg",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_02586 | train | T2 |
v3 | Schema:
employees (alias: emp)(name, salary, level, id)
requests(name, salary, date, status)
Task: Retrieve id from employees with salary above the MAX(salary) of requests rows sharing the same status.
SQL: | SELECT id FROM employees AS emp
WHERE salary > (
SELECT MAX(salary) FROM requests AS ordr
WHERE ordr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_02587 | train | T1 |
v3 | Schema:
employees (alias: emp)(status, salary, type, name)
services(name, status, id, date)
Task: Find id from employees where value exceeds the average amount from services for the same level.
SQL: | SELECT id FROM employees AS emp
WHERE value > (
SELECT MAX(amount) FROM services AS srvc
WHERE srvc.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "services",
"outer_alias": "emp",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_02588 | train | T1 |
v2 | Schema:
shipments (alias: shp)(value, amount, code, salary)
requests(value, salary, id, code)
Task: Find amount from shipments where a matching record exists in requests with the same code.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_02589 | train | T2 |
v3 | Schema:
transactions (alias: txn)(status, name, date, level)
invoices(salary, type, id, amount)
Task: Find id from transactions where amount exceeds the average value from invoices for the same status.
SQL: | SELECT id FROM transactions AS txn
WHERE amount > (
SELECT MIN(value) FROM invoices AS inv
WHERE inv.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_02590 | train | T1 |
v2 | Schema:
employees (alias: emp)(id, salary, value, level)
managers(id, level, type, name)
Task: Find amount from employees where a matching record exists in managers with the same code.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_02591 | train | T1 |
v3 | Schema:
sales (alias: sale)(level, salary, status, code)
requests(amount, value, level, status)
Task: Find value from sales where amount exceeds the average amount from requests for the same status.
SQL: | SELECT value FROM sales AS sale
WHERE amount > (
SELECT COUNT(amount) FROM requests AS ordr
WHERE ordr.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_02592 | train | T1 |
v3 | Schema:
staff (alias: empl)(name, status, value, level)
departments(value, level, id, status)
Task: Retrieve amount from staff with value above the MAX(amount) of departments rows sharing the same status.
SQL: | SELECT amount FROM staff AS empl
WHERE value > (
SELECT MAX(amount) FROM departments AS dept
WHERE dept.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_02593 | train | T2 |
v2 | Schema:
categories (alias: catg)(value, status, type, salary)
sales(amount, level, value, salary)
Task: Find salary from categories where a matching record exists in sales with the same code.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_02594 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(value, amount, id, date)
sales(amount, name, level, status)
Task: Select salary from warehouses where id exists in sales for the same level.
SQL: | SELECT salary FROM warehouses AS whs
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "sales",
"outer_alias": "whs",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_02595 | train | T2 |
v3 | Schema:
invoices (alias: inv)(amount, id, name, type)
accounts(salary, name, id, code)
Task: Retrieve id from invoices with value above the AVG(salary) of accounts rows sharing the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE value > (
SELECT AVG(salary) FROM accounts AS acct
WHERE acct.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_02596 | train | T1 |
v1 | Schema:
products (alias: prod)(amount, status, type, code)
items(date, salary, amount, value)
Task: Retrieve code from products whose id is found in items rows where type matches the outer record.
SQL: | SELECT code FROM products AS prod
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.type = prod.type
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_02597 | train | T1 |
v1 | Schema:
employees (alias: emp)(code, id, name, status)
budgets(status, code, date, id)
Task: Find code from employees where id appears in budgets entries with matching status.
SQL: | SELECT code FROM employees AS emp
WHERE id IN (
SELECT id FROM budgets AS budg
WHERE budg.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "budgets",
"outer_alias": "emp",
"inner_alias": "budg",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_02598 | train | T1 |
v2 | Schema:
regions (alias: rgn)(value, id, code, amount)
departments(type, status, value, level)
Task: Find salary from regions where a matching record exists in departments with the same id.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_02599 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.