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 |
|---|---|---|---|---|---|---|
v3 | Schema:
managers (alias: mgr)(date, status, code, id)
employees(amount, status, date, level)
Task: Find id from managers where salary exceeds the average salary from employees for the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE salary > (
SELECT SUM(salary) FROM employees AS emp
WHERE emp.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_10600 | train | T1 |
v2 | Schema:
departments (alias: dept)(status, value, salary, id)
customers(code, salary, amount, status)
Task: Find amount from departments where a matching record exists in customers with the same id.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_10601 | train | T1 |
v1 | Schema:
employees (alias: emp)(name, level, value, status)
invoices(status, name, salary, id)
Task: Select id from employees where status exists in invoices for the same level.
SQL: | SELECT id FROM employees AS emp
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_10602 | train | T1 |
v1 | Schema:
categories (alias: catg)(name, level, type, code)
shipments(name, value, id, amount)
Task: Retrieve id from categories whose id is found in shipments rows where id matches the outer record.
SQL: | SELECT id FROM categories AS catg
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_10603 | train | T2 |
v3 | Schema:
schedules (alias: schd)(status, date, name, level)
requests(amount, value, type, status)
Task: Find name from schedules where value exceeds the average value from requests for the same id.
SQL: | SELECT name FROM schedules AS schd
WHERE value > (
SELECT MAX(value) FROM requests AS ordr
WHERE ordr.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_10604 | train | T2 |
v1 | Schema:
schedules (alias: schd)(level, name, amount, date)
accounts(type, salary, level, amount)
Task: Select id from schedules where status exists in accounts for the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_10605 | train | T2 |
v2 | Schema:
customers (alias: cust)(amount, salary, id, date)
budgets(type, amount, salary, status)
Task: Find id from customers where a matching record exists in budgets with the same type.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "budgets",
"outer_alias": "cust",
"inner_alias": "budg",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_10606 | train | T1 |
v3 | Schema:
products (alias: prod)(value, type, name, salary)
accounts(date, level, amount, code)
Task: Retrieve name from products with amount above the MAX(amount) of accounts rows sharing the same id.
SQL: | SELECT name FROM products AS prod
WHERE amount > (
SELECT MAX(amount) FROM accounts AS acct
WHERE acct.id = prod.id
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_10607 | train | T1 |
v1 | Schema:
categories (alias: catg)(date, amount, value, code)
invoices(status, amount, level, date)
Task: Retrieve salary from categories whose type is found in invoices rows where code matches the outer record.
SQL: | SELECT salary FROM categories AS catg
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_10608 | train | T2 |
v2 | Schema:
products (alias: prod)(code, status, value, id)
invoices(code, amount, status, salary)
Task: Retrieve value from products that have at least one corresponding entry in invoices sharing the same code.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = prod.code
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_10609 | train | T1 |
v1 | Schema:
requests (alias: ordr)(level, type, id, amount)
accounts(name, id, code, date)
Task: Select id from requests where code exists in accounts for the same level.
SQL: | SELECT id FROM requests AS ordr
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_10610 | train | T2 |
v3 | Schema:
schedules (alias: schd)(id, value, date, salary)
requests(salary, type, name, status)
Task: Retrieve value from schedules with value above the MIN(salary) of requests rows sharing the same type.
SQL: | SELECT value FROM schedules AS schd
WHERE value > (
SELECT MIN(salary) FROM requests AS ordr
WHERE ordr.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_10611 | train | T2 |
v2 | Schema:
products (alias: prod)(code, salary, id, status)
transactions(type, level, amount, value)
Task: Retrieve amount from products that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = prod.level
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_10612 | train | T1 |
v2 | Schema:
requests (alias: ordr)(id, type, level, date)
warehouses(level, id, amount, type)
Task: Find id from requests where a matching record exists in warehouses with the same id.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "warehouses",
"outer_alias": "ordr",
"inner_alias": "whs",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_10613 | train | T2 |
v2 | Schema:
managers (alias: mgr)(status, level, salary, date)
shipments(code, value, amount, date)
Task: Retrieve value from managers that have at least one corresponding entry in shipments sharing the same status.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_10614 | train | T1 |
v2 | Schema:
customers (alias: cust)(value, type, date, level)
warehouses(status, amount, salary, value)
Task: Find code from customers where a matching record exists in warehouses with the same type.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "warehouses",
"outer_alias": "cust",
"inner_alias": "whs",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_10615 | train | T1 |
v1 | Schema:
services (alias: srvc)(name, id, salary, level)
transactions(type, name, value, amount)
Task: Retrieve amount from services whose level is found in transactions rows where type matches the outer record.
SQL: | SELECT amount FROM services AS srvc
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "transactions",
"outer_alias": "srvc",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_10616 | train | T2 |
v2 | Schema:
services (alias: srvc)(value, id, status, level)
departments(date, code, status, level)
Task: Find value from services where a matching record exists in departments with the same type.
SQL: | SELECT value FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "departments",
"outer_alias": "srvc",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_10617 | train | T2 |
v2 | Schema:
employees (alias: emp)(date, amount, level, status)
departments(salary, date, level, name)
Task: Find code from employees where a matching record exists in departments with the same status.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_10618 | train | T1 |
v1 | Schema:
categories (alias: catg)(date, id, level, code)
transactions(type, name, amount, date)
Task: Retrieve id from categories whose id is found in transactions rows where code matches the outer record.
SQL: | SELECT id FROM categories AS catg
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_10619 | train | T2 |
v2 | Schema:
budgets (alias: budg)(id, amount, type, status)
customers(date, amount, status, id)
Task: Retrieve value from budgets that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT value FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "customers",
"outer_alias": "budg",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_10620 | train | T2 |
v2 | Schema:
budgets (alias: budg)(value, status, amount, salary)
managers(code, id, value, status)
Task: Retrieve value from budgets that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT value FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "managers",
"outer_alias": "budg",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_10621 | train | T2 |
v2 | Schema:
schedules (alias: schd)(status, id, code, value)
customers(name, type, level, date)
Task: Retrieve amount from schedules that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_10622 | train | T2 |
v2 | Schema:
transactions (alias: txn)(date, salary, type, status)
services(code, level, id, type)
Task: Retrieve amount from transactions that have at least one corresponding entry in services sharing the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "services",
"outer_alias": "txn",
"inner_alias": "srvc",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_10623 | train | T1 |
v2 | Schema:
regions (alias: rgn)(id, type, date, code)
sales(value, code, date, amount)
Task: Find id from regions where a matching record exists in sales with the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_10624 | train | T2 |
v2 | Schema:
managers (alias: mgr)(code, name, status, salary)
sales(salary, status, code, name)
Task: Retrieve salary from managers that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_10625 | train | T1 |
v1 | Schema:
products (alias: prod)(level, code, amount, id)
warehouses(type, code, level, date)
Task: Retrieve salary from products whose id is found in warehouses rows where status matches the outer record.
SQL: | SELECT salary FROM products AS prod
WHERE id IN (
SELECT id FROM warehouses AS whs
WHERE whs.status = prod.status
); | {
"outer_table": "products",
"inner_table": "warehouses",
"outer_alias": "prod",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_10626 | train | T1 |
v2 | Schema:
departments (alias: dept)(date, value, amount, id)
accounts(status, amount, code, name)
Task: Retrieve salary from departments that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_10627 | train | T1 |
v3 | Schema:
shipments (alias: shp)(status, id, level, type)
schedules(amount, code, date, id)
Task: Find value from shipments where salary exceeds the average amount from schedules for the same id.
SQL: | SELECT value FROM shipments AS shp
WHERE salary > (
SELECT MIN(amount) FROM schedules AS schd
WHERE schd.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_10628 | train | T2 |
v2 | Schema:
invoices (alias: inv)(id, level, name, type)
departments(type, level, status, id)
Task: Retrieve amount from invoices that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_10629 | train | T1 |
v3 | Schema:
sales (alias: sale)(name, level, salary, id)
transactions(level, salary, code, date)
Task: Retrieve name from sales with amount above the AVG(salary) of transactions rows sharing the same level.
SQL: | SELECT name FROM sales AS sale
WHERE amount > (
SELECT AVG(salary) FROM transactions AS txn
WHERE txn.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_10630 | train | T1 |
v2 | Schema:
budgets (alias: budg)(status, code, amount, name)
employees(code, level, salary, amount)
Task: Find salary from budgets where a matching record exists in employees with the same id.
SQL: | SELECT salary FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "employees",
"outer_alias": "budg",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_10631 | train | T2 |
v3 | Schema:
staff (alias: empl)(name, date, type, amount)
items(type, level, value, status)
Task: Find value from staff where amount exceeds the average value from items for the same code.
SQL: | SELECT value FROM staff AS empl
WHERE amount > (
SELECT MAX(value) FROM items AS lne
WHERE lne.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_10632 | train | T2 |
v1 | Schema:
shipments (alias: shp)(salary, amount, status, code)
orders(name, salary, type, date)
Task: Find amount from shipments where level appears in orders entries with matching status.
SQL: | SELECT amount FROM shipments AS shp
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_10633 | train | T2 |
v3 | Schema:
transactions (alias: txn)(status, salary, name, code)
invoices(code, name, date, salary)
Task: Retrieve name from transactions with salary above the AVG(amount) of invoices rows sharing the same level.
SQL: | SELECT name FROM transactions AS txn
WHERE salary > (
SELECT AVG(amount) FROM invoices AS inv
WHERE inv.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_10634 | train | T1 |
v3 | Schema:
sales (alias: sale)(type, value, amount, salary)
managers(level, status, amount, salary)
Task: Retrieve id from sales with salary above the MIN(amount) of managers rows sharing the same code.
SQL: | SELECT id FROM sales AS sale
WHERE salary > (
SELECT MIN(amount) FROM managers AS mgr
WHERE mgr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_10635 | train | T1 |
v2 | Schema:
customers (alias: cust)(name, status, value, date)
employees(type, salary, amount, id)
Task: Retrieve amount from customers that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_10636 | train | T1 |
v1 | Schema:
regions (alias: rgn)(salary, id, value, type)
items(value, level, status, date)
Task: Select salary from regions where id exists in items for the same id.
SQL: | SELECT salary FROM regions AS rgn
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_10637 | train | T2 |
v1 | Schema:
regions (alias: rgn)(amount, id, code, value)
shipments(value, name, salary, status)
Task: Retrieve code from regions whose code is found in shipments rows where id matches the outer record.
SQL: | SELECT code FROM regions AS rgn
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_10638 | train | T2 |
v3 | Schema:
products (alias: prod)(type, id, value, status)
staff(code, id, salary, level)
Task: Find code from products where value exceeds the average salary from staff for the same level.
SQL: | SELECT code FROM products AS prod
WHERE value > (
SELECT MAX(salary) FROM staff AS empl
WHERE empl.level = prod.level
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_10639 | train | T1 |
v1 | Schema:
shipments (alias: shp)(id, date, name, level)
accounts(id, amount, code, value)
Task: Select code from shipments where level exists in accounts for the same level.
SQL: | SELECT code FROM shipments AS shp
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_10640 | train | T2 |
v3 | Schema:
employees (alias: emp)(code, type, salary, level)
staff(status, amount, type, value)
Task: Find value from employees where amount exceeds the average salary from staff for the same type.
SQL: | SELECT value FROM employees AS emp
WHERE amount > (
SELECT SUM(salary) FROM staff AS empl
WHERE empl.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_10641 | train | T1 |
v2 | Schema:
departments (alias: dept)(salary, value, id, date)
schedules(status, value, name, amount)
Task: Find salary from departments where a matching record exists in schedules with the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_10642 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(id, salary, value, amount)
sales(name, date, level, amount)
Task: Find value from warehouses where type appears in sales entries with matching id.
SQL: | SELECT value FROM warehouses AS whs
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "sales",
"outer_alias": "whs",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_10643 | train | T2 |
v3 | Schema:
categories (alias: catg)(type, salary, date, amount)
employees(value, name, salary, status)
Task: Find name from categories where amount exceeds the average salary from employees for the same level.
SQL: | SELECT name FROM categories AS catg
WHERE amount > (
SELECT SUM(salary) FROM employees AS emp
WHERE emp.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_10644 | train | T2 |
v2 | Schema:
items (alias: lne)(type, amount, name, code)
accounts(date, id, status, code)
Task: Retrieve value from items that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = lne.level
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_10645 | train | T2 |
v3 | Schema:
transactions (alias: txn)(type, name, value, salary)
customers(type, name, status, id)
Task: Find code from transactions where amount exceeds the average salary from customers for the same id.
SQL: | SELECT code FROM transactions AS txn
WHERE amount > (
SELECT MIN(salary) FROM customers AS cust
WHERE cust.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_10646 | train | T1 |
v3 | Schema:
schedules (alias: schd)(status, value, id, amount)
transactions(name, status, level, salary)
Task: Retrieve value from schedules with salary above the MAX(amount) of transactions rows sharing the same status.
SQL: | SELECT value FROM schedules AS schd
WHERE salary > (
SELECT MAX(amount) FROM transactions AS txn
WHERE txn.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_10647 | train | T2 |
v1 | Schema:
orders (alias: ord)(level, salary, status, id)
departments(value, status, type, amount)
Task: Select id from orders where level exists in departments for the same id.
SQL: | SELECT id FROM orders AS ord
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_10648 | train | T1 |
v1 | Schema:
categories (alias: catg)(salary, date, value, name)
orders(status, type, date, salary)
Task: Select name from categories where type exists in orders for the same code.
SQL: | SELECT name FROM categories AS catg
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_10649 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(level, code, value, type)
items(salary, status, value, date)
Task: Find id from warehouses where a matching record exists in items with the same level.
SQL: | SELECT id FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "items",
"outer_alias": "whs",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_10650 | train | T2 |
v3 | Schema:
staff (alias: empl)(name, status, salary, level)
invoices(code, level, status, value)
Task: Retrieve code from staff with salary above the MIN(value) of invoices rows sharing the same id.
SQL: | SELECT code FROM staff AS empl
WHERE salary > (
SELECT MIN(value) FROM invoices AS inv
WHERE inv.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_10651 | train | T2 |
v1 | Schema:
shipments (alias: shp)(type, code, salary, level)
budgets(name, code, amount, id)
Task: Find salary from shipments where type appears in budgets entries with matching id.
SQL: | SELECT salary FROM shipments AS shp
WHERE type IN (
SELECT type FROM budgets AS budg
WHERE budg.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "budgets",
"outer_alias": "shp",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_10652 | train | T2 |
v2 | Schema:
regions (alias: rgn)(salary, name, value, status)
services(status, name, id, code)
Task: Find value from regions where a matching record exists in services with the same level.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "services",
"outer_alias": "rgn",
"inner_alias": "srvc",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_10653 | train | T2 |
v2 | Schema:
shipments (alias: shp)(level, salary, value, type)
invoices(code, value, date, type)
Task: Retrieve amount from shipments that have at least one corresponding entry in invoices sharing the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_10654 | train | T2 |
v3 | Schema:
managers (alias: mgr)(level, code, name, value)
requests(status, date, salary, type)
Task: Retrieve name from managers with value above the COUNT(value) of requests rows sharing the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE value > (
SELECT COUNT(value) FROM requests AS ordr
WHERE ordr.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_10655 | train | T1 |
v3 | Schema:
staff (alias: empl)(level, salary, amount, value)
services(id, date, name, salary)
Task: Find name from staff where salary exceeds the average amount from services for the same code.
SQL: | SELECT name FROM staff AS empl
WHERE salary > (
SELECT MIN(amount) FROM services AS srvc
WHERE srvc.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "services",
"outer_alias": "empl",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_10656 | train | T2 |
v1 | Schema:
schedules (alias: schd)(salary, id, code, name)
budgets(name, value, type, salary)
Task: Retrieve value from schedules whose status is found in budgets rows where id matches the outer record.
SQL: | SELECT value FROM schedules AS schd
WHERE status IN (
SELECT status FROM budgets AS budg
WHERE budg.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "budgets",
"outer_alias": "schd",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_10657 | train | T2 |
v2 | Schema:
transactions (alias: txn)(type, id, amount, salary)
budgets(type, amount, name, status)
Task: Retrieve amount from transactions that have at least one corresponding entry in budgets sharing the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "budgets",
"outer_alias": "txn",
"inner_alias": "budg",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_10658 | train | T1 |
v1 | Schema:
managers (alias: mgr)(value, status, code, id)
services(id, type, level, salary)
Task: Retrieve value from managers whose status is found in services rows where status matches the outer record.
SQL: | SELECT value FROM managers AS mgr
WHERE status IN (
SELECT status FROM services AS srvc
WHERE srvc.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "services",
"outer_alias": "mgr",
"inner_alias": "srvc",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_10659 | train | T1 |
v2 | Schema:
items (alias: lne)(id, code, name, date)
sales(amount, type, salary, level)
Task: Find name from items where a matching record exists in sales with the same code.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = lne.code
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_10660 | train | T2 |
v1 | Schema:
accounts (alias: acct)(name, status, type, salary)
categories(id, date, code, status)
Task: Select code from accounts where status exists in categories for the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_10661 | train | T1 |
v1 | Schema:
invoices (alias: inv)(code, id, level, date)
products(name, date, code, id)
Task: Select amount from invoices where code exists in products for the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_10662 | train | T1 |
v1 | Schema:
invoices (alias: inv)(code, status, type, id)
warehouses(code, date, amount, value)
Task: Retrieve value from invoices whose level is found in warehouses rows where status matches the outer record.
SQL: | SELECT value FROM invoices AS inv
WHERE level IN (
SELECT level FROM warehouses AS whs
WHERE whs.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "warehouses",
"outer_alias": "inv",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_10663 | train | T1 |
v3 | Schema:
managers (alias: mgr)(salary, id, status, value)
budgets(name, date, code, id)
Task: Find salary from managers where value exceeds the average amount from budgets for the same type.
SQL: | SELECT salary FROM managers AS mgr
WHERE value > (
SELECT COUNT(amount) FROM budgets AS budg
WHERE budg.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "budgets",
"outer_alias": "mgr",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_10664 | train | T1 |
v1 | Schema:
managers (alias: mgr)(type, value, name, date)
accounts(value, date, code, amount)
Task: Retrieve salary from managers whose status is found in accounts rows where id matches the outer record.
SQL: | SELECT salary FROM managers AS mgr
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_10665 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(salary, level, status, amount)
categories(amount, name, date, code)
Task: Retrieve salary from warehouses whose type is found in categories rows where status matches the outer record.
SQL: | SELECT salary FROM warehouses AS whs
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "categories",
"outer_alias": "whs",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_10666 | train | T2 |
v3 | Schema:
budgets (alias: budg)(salary, status, id, type)
items(code, status, name, date)
Task: Find salary from budgets where amount exceeds the average salary from items for the same level.
SQL: | SELECT salary FROM budgets AS budg
WHERE amount > (
SELECT MIN(salary) FROM items AS lne
WHERE lne.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "items",
"outer_alias": "budg",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_10667 | train | T2 |
v1 | Schema:
accounts (alias: acct)(type, date, code, status)
transactions(status, value, date, level)
Task: Find id from accounts where code appears in transactions entries with matching id.
SQL: | SELECT id FROM accounts AS acct
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_10668 | train | T1 |
v3 | Schema:
regions (alias: rgn)(amount, code, status, id)
sales(level, salary, value, amount)
Task: Retrieve amount from regions with amount above the SUM(value) of sales rows sharing the same status.
SQL: | SELECT amount FROM regions AS rgn
WHERE amount > (
SELECT SUM(value) FROM sales AS sale
WHERE sale.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_10669 | train | T2 |
v2 | Schema:
budgets (alias: budg)(name, level, date, amount)
products(salary, type, amount, code)
Task: Find id from budgets where a matching record exists in products with the same status.
SQL: | SELECT id FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "products",
"outer_alias": "budg",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_10670 | train | T2 |
v3 | Schema:
invoices (alias: inv)(salary, code, level, id)
items(level, id, salary, name)
Task: Retrieve amount from invoices with amount above the MIN(salary) of items rows sharing the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE amount > (
SELECT MIN(salary) FROM items AS lne
WHERE lne.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_10671 | train | T1 |
v3 | Schema:
budgets (alias: budg)(level, type, salary, status)
invoices(type, level, code, value)
Task: Find value from budgets where amount exceeds the average value from invoices for the same id.
SQL: | SELECT value FROM budgets AS budg
WHERE amount > (
SELECT MIN(value) FROM invoices AS inv
WHERE inv.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "invoices",
"outer_alias": "budg",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_10672 | train | T2 |
v1 | Schema:
customers (alias: cust)(date, value, amount, type)
transactions(level, amount, status, code)
Task: Select salary from customers where code exists in transactions for the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_10673 | train | T1 |
v2 | Schema:
categories (alias: catg)(status, type, value, level)
shipments(salary, code, amount, id)
Task: Find value from categories where a matching record exists in shipments with the same level.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_10674 | train | T2 |
v3 | Schema:
accounts (alias: acct)(date, value, code, amount)
customers(name, date, amount, type)
Task: Find id from accounts where salary exceeds the average salary from customers for the same code.
SQL: | SELECT id FROM accounts AS acct
WHERE salary > (
SELECT AVG(salary) FROM customers AS cust
WHERE cust.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_10675 | train | T1 |
v1 | Schema:
requests (alias: ordr)(amount, value, id, name)
categories(type, date, status, level)
Task: Find salary from requests where status appears in categories entries with matching level.
SQL: | SELECT salary FROM requests AS ordr
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_10676 | train | T2 |
v3 | Schema:
categories (alias: catg)(value, code, id, name)
services(amount, status, type, id)
Task: Find value from categories where value exceeds the average value from services for the same status.
SQL: | SELECT value FROM categories AS catg
WHERE value > (
SELECT AVG(value) FROM services AS srvc
WHERE srvc.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "services",
"outer_alias": "catg",
"inner_alias": "srvc",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_10677 | train | T2 |
v3 | Schema:
employees (alias: emp)(type, salary, date, id)
accounts(amount, code, date, level)
Task: Find value from employees where value exceeds the average amount from accounts for the same id.
SQL: | SELECT value FROM employees AS emp
WHERE value > (
SELECT AVG(amount) FROM accounts AS acct
WHERE acct.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_10678 | train | T1 |
v3 | Schema:
regions (alias: rgn)(status, name, level, salary)
accounts(status, salary, value, id)
Task: Find id from regions where salary exceeds the average salary from accounts for the same type.
SQL: | SELECT id FROM regions AS rgn
WHERE salary > (
SELECT COUNT(salary) 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": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_10679 | train | T2 |
v2 | Schema:
customers (alias: cust)(id, amount, status, salary)
invoices(code, value, type, id)
Task: Find salary from customers where a matching record exists in invoices with the same status.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_10680 | train | T1 |
v3 | Schema:
transactions (alias: txn)(type, value, name, date)
staff(type, value, status, code)
Task: Retrieve id from transactions with amount above the COUNT(value) of staff rows sharing the same type.
SQL: | SELECT id FROM transactions AS txn
WHERE amount > (
SELECT COUNT(value) FROM staff AS empl
WHERE empl.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_10681 | train | T1 |
v1 | Schema:
shipments (alias: shp)(status, level, name, salary)
customers(date, code, value, status)
Task: Find code from shipments where status appears in customers entries with matching id.
SQL: | SELECT code FROM shipments AS shp
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_10682 | train | T2 |
v2 | Schema:
budgets (alias: budg)(date, value, salary, name)
services(type, date, salary, name)
Task: Retrieve id from budgets that have at least one corresponding entry in services sharing the same level.
SQL: | SELECT id FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "services",
"outer_alias": "budg",
"inner_alias": "srvc",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_10683 | train | T2 |
v2 | Schema:
shipments (alias: shp)(status, value, id, level)
accounts(status, date, id, salary)
Task: Retrieve id from shipments that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_10684 | train | T2 |
v3 | Schema:
services (alias: srvc)(salary, id, status, amount)
employees(type, level, date, amount)
Task: Find id from services where value exceeds the average amount from employees for the same code.
SQL: | SELECT id FROM services AS srvc
WHERE value > (
SELECT COUNT(amount) FROM employees AS emp
WHERE emp.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "employees",
"outer_alias": "srvc",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_10685 | train | T2 |
v1 | Schema:
departments (alias: dept)(date, amount, type, value)
employees(type, level, code, name)
Task: Retrieve amount from departments whose code is found in employees rows where code matches the outer record.
SQL: | SELECT amount FROM departments AS dept
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_10686 | train | T1 |
v1 | Schema:
shipments (alias: shp)(id, amount, level, type)
products(level, value, date, status)
Task: Retrieve value from shipments whose status is found in products rows where id matches the outer record.
SQL: | SELECT value FROM shipments AS shp
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_10687 | train | T2 |
v1 | Schema:
schedules (alias: schd)(amount, date, status, level)
budgets(code, salary, date, level)
Task: Select name from schedules where type exists in budgets for the same code.
SQL: | SELECT name FROM schedules AS schd
WHERE type IN (
SELECT type FROM budgets AS budg
WHERE budg.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "budgets",
"outer_alias": "schd",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_10688 | train | T2 |
v2 | Schema:
managers (alias: mgr)(salary, id, value, type)
employees(level, code, salary, name)
Task: Retrieve value from managers that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_10689 | train | T1 |
v2 | Schema:
staff (alias: empl)(salary, value, code, id)
customers(code, status, level, salary)
Task: Retrieve name from staff that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_10690 | train | T2 |
v1 | Schema:
departments (alias: dept)(name, type, level, date)
employees(status, salary, amount, type)
Task: Select salary from departments where type exists in employees for the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_10691 | train | T1 |
v2 | Schema:
employees (alias: emp)(value, type, date, level)
staff(id, name, salary, code)
Task: Find code from employees where a matching record exists in staff with the same id.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_10692 | train | T1 |
v3 | Schema:
shipments (alias: shp)(type, salary, name, id)
managers(code, status, date, type)
Task: Retrieve id from shipments with value above the COUNT(value) of managers rows sharing the same status.
SQL: | SELECT id FROM shipments AS shp
WHERE value > (
SELECT COUNT(value) FROM managers AS mgr
WHERE mgr.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_10693 | train | T2 |
v2 | Schema:
transactions (alias: txn)(salary, date, name, level)
accounts(type, name, code, amount)
Task: Retrieve value from transactions that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_10694 | train | T1 |
v3 | Schema:
sales (alias: sale)(name, amount, salary, level)
invoices(salary, level, id, type)
Task: Retrieve id from sales with salary above the MIN(amount) of invoices rows sharing the same code.
SQL: | SELECT id FROM sales AS sale
WHERE salary > (
SELECT MIN(amount) FROM invoices AS inv
WHERE inv.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_10695 | train | T1 |
v1 | Schema:
requests (alias: ordr)(date, level, id, salary)
staff(name, level, status, id)
Task: Retrieve value from requests whose id is found in staff rows where status matches the outer record.
SQL: | SELECT value FROM requests AS ordr
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_10696 | train | T2 |
v3 | Schema:
shipments (alias: shp)(status, type, code, id)
managers(amount, value, id, name)
Task: Retrieve id from shipments with value above the COUNT(value) of managers rows sharing the same id.
SQL: | SELECT id FROM shipments AS shp
WHERE value > (
SELECT COUNT(value) FROM managers AS mgr
WHERE mgr.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_10697 | train | T2 |
v1 | Schema:
customers (alias: cust)(code, level, name, salary)
departments(value, date, name, status)
Task: Select value from customers where level exists in departments for the same level.
SQL: | SELECT value FROM customers AS cust
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_10698 | train | T1 |
v3 | Schema:
managers (alias: mgr)(amount, value, level, id)
staff(amount, salary, value, status)
Task: Retrieve id from managers with salary above the MAX(amount) of staff rows sharing the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE salary > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_10699 | train | T1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.