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:
schedules (alias: schd)(level, value, type, status)
warehouses(amount, id, level, code)
Task: Select value from schedules where id exists in warehouses for the same status.
SQL: | SELECT value FROM schedules AS schd
WHERE id IN (
SELECT id FROM warehouses AS whs
WHERE whs.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "warehouses",
"outer_alias": "schd",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_04600 | train | T2 |
v1 | Schema:
transactions (alias: txn)(value, id, code, type)
managers(id, status, value, amount)
Task: Retrieve code from transactions whose id is found in managers rows where id matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_04601 | train | T1 |
v1 | Schema:
categories (alias: catg)(status, value, type, level)
budgets(amount, salary, value, level)
Task: Find salary from categories where type appears in budgets entries with matching status.
SQL: | SELECT salary FROM categories AS catg
WHERE type IN (
SELECT type FROM budgets AS budg
WHERE budg.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "budgets",
"outer_alias": "catg",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_04602 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(code, level, id, type)
items(id, name, code, type)
Task: Find amount from warehouses where a matching record exists in items with the same level.
SQL: | SELECT amount 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": "amount",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_04603 | train | T2 |
v3 | Schema:
products (alias: prod)(value, status, id, type)
budgets(code, id, date, value)
Task: Retrieve salary from products with salary above the MAX(amount) of budgets rows sharing the same level.
SQL: | SELECT salary FROM products AS prod
WHERE salary > (
SELECT MAX(amount) FROM budgets AS budg
WHERE budg.level = prod.level
); | {
"outer_table": "products",
"inner_table": "budgets",
"outer_alias": "prod",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_04604 | train | T1 |
v1 | Schema:
items (alias: lne)(date, level, id, amount)
requests(name, value, amount, salary)
Task: Retrieve amount from items whose status is found in requests rows where code matches the outer record.
SQL: | SELECT amount FROM items AS lne
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_04605 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(type, code, id, name)
transactions(amount, name, id, level)
Task: Retrieve code from warehouses whose id is found in transactions rows where level matches the outer record.
SQL: | SELECT code FROM warehouses AS whs
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "transactions",
"outer_alias": "whs",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_04606 | train | T2 |
v1 | Schema:
invoices (alias: inv)(type, level, code, date)
customers(status, name, level, amount)
Task: Select code from invoices where status exists in customers for the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_04607 | train | T1 |
v2 | Schema:
customers (alias: cust)(type, value, date, level)
products(name, type, value, level)
Task: Find name from customers where a matching record exists in products with the same code.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_04608 | train | T1 |
v3 | Schema:
departments (alias: dept)(value, name, level, amount)
orders(type, code, date, level)
Task: Find salary from departments where value exceeds the average amount from orders for the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE value > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_04609 | train | T1 |
v3 | Schema:
sales (alias: sale)(name, level, amount, id)
requests(level, date, name, code)
Task: Find name from sales where value exceeds the average value from requests for the same type.
SQL: | SELECT name FROM sales AS sale
WHERE value > (
SELECT COUNT(value) FROM requests AS ordr
WHERE ordr.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_04610 | train | T1 |
v2 | Schema:
transactions (alias: txn)(amount, status, level, salary)
regions(salary, code, value, type)
Task: Retrieve amount from transactions that have at least one corresponding entry in regions sharing the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_04611 | train | T1 |
v2 | Schema:
budgets (alias: budg)(type, value, status, level)
managers(amount, type, level, status)
Task: Find salary from budgets where a matching record exists in managers with the same status.
SQL: | SELECT salary FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "managers",
"outer_alias": "budg",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_04612 | train | T2 |
v3 | Schema:
accounts (alias: acct)(value, code, name, salary)
requests(id, amount, type, salary)
Task: Retrieve amount from accounts with amount above the AVG(salary) of requests rows sharing the same level.
SQL: | SELECT amount FROM accounts AS acct
WHERE amount > (
SELECT AVG(salary) FROM requests AS ordr
WHERE ordr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_04613 | train | T1 |
v1 | Schema:
products (alias: prod)(amount, date, level, type)
orders(type, amount, level, code)
Task: Find name from products where status appears in orders entries with matching level.
SQL: | SELECT name FROM products AS prod
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.level = prod.level
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_04614 | train | T1 |
v3 | Schema:
invoices (alias: inv)(date, value, type, code)
items(status, type, salary, date)
Task: Find amount from invoices where value exceeds the average value from items for the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE value > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_04615 | train | T1 |
v1 | Schema:
invoices (alias: inv)(code, level, name, status)
budgets(type, amount, date, value)
Task: Select salary from invoices where id exists in budgets for the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE id IN (
SELECT id FROM budgets AS budg
WHERE budg.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "budgets",
"outer_alias": "inv",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_04616 | train | T1 |
v2 | Schema:
shipments (alias: shp)(name, amount, status, type)
categories(id, code, name, type)
Task: Find name from shipments where a matching record exists in categories with the same level.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_04617 | train | T2 |
v2 | Schema:
invoices (alias: inv)(level, date, code, amount)
schedules(name, status, code, value)
Task: Find id from invoices where a matching record exists in schedules with the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_04618 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(name, code, status, type)
departments(salary, date, amount, id)
Task: Retrieve amount from warehouses whose level is found in departments rows where status matches the outer record.
SQL: | SELECT amount FROM warehouses AS whs
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "departments",
"outer_alias": "whs",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_04619 | train | T2 |
v1 | Schema:
items (alias: lne)(value, id, level, type)
shipments(type, level, value, salary)
Task: Find id from items where level appears in shipments entries with matching code.
SQL: | SELECT id FROM items AS lne
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.code = lne.code
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_04620 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(value, id, name, status)
items(salary, id, date, amount)
Task: Retrieve amount from warehouses with value above the SUM(salary) of items rows sharing the same id.
SQL: | SELECT amount FROM warehouses AS whs
WHERE value > (
SELECT SUM(salary) FROM items AS lne
WHERE lne.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "items",
"outer_alias": "whs",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_04621 | train | T2 |
v3 | Schema:
budgets (alias: budg)(date, status, amount, code)
accounts(level, code, id, value)
Task: Find code from budgets where salary exceeds the average amount from accounts for the same code.
SQL: | SELECT code FROM budgets AS budg
WHERE salary > (
SELECT SUM(amount) FROM accounts AS acct
WHERE acct.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "accounts",
"outer_alias": "budg",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_04622 | train | T2 |
v2 | Schema:
employees (alias: emp)(id, date, code, level)
products(code, id, type, amount)
Task: Retrieve name from employees that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_04623 | train | T1 |
v2 | Schema:
transactions (alias: txn)(amount, code, date, salary)
staff(id, salary, status, value)
Task: Find id from transactions where a matching record exists in staff with the same level.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_04624 | train | T1 |
v3 | Schema:
requests (alias: ordr)(id, value, level, name)
schedules(status, level, amount, code)
Task: Retrieve salary from requests with value above the SUM(value) of schedules rows sharing the same type.
SQL: | SELECT salary FROM requests AS ordr
WHERE value > (
SELECT SUM(value) FROM schedules AS schd
WHERE schd.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_04625 | train | T2 |
v1 | Schema:
accounts (alias: acct)(level, code, value, date)
employees(value, type, salary, level)
Task: Select salary from accounts where type exists in employees for the same type.
SQL: | SELECT salary FROM accounts AS acct
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_04626 | train | T1 |
v3 | Schema:
requests (alias: ordr)(status, id, value, level)
staff(salary, code, name, status)
Task: Find name from requests where salary exceeds the average value from staff for the same level.
SQL: | SELECT name FROM requests AS ordr
WHERE salary > (
SELECT MIN(value) FROM staff AS empl
WHERE empl.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_04627 | train | T2 |
v2 | Schema:
budgets (alias: budg)(id, date, type, code)
accounts(date, type, status, amount)
Task: Retrieve amount from budgets that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT amount FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "accounts",
"outer_alias": "budg",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_04628 | train | T2 |
v1 | Schema:
customers (alias: cust)(amount, code, value, type)
requests(status, level, id, date)
Task: Select value from customers where type exists in requests for the same type.
SQL: | SELECT value FROM customers AS cust
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_04629 | train | T1 |
v1 | Schema:
shipments (alias: shp)(type, name, level, amount)
sales(code, value, name, status)
Task: Select id from shipments where code exists in sales for the same type.
SQL: | SELECT id FROM shipments AS shp
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_04630 | train | T2 |
v2 | Schema:
schedules (alias: schd)(type, salary, amount, level)
sales(code, value, type, name)
Task: Retrieve salary from schedules that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_04631 | train | T2 |
v3 | Schema:
shipments (alias: shp)(type, value, id, name)
categories(level, status, id, amount)
Task: Find code from shipments where salary exceeds the average value from categories for the same code.
SQL: | SELECT code FROM shipments AS shp
WHERE salary > (
SELECT MIN(value) FROM categories AS catg
WHERE catg.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_04632 | train | T2 |
v3 | Schema:
accounts (alias: acct)(name, type, status, value)
transactions(type, salary, date, id)
Task: Retrieve id from accounts with salary above the AVG(value) of transactions rows sharing the same type.
SQL: | SELECT id FROM accounts AS acct
WHERE salary > (
SELECT AVG(value) FROM transactions AS txn
WHERE txn.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_04633 | train | T1 |
v3 | Schema:
departments (alias: dept)(code, type, date, amount)
regions(id, type, level, name)
Task: Find code from departments where amount exceeds the average value from regions for the same id.
SQL: | SELECT code FROM departments AS dept
WHERE amount > (
SELECT SUM(value) FROM regions AS rgn
WHERE rgn.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_04634 | train | T1 |
v3 | Schema:
employees (alias: emp)(amount, level, date, value)
warehouses(salary, amount, code, value)
Task: Retrieve code from employees with salary above the AVG(amount) of warehouses rows sharing the same level.
SQL: | SELECT code FROM employees AS emp
WHERE salary > (
SELECT AVG(amount) FROM warehouses AS whs
WHERE whs.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "warehouses",
"outer_alias": "emp",
"inner_alias": "whs",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_04635 | train | T1 |
v3 | Schema:
budgets (alias: budg)(id, type, code, status)
sales(amount, value, name, id)
Task: Find id from budgets where amount exceeds the average amount from sales for the same type.
SQL: | SELECT id FROM budgets AS budg
WHERE amount > (
SELECT SUM(amount) FROM sales AS sale
WHERE sale.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "sales",
"outer_alias": "budg",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_04636 | train | T2 |
v3 | Schema:
schedules (alias: schd)(status, name, amount, value)
categories(amount, date, name, value)
Task: Retrieve salary from schedules with salary above the COUNT(salary) of categories rows sharing the same level.
SQL: | SELECT salary FROM schedules AS schd
WHERE salary > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_04637 | train | T2 |
v1 | Schema:
regions (alias: rgn)(name, id, code, date)
categories(type, amount, value, id)
Task: Find id from regions where status appears in categories entries with matching type.
SQL: | SELECT id FROM regions AS rgn
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_04638 | train | T2 |
v1 | Schema:
orders (alias: ord)(level, amount, status, value)
items(type, value, id, code)
Task: Retrieve value from orders whose type is found in items rows where id matches the outer record.
SQL: | SELECT value FROM orders AS ord
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_04639 | train | T1 |
v3 | Schema:
regions (alias: rgn)(level, id, type, date)
items(value, name, amount, date)
Task: Retrieve amount from regions with value above the SUM(amount) of items rows sharing the same type.
SQL: | SELECT amount FROM regions AS rgn
WHERE value > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_04640 | train | T2 |
v2 | Schema:
sales (alias: sale)(code, level, value, id)
orders(status, amount, date, value)
Task: Find id from sales where a matching record exists in orders with the same status.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_04641 | train | T1 |
v1 | Schema:
departments (alias: dept)(status, salary, type, code)
items(level, date, code, amount)
Task: Select name from departments where status exists in items for the same level.
SQL: | SELECT name FROM departments AS dept
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_04642 | train | T1 |
v2 | Schema:
transactions (alias: txn)(status, date, salary, id)
customers(id, type, status, amount)
Task: Retrieve name from transactions that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_04643 | train | T1 |
v1 | Schema:
managers (alias: mgr)(code, salary, status, name)
orders(code, amount, id, salary)
Task: Select amount from managers where status exists in orders for the same status.
SQL: | SELECT amount FROM managers AS mgr
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_04644 | train | T1 |
v3 | Schema:
schedules (alias: schd)(value, date, id, amount)
warehouses(name, code, amount, salary)
Task: Retrieve name from schedules with value above the COUNT(amount) of warehouses rows sharing the same id.
SQL: | SELECT name FROM schedules AS schd
WHERE value > (
SELECT COUNT(amount) FROM warehouses AS whs
WHERE whs.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "warehouses",
"outer_alias": "schd",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_04645 | train | T2 |
v2 | Schema:
products (alias: prod)(level, id, amount, value)
customers(status, value, type, date)
Task: Retrieve code from products that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = prod.id
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_04646 | train | T1 |
v3 | Schema:
schedules (alias: schd)(level, id, type, salary)
warehouses(amount, value, type, status)
Task: Find id from schedules where amount exceeds the average salary from warehouses for the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE amount > (
SELECT SUM(salary) FROM warehouses AS whs
WHERE whs.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "warehouses",
"outer_alias": "schd",
"inner_alias": "whs",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_04647 | train | T2 |
v2 | Schema:
invoices (alias: inv)(amount, status, value, level)
regions(name, amount, salary, status)
Task: Retrieve amount from invoices that have at least one corresponding entry in regions sharing the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_04648 | train | T1 |
v3 | Schema:
budgets (alias: budg)(name, value, code, salary)
customers(type, value, amount, name)
Task: Find amount from budgets where salary exceeds the average value from customers for the same id.
SQL: | SELECT amount FROM budgets AS budg
WHERE salary > (
SELECT MIN(value) FROM customers AS cust
WHERE cust.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "customers",
"outer_alias": "budg",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_04649 | train | T2 |
v3 | Schema:
managers (alias: mgr)(level, amount, type, code)
sales(type, date, amount, level)
Task: Find name from managers where value exceeds the average amount from sales for the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE value > (
SELECT AVG(amount) FROM sales AS sale
WHERE sale.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_04650 | train | T1 |
v2 | Schema:
orders (alias: ord)(level, salary, code, type)
products(value, type, salary, status)
Task: Find amount from orders where a matching record exists in products with the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_04651 | train | T1 |
v1 | Schema:
regions (alias: rgn)(type, name, id, date)
customers(type, amount, id, level)
Task: Find amount from regions where level appears in customers entries with matching id.
SQL: | SELECT amount FROM regions AS rgn
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_04652 | train | T2 |
v3 | Schema:
products (alias: prod)(code, id, status, salary)
warehouses(value, level, id, salary)
Task: Retrieve salary from products with amount above the SUM(value) of warehouses rows sharing the same level.
SQL: | SELECT salary FROM products AS prod
WHERE amount > (
SELECT SUM(value) FROM warehouses AS whs
WHERE whs.level = prod.level
); | {
"outer_table": "products",
"inner_table": "warehouses",
"outer_alias": "prod",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_04653 | train | T1 |
v2 | Schema:
accounts (alias: acct)(code, type, level, id)
schedules(type, amount, name, status)
Task: Find salary from accounts where a matching record exists in schedules with the same type.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_04654 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(value, salary, level, status)
regions(type, amount, name, salary)
Task: Retrieve id from warehouses whose level is found in regions rows where code matches the outer record.
SQL: | SELECT id FROM warehouses AS whs
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "regions",
"outer_alias": "whs",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_04655 | train | T2 |
v1 | Schema:
budgets (alias: budg)(id, value, status, salary)
transactions(code, type, value, salary)
Task: Retrieve id from budgets whose level is found in transactions rows where level matches the outer record.
SQL: | SELECT id FROM budgets AS budg
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "transactions",
"outer_alias": "budg",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_04656 | train | T2 |
v2 | Schema:
employees (alias: emp)(code, value, level, date)
departments(status, type, amount, name)
Task: Find salary from employees where a matching record exists in departments with the same level.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_04657 | train | T1 |
v1 | Schema:
departments (alias: dept)(id, value, code, type)
shipments(amount, code, id, salary)
Task: Select salary from departments where status exists in shipments for the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_04658 | train | T1 |
v2 | Schema:
schedules (alias: schd)(value, level, amount, status)
warehouses(type, code, value, status)
Task: Find value from schedules where a matching record exists in warehouses with the same code.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "warehouses",
"outer_alias": "schd",
"inner_alias": "whs",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_04659 | train | T2 |
v1 | Schema:
products (alias: prod)(status, code, name, type)
transactions(type, id, amount, salary)
Task: Select amount from products where status exists in transactions for the same level.
SQL: | SELECT amount FROM products AS prod
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.level = prod.level
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_04660 | train | T1 |
v2 | Schema:
schedules (alias: schd)(code, amount, status, salary)
staff(id, date, code, salary)
Task: Find id from schedules where a matching record exists in staff with the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_04661 | train | T2 |
v1 | Schema:
shipments (alias: shp)(salary, date, level, id)
accounts(code, status, name, type)
Task: Find amount from shipments where type appears in accounts entries with matching level.
SQL: | SELECT amount FROM shipments AS shp
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_04662 | train | T2 |
v1 | Schema:
employees (alias: emp)(amount, value, date, code)
categories(name, level, type, amount)
Task: Retrieve value from employees whose status is found in categories rows where type matches the outer record.
SQL: | SELECT value FROM employees AS emp
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_04663 | train | T1 |
v1 | Schema:
requests (alias: ordr)(value, type, salary, amount)
shipments(date, code, salary, value)
Task: Select code from requests where status exists in shipments for the same type.
SQL: | SELECT code FROM requests AS ordr
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_04664 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(type, level, value, id)
schedules(type, id, value, date)
Task: Find name from warehouses where salary exceeds the average amount from schedules for the same level.
SQL: | SELECT name FROM warehouses AS whs
WHERE salary > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "schedules",
"outer_alias": "whs",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_04665 | train | T2 |
v1 | Schema:
sales (alias: sale)(code, amount, salary, level)
budgets(id, date, name, amount)
Task: Retrieve id from sales whose code is found in budgets rows where status matches the outer record.
SQL: | SELECT id FROM sales AS sale
WHERE code IN (
SELECT code FROM budgets AS budg
WHERE budg.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "budgets",
"outer_alias": "sale",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_04666 | train | T1 |
v2 | Schema:
managers (alias: mgr)(value, amount, status, code)
regions(type, level, code, salary)
Task: Retrieve value from managers that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_04667 | train | T1 |
v2 | Schema:
requests (alias: ordr)(value, amount, level, status)
categories(code, salary, id, type)
Task: Find amount from requests where a matching record exists in categories with the same code.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_04668 | train | T2 |
v1 | Schema:
products (alias: prod)(date, level, status, id)
sales(status, salary, value, date)
Task: Select id from products where level exists in sales for the same code.
SQL: | SELECT id FROM products AS prod
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.code = prod.code
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_04669 | train | T1 |
v2 | Schema:
services (alias: srvc)(amount, salary, level, status)
employees(status, name, code, id)
Task: Retrieve value from services that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT value FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "employees",
"outer_alias": "srvc",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_04670 | train | T2 |
v1 | Schema:
managers (alias: mgr)(amount, id, level, code)
orders(code, value, amount, date)
Task: Retrieve name from managers whose id is found in orders rows where id matches the outer record.
SQL: | SELECT name FROM managers AS mgr
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_04671 | train | T1 |
v1 | Schema:
departments (alias: dept)(salary, code, id, type)
items(level, amount, value, id)
Task: Find name from departments where level appears in items entries with matching type.
SQL: | SELECT name FROM departments AS dept
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_04672 | train | T1 |
v3 | Schema:
departments (alias: dept)(salary, name, status, type)
items(value, code, amount, level)
Task: Find value from departments where value exceeds the average salary from items for the same type.
SQL: | SELECT value FROM departments AS dept
WHERE value > (
SELECT SUM(salary) FROM items AS lne
WHERE lne.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_04673 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(value, salary, level, type)
invoices(status, id, salary, value)
Task: Retrieve id from warehouses that have at least one corresponding entry in invoices sharing the same code.
SQL: | SELECT id FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "invoices",
"outer_alias": "whs",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_04674 | train | T2 |
v2 | Schema:
customers (alias: cust)(id, value, name, type)
items(level, amount, salary, status)
Task: Retrieve value from customers that have at least one corresponding entry in items sharing the same status.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_04675 | train | T1 |
v3 | Schema:
schedules (alias: schd)(status, type, code, level)
staff(value, level, id, date)
Task: Retrieve amount from schedules with value above the COUNT(salary) of staff rows sharing the same type.
SQL: | SELECT amount FROM schedules AS schd
WHERE value > (
SELECT COUNT(salary) FROM staff AS empl
WHERE empl.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_04676 | train | T2 |
v2 | Schema:
customers (alias: cust)(type, name, date, level)
orders(value, code, level, salary)
Task: Retrieve salary from customers that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_04677 | train | T1 |
v1 | Schema:
services (alias: srvc)(name, value, code, type)
managers(type, date, name, id)
Task: Select value from services where id exists in managers for the same code.
SQL: | SELECT value FROM services AS srvc
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "managers",
"outer_alias": "srvc",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_04678 | train | T2 |
v1 | Schema:
requests (alias: ordr)(status, date, salary, code)
products(date, amount, id, level)
Task: Retrieve salary from requests whose code is found in products rows where id matches the outer record.
SQL: | SELECT salary FROM requests AS ordr
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_04679 | train | T2 |
v2 | Schema:
invoices (alias: inv)(id, level, salary, value)
customers(name, level, date, value)
Task: Retrieve value from invoices that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_04680 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(amount, salary, name, level)
items(status, level, amount, date)
Task: Retrieve id from warehouses whose type is found in items rows where type matches the outer record.
SQL: | SELECT id FROM warehouses AS whs
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "items",
"outer_alias": "whs",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_04681 | train | T2 |
v2 | Schema:
items (alias: lne)(value, code, name, status)
transactions(id, code, name, value)
Task: Find salary from items where a matching record exists in transactions with the same level.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_04682 | train | T2 |
v1 | Schema:
schedules (alias: schd)(id, date, level, value)
services(amount, level, id, code)
Task: Find name from schedules where status appears in services entries with matching code.
SQL: | SELECT name FROM schedules AS schd
WHERE status IN (
SELECT status FROM services AS srvc
WHERE srvc.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "services",
"outer_alias": "schd",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_04683 | train | T2 |
v3 | Schema:
transactions (alias: txn)(value, code, name, id)
warehouses(date, amount, value, code)
Task: Retrieve value from transactions with value above the MIN(value) of warehouses rows sharing the same status.
SQL: | SELECT value FROM transactions AS txn
WHERE value > (
SELECT MIN(value) FROM warehouses AS whs
WHERE whs.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "warehouses",
"outer_alias": "txn",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_04684 | train | T1 |
v1 | Schema:
shipments (alias: shp)(value, type, level, salary)
regions(type, status, amount, name)
Task: Select salary from shipments where id exists in regions for the same code.
SQL: | SELECT salary FROM shipments AS shp
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_04685 | train | T2 |
v1 | Schema:
customers (alias: cust)(date, level, name, salary)
departments(id, level, value, salary)
Task: Find id from customers where status appears in departments entries with matching type.
SQL: | SELECT id FROM customers AS cust
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_04686 | train | T1 |
v1 | Schema:
managers (alias: mgr)(value, salary, level, name)
regions(code, amount, salary, status)
Task: Select code from managers where type exists in regions for the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_04687 | train | T1 |
v2 | Schema:
schedules (alias: schd)(amount, code, level, salary)
requests(level, code, value, salary)
Task: Find id from schedules where a matching record exists in requests with the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_04688 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(name, salary, level, date)
regions(level, code, id, amount)
Task: Find name from warehouses where status appears in regions entries with matching id.
SQL: | SELECT name FROM warehouses AS whs
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "regions",
"outer_alias": "whs",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_04689 | train | T2 |
v3 | Schema:
customers (alias: cust)(type, amount, salary, id)
employees(code, amount, salary, status)
Task: Find amount from customers where salary exceeds the average salary from employees for the same type.
SQL: | SELECT amount FROM customers AS cust
WHERE salary > (
SELECT COUNT(salary) FROM employees AS emp
WHERE emp.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_04690 | train | T1 |
v3 | Schema:
shipments (alias: shp)(code, salary, value, name)
staff(name, level, value, amount)
Task: Retrieve id from shipments with salary above the SUM(value) of staff rows sharing the same id.
SQL: | SELECT id FROM shipments AS shp
WHERE salary > (
SELECT SUM(value) FROM staff AS empl
WHERE empl.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_04691 | train | T2 |
v3 | Schema:
items (alias: lne)(salary, level, id, date)
schedules(amount, date, code, id)
Task: Retrieve salary from items with value above the MIN(value) of schedules rows sharing the same status.
SQL: | SELECT salary FROM items AS lne
WHERE value > (
SELECT MIN(value) FROM schedules AS schd
WHERE schd.status = lne.status
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_04692 | train | T2 |
v1 | Schema:
invoices (alias: inv)(status, value, id, salary)
regions(level, salary, amount, type)
Task: Retrieve value from invoices whose code is found in regions rows where code matches the outer record.
SQL: | SELECT value FROM invoices AS inv
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_04693 | train | T1 |
v1 | Schema:
categories (alias: catg)(salary, level, amount, id)
staff(name, level, type, status)
Task: Retrieve id from categories whose id is found in staff rows where code matches the outer record.
SQL: | SELECT id FROM categories AS catg
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_04694 | train | T2 |
v2 | Schema:
employees (alias: emp)(code, salary, type, amount)
accounts(date, name, status, code)
Task: Find id from employees where a matching record exists in accounts with the same code.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_04695 | train | T1 |
v1 | Schema:
departments (alias: dept)(id, type, status, amount)
managers(amount, date, value, code)
Task: Select amount from departments where code exists in managers for the same id.
SQL: | SELECT amount FROM departments AS dept
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_04696 | train | T1 |
v1 | Schema:
staff (alias: empl)(level, amount, value, id)
managers(amount, code, level, date)
Task: Retrieve amount from staff whose id is found in managers rows where code matches the outer record.
SQL: | SELECT amount FROM staff AS empl
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_04697 | train | T2 |
v1 | Schema:
categories (alias: catg)(level, date, id, status)
orders(level, value, id, status)
Task: Retrieve amount from categories whose type is found in orders rows where type matches the outer record.
SQL: | SELECT amount FROM categories AS catg
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_04698 | train | T2 |
v1 | Schema:
accounts (alias: acct)(type, value, name, code)
departments(salary, amount, status, code)
Task: Retrieve value from accounts whose level is found in departments rows where status matches the outer record.
SQL: | SELECT value FROM accounts AS acct
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_04699 | train | T1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.