variant stringclasses 3
values | prompt stringlengths 163 237 | sql stringlengths 103 143 | metadata unknown | id stringlengths 21 21 | split stringclasses 1
value | token_group stringclasses 2
values |
|---|---|---|---|---|---|---|
v2 | Schema:
requests (alias: ordr)(level, id, name, value)
customers(date, value, amount, salary)
Task: Find code from requests where a matching record exists in customers with the same level.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_06600 | train | T2 |
v2 | Schema:
schedules (alias: schd)(date, name, type, level)
products(salary, amount, status, type)
Task: Find id from schedules where a matching record exists in products with the same level.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_06601 | train | T2 |
v3 | Schema:
regions (alias: rgn)(type, salary, amount, value)
transactions(name, code, status, value)
Task: Retrieve name from regions with salary above the MAX(salary) of transactions rows sharing the same id.
SQL: | SELECT name FROM regions AS rgn
WHERE salary > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_06602 | train | T2 |
v1 | Schema:
departments (alias: dept)(amount, code, type, status)
categories(status, salary, code, name)
Task: Retrieve code from departments whose code is found in categories rows where level matches the outer record.
SQL: | SELECT code FROM departments AS dept
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_06603 | train | T1 |
v1 | Schema:
schedules (alias: schd)(amount, salary, status, date)
sales(code, value, salary, name)
Task: Find code from schedules where code appears in sales entries with matching code.
SQL: | SELECT code FROM schedules AS schd
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_06604 | train | T2 |
v1 | Schema:
staff (alias: empl)(salary, id, status, code)
services(salary, level, code, name)
Task: Retrieve value from staff whose type is found in services rows where level matches the outer record.
SQL: | SELECT value FROM staff AS empl
WHERE type IN (
SELECT type FROM services AS srvc
WHERE srvc.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "services",
"outer_alias": "empl",
"inner_alias": "srvc",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_06605 | train | T2 |
v2 | Schema:
requests (alias: ordr)(amount, code, date, type)
items(date, code, name, type)
Task: Retrieve amount from requests that have at least one corresponding entry in items sharing the same code.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_06606 | train | T2 |
v2 | Schema:
accounts (alias: acct)(status, level, code, amount)
schedules(code, status, value, name)
Task: Retrieve value from accounts that have at least one corresponding entry in schedules sharing the same level.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_06607 | train | T1 |
v2 | Schema:
budgets (alias: budg)(level, amount, value, type)
invoices(salary, code, date, level)
Task: Find amount from budgets where a matching record exists in invoices with the same status.
SQL: | SELECT amount FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "invoices",
"outer_alias": "budg",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_06608 | train | T2 |
v3 | Schema:
schedules (alias: schd)(id, date, amount, level)
services(type, date, status, id)
Task: Find name from schedules where salary exceeds the average value from services for the same status.
SQL: | SELECT name FROM schedules AS schd
WHERE salary > (
SELECT SUM(value) FROM services AS srvc
WHERE srvc.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "services",
"outer_alias": "schd",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_06609 | train | T2 |
v3 | Schema:
items (alias: lne)(amount, salary, type, status)
customers(level, status, date, id)
Task: Find name from items where amount exceeds the average amount from customers for the same id.
SQL: | SELECT name FROM items AS lne
WHERE amount > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.id = lne.id
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_06610 | train | T2 |
v1 | Schema:
accounts (alias: acct)(status, level, salary, value)
departments(type, id, date, amount)
Task: Retrieve name from accounts whose status is found in departments rows where id matches the outer record.
SQL: | SELECT name FROM accounts AS acct
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_06611 | train | T1 |
v3 | Schema:
services (alias: srvc)(value, status, name, id)
staff(name, id, status, level)
Task: Retrieve amount from services with amount above the MAX(value) of staff rows sharing the same code.
SQL: | SELECT amount FROM services AS srvc
WHERE amount > (
SELECT MAX(value) FROM staff AS empl
WHERE empl.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "staff",
"outer_alias": "srvc",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_06612 | train | T2 |
v3 | Schema:
staff (alias: empl)(id, salary, value, date)
sales(value, code, level, amount)
Task: Find amount from staff where value exceeds the average value from sales for the same status.
SQL: | SELECT amount FROM staff AS empl
WHERE value > (
SELECT MIN(value) FROM sales AS sale
WHERE sale.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_06613 | train | T2 |
v1 | Schema:
items (alias: lne)(value, date, status, type)
invoices(amount, value, status, level)
Task: Select name from items where type exists in invoices for the same code.
SQL: | SELECT name FROM items AS lne
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.code = lne.code
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_06614 | train | T2 |
v3 | Schema:
customers (alias: cust)(value, code, salary, id)
accounts(type, value, amount, salary)
Task: Retrieve amount from customers with value above the COUNT(amount) of accounts rows sharing the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE value > (
SELECT COUNT(amount) FROM accounts AS acct
WHERE acct.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_06615 | train | T1 |
v1 | Schema:
regions (alias: rgn)(value, amount, status, date)
items(date, amount, salary, type)
Task: Find id from regions where code appears in items entries with matching level.
SQL: | SELECT id FROM regions AS rgn
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_06616 | train | T2 |
v1 | Schema:
budgets (alias: budg)(salary, status, value, code)
accounts(salary, status, name, code)
Task: Retrieve name from budgets whose level is found in accounts rows where code matches the outer record.
SQL: | SELECT name FROM budgets AS budg
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "accounts",
"outer_alias": "budg",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_06617 | train | T2 |
v1 | Schema:
employees (alias: emp)(name, level, type, id)
orders(name, id, status, date)
Task: Retrieve code from employees whose level is found in orders rows where level matches the outer record.
SQL: | SELECT code FROM employees AS emp
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_06618 | train | T1 |
v2 | Schema:
invoices (alias: inv)(status, level, code, salary)
staff(amount, salary, code, type)
Task: Retrieve name from invoices that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_06619 | train | T1 |
v3 | Schema:
staff (alias: empl)(value, date, status, id)
services(salary, type, name, level)
Task: Retrieve id from staff with salary above the SUM(amount) of services rows sharing the same code.
SQL: | SELECT id FROM staff AS empl
WHERE salary > (
SELECT SUM(amount) FROM services AS srvc
WHERE srvc.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "services",
"outer_alias": "empl",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_06620 | train | T2 |
v3 | Schema:
items (alias: lne)(type, salary, level, status)
requests(level, amount, name, code)
Task: Retrieve code from items with value above the MIN(salary) of requests rows sharing the same status.
SQL: | SELECT code FROM items AS lne
WHERE value > (
SELECT MIN(salary) FROM requests AS ordr
WHERE ordr.status = lne.status
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_06621 | train | T2 |
v1 | Schema:
products (alias: prod)(value, name, date, amount)
accounts(salary, status, amount, date)
Task: Find code from products where code appears in accounts entries with matching level.
SQL: | SELECT code FROM products AS prod
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.level = prod.level
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_06622 | train | T1 |
v2 | Schema:
budgets (alias: budg)(id, status, salary, value)
products(status, salary, value, level)
Task: Retrieve value from budgets that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT value FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "products",
"outer_alias": "budg",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_06623 | train | T2 |
v3 | Schema:
employees (alias: emp)(value, level, name, salary)
accounts(code, amount, id, type)
Task: Find id from employees where amount exceeds the average amount from accounts for the same code.
SQL: | SELECT id FROM employees AS emp
WHERE amount > (
SELECT COUNT(amount) FROM accounts AS acct
WHERE acct.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_06624 | train | T1 |
v1 | Schema:
accounts (alias: acct)(id, level, status, value)
categories(date, salary, name, type)
Task: Select salary from accounts where code exists in categories for the same id.
SQL: | SELECT salary FROM accounts AS acct
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_06625 | train | T1 |
v1 | Schema:
accounts (alias: acct)(level, status, date, amount)
staff(salary, id, amount, level)
Task: Select code from accounts where status exists in staff for the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_06626 | train | T1 |
v1 | Schema:
customers (alias: cust)(date, type, amount, salary)
products(code, name, type, status)
Task: Find salary from customers where id appears in products entries with matching code.
SQL: | SELECT salary FROM customers AS cust
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_06627 | train | T1 |
v2 | Schema:
regions (alias: rgn)(amount, date, level, value)
warehouses(type, level, salary, value)
Task: Find id from regions where a matching record exists in warehouses with the same type.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "warehouses",
"outer_alias": "rgn",
"inner_alias": "whs",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_06628 | train | T2 |
v2 | Schema:
sales (alias: sale)(id, type, salary, name)
schedules(level, salary, code, id)
Task: Retrieve salary from sales that have at least one corresponding entry in schedules sharing the same status.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_06629 | train | T1 |
v3 | Schema:
sales (alias: sale)(date, name, type, level)
employees(date, value, id, name)
Task: Find amount from sales where salary exceeds the average amount from employees for the same id.
SQL: | SELECT amount FROM sales AS sale
WHERE salary > (
SELECT MIN(amount) FROM employees AS emp
WHERE emp.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_06630 | train | T1 |
v1 | Schema:
transactions (alias: txn)(type, level, value, id)
products(code, date, type, value)
Task: Select name from transactions where level exists in products for the same level.
SQL: | SELECT name FROM transactions AS txn
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_06631 | train | T1 |
v2 | Schema:
managers (alias: mgr)(type, salary, code, id)
transactions(amount, name, date, status)
Task: Find salary from managers where a matching record exists in transactions with the same code.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_06632 | train | T1 |
v3 | Schema:
customers (alias: cust)(name, date, salary, value)
accounts(code, id, name, level)
Task: Retrieve value from customers with value above the MIN(salary) of accounts rows sharing the same level.
SQL: | SELECT value FROM customers AS cust
WHERE value > (
SELECT MIN(salary) FROM accounts AS acct
WHERE acct.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_06633 | train | T1 |
v2 | Schema:
services (alias: srvc)(level, amount, value, name)
shipments(value, name, type, level)
Task: Find name from services where a matching record exists in shipments with the same code.
SQL: | SELECT name FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "shipments",
"outer_alias": "srvc",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_06634 | train | T2 |
v2 | Schema:
budgets (alias: budg)(date, type, name, status)
employees(type, value, level, name)
Task: Retrieve value from budgets that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT value FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "employees",
"outer_alias": "budg",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_06635 | train | T2 |
v3 | Schema:
budgets (alias: budg)(level, salary, id, type)
orders(type, code, amount, name)
Task: Find id from budgets where salary exceeds the average amount from orders for the same type.
SQL: | SELECT id FROM budgets AS budg
WHERE salary > (
SELECT AVG(amount) FROM orders AS ord
WHERE ord.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "orders",
"outer_alias": "budg",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_06636 | train | T2 |
v2 | Schema:
regions (alias: rgn)(salary, value, name, id)
transactions(salary, id, type, amount)
Task: Find amount from regions where a matching record exists in transactions with the same id.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_06637 | train | T2 |
v1 | Schema:
requests (alias: ordr)(date, amount, level, status)
schedules(status, amount, code, value)
Task: Find code from requests where code appears in schedules entries with matching status.
SQL: | SELECT code FROM requests AS ordr
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_06638 | train | T2 |
v3 | Schema:
shipments (alias: shp)(type, value, code, salary)
products(name, amount, date, salary)
Task: Find id from shipments where amount exceeds the average amount from products for the same type.
SQL: | SELECT id FROM shipments AS shp
WHERE amount > (
SELECT COUNT(amount) FROM products AS prod
WHERE prod.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_06639 | train | T2 |
v2 | Schema:
schedules (alias: schd)(date, value, name, type)
regions(amount, date, level, salary)
Task: Retrieve code from schedules that have at least one corresponding entry in regions sharing the same level.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_06640 | train | T2 |
v1 | Schema:
budgets (alias: budg)(type, code, date, name)
sales(type, date, amount, code)
Task: Select name from budgets where type exists in sales for the same code.
SQL: | SELECT name FROM budgets AS budg
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "sales",
"outer_alias": "budg",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_06641 | train | T2 |
v3 | Schema:
requests (alias: ordr)(value, amount, type, name)
departments(amount, code, type, id)
Task: Find amount from requests where salary exceeds the average salary from departments for the same level.
SQL: | SELECT amount FROM requests AS ordr
WHERE salary > (
SELECT MIN(salary) FROM departments AS dept
WHERE dept.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_06642 | train | T2 |
v3 | Schema:
transactions (alias: txn)(id, type, date, salary)
managers(salary, amount, code, type)
Task: Find name from transactions where salary exceeds the average value from managers for the same type.
SQL: | SELECT name FROM transactions AS txn
WHERE salary > (
SELECT AVG(value) FROM managers AS mgr
WHERE mgr.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_06643 | train | T1 |
v1 | Schema:
transactions (alias: txn)(status, code, salary, type)
products(amount, name, salary, id)
Task: Find amount from transactions where level appears in products entries with matching level.
SQL: | SELECT amount FROM transactions AS txn
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_06644 | train | T1 |
v3 | Schema:
budgets (alias: budg)(status, level, amount, code)
accounts(id, level, status, name)
Task: Retrieve salary from budgets with value above the SUM(amount) of accounts rows sharing the same id.
SQL: | SELECT salary FROM budgets AS budg
WHERE value > (
SELECT SUM(amount) FROM accounts AS acct
WHERE acct.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "accounts",
"outer_alias": "budg",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_06645 | train | T2 |
v2 | Schema:
customers (alias: cust)(id, code, status, type)
managers(date, name, level, salary)
Task: Find id from customers where a matching record exists in managers with the same status.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_06646 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(code, name, value, status)
regions(status, id, salary, value)
Task: Retrieve code from warehouses that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT code FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "regions",
"outer_alias": "whs",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_06647 | train | T2 |
v1 | Schema:
customers (alias: cust)(status, level, name, type)
invoices(level, id, name, code)
Task: Find amount from customers where id appears in invoices entries with matching id.
SQL: | SELECT amount FROM customers AS cust
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_06648 | train | T1 |
v3 | Schema:
transactions (alias: txn)(status, type, value, name)
staff(amount, name, type, salary)
Task: Find amount from transactions where value exceeds the average value from staff for the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE value > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_06649 | train | T1 |
v1 | Schema:
invoices (alias: inv)(type, level, date, name)
accounts(name, code, value, level)
Task: Retrieve value from invoices whose id is found in accounts rows where type matches the outer record.
SQL: | SELECT value FROM invoices AS inv
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_06650 | train | T1 |
v3 | Schema:
managers (alias: mgr)(date, code, name, type)
warehouses(amount, salary, name, id)
Task: Find id from managers where value exceeds the average salary from warehouses for the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE value > (
SELECT MAX(salary) FROM warehouses AS whs
WHERE whs.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "warehouses",
"outer_alias": "mgr",
"inner_alias": "whs",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_06651 | train | T1 |
v3 | Schema:
schedules (alias: schd)(date, type, code, id)
orders(code, status, value, id)
Task: Find salary from schedules where amount exceeds the average salary from orders for the same id.
SQL: | SELECT salary FROM schedules AS schd
WHERE amount > (
SELECT MIN(salary) FROM orders AS ord
WHERE ord.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_06652 | train | T2 |
v1 | Schema:
schedules (alias: schd)(level, date, value, type)
shipments(amount, name, status, id)
Task: Select name from schedules where id exists in shipments for the same status.
SQL: | SELECT name FROM schedules AS schd
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_06653 | train | T2 |
v3 | Schema:
sales (alias: sale)(id, name, amount, status)
regions(amount, id, type, name)
Task: Retrieve salary from sales with salary above the MAX(value) of regions rows sharing the same type.
SQL: | SELECT salary FROM sales AS sale
WHERE salary > (
SELECT MAX(value) FROM regions AS rgn
WHERE rgn.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_06654 | train | T1 |
v2 | Schema:
requests (alias: ordr)(salary, status, code, amount)
accounts(status, level, code, value)
Task: Retrieve name from requests that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_06655 | train | T2 |
v3 | Schema:
accounts (alias: acct)(type, amount, name, value)
orders(amount, date, value, code)
Task: Find id from accounts where amount exceeds the average value from orders for the same level.
SQL: | SELECT id FROM accounts AS acct
WHERE amount > (
SELECT AVG(value) FROM orders AS ord
WHERE ord.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_06656 | train | T1 |
v3 | Schema:
departments (alias: dept)(amount, type, date, value)
orders(level, amount, value, status)
Task: Retrieve id from departments with amount above the MAX(value) of orders rows sharing the same id.
SQL: | SELECT id FROM departments AS dept
WHERE amount > (
SELECT MAX(value) FROM orders AS ord
WHERE ord.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_06657 | train | T1 |
v1 | Schema:
accounts (alias: acct)(type, salary, date, status)
warehouses(amount, salary, level, status)
Task: Find salary from accounts where level appears in warehouses entries with matching status.
SQL: | SELECT salary FROM accounts AS acct
WHERE level IN (
SELECT level FROM warehouses AS whs
WHERE whs.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "warehouses",
"outer_alias": "acct",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_06658 | train | T1 |
v1 | Schema:
staff (alias: empl)(level, value, amount, status)
regions(value, salary, amount, status)
Task: Retrieve value from staff whose type is found in regions rows where level matches the outer record.
SQL: | SELECT value FROM staff AS empl
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_06659 | train | T2 |
v3 | Schema:
staff (alias: empl)(name, date, value, code)
schedules(level, status, id, code)
Task: Find code from staff where value exceeds the average amount from schedules for the same status.
SQL: | SELECT code FROM staff AS empl
WHERE value > (
SELECT AVG(amount) FROM schedules AS schd
WHERE schd.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_06660 | train | T2 |
v2 | Schema:
transactions (alias: txn)(name, salary, level, date)
shipments(code, level, type, value)
Task: Find code from transactions where a matching record exists in shipments with the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_06661 | train | T1 |
v2 | Schema:
managers (alias: mgr)(type, id, value, status)
items(name, id, value, date)
Task: Retrieve value from managers that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_06662 | train | T1 |
v1 | Schema:
transactions (alias: txn)(id, amount, type, date)
regions(name, type, value, id)
Task: Find value from transactions where code appears in regions entries with matching type.
SQL: | SELECT value FROM transactions AS txn
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_06663 | train | T1 |
v3 | Schema:
employees (alias: emp)(level, amount, date, salary)
shipments(id, amount, value, code)
Task: Find value from employees where amount exceeds the average amount from shipments for the same level.
SQL: | SELECT value FROM employees AS emp
WHERE amount > (
SELECT COUNT(amount) FROM shipments AS shp
WHERE shp.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_06664 | train | T1 |
v1 | Schema:
transactions (alias: txn)(id, date, salary, value)
warehouses(id, type, name, value)
Task: Retrieve value from transactions whose type is found in warehouses rows where level matches the outer record.
SQL: | SELECT value FROM transactions AS txn
WHERE type IN (
SELECT type FROM warehouses AS whs
WHERE whs.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "warehouses",
"outer_alias": "txn",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_06665 | train | T1 |
v3 | Schema:
departments (alias: dept)(id, code, amount, date)
requests(salary, level, value, status)
Task: Find code from departments where salary exceeds the average value from requests for the same level.
SQL: | SELECT code FROM departments AS dept
WHERE salary > (
SELECT MAX(value) FROM requests AS ordr
WHERE ordr.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_06666 | train | T1 |
v2 | Schema:
employees (alias: emp)(id, date, amount, value)
services(amount, level, name, salary)
Task: Retrieve name from employees that have at least one corresponding entry in services sharing the same code.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "services",
"outer_alias": "emp",
"inner_alias": "srvc",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_06667 | train | T1 |
v3 | Schema:
customers (alias: cust)(status, id, name, level)
items(id, amount, code, type)
Task: Find id from customers where amount exceeds the average value from items for the same code.
SQL: | SELECT id FROM customers AS cust
WHERE amount > (
SELECT MIN(value) FROM items AS lne
WHERE lne.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_06668 | train | T1 |
v2 | Schema:
accounts (alias: acct)(level, type, code, salary)
budgets(date, amount, value, salary)
Task: Retrieve salary from accounts that have at least one corresponding entry in budgets sharing the same id.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "budgets",
"outer_alias": "acct",
"inner_alias": "budg",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_06669 | train | T1 |
v3 | Schema:
invoices (alias: inv)(id, amount, status, value)
requests(name, value, id, salary)
Task: Find id from invoices where salary exceeds the average amount from requests for the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE salary > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_06670 | train | T1 |
v1 | Schema:
transactions (alias: txn)(name, level, date, amount)
customers(level, id, salary, value)
Task: Select amount from transactions where status exists in customers for the same type.
SQL: | SELECT amount FROM transactions AS txn
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_06671 | train | T1 |
v1 | Schema:
accounts (alias: acct)(type, level, value, date)
schedules(value, code, amount, status)
Task: Retrieve value from accounts whose id is found in schedules rows where status matches the outer record.
SQL: | SELECT value FROM accounts AS acct
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_06672 | train | T1 |
v3 | Schema:
departments (alias: dept)(status, type, level, value)
accounts(name, status, date, value)
Task: Retrieve code from departments with salary above the COUNT(value) of accounts rows sharing the same type.
SQL: | SELECT code FROM departments AS dept
WHERE salary > (
SELECT COUNT(value) FROM accounts AS acct
WHERE acct.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_06673 | train | T1 |
v3 | Schema:
invoices (alias: inv)(type, code, salary, value)
sales(type, amount, code, level)
Task: Retrieve amount from invoices with amount above the MAX(value) of sales rows sharing the same status.
SQL: | SELECT amount FROM invoices AS inv
WHERE amount > (
SELECT MAX(value) FROM sales AS sale
WHERE sale.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_06674 | train | T1 |
v2 | Schema:
employees (alias: emp)(id, name, code, value)
customers(type, value, salary, id)
Task: Retrieve name from employees that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_06675 | train | T1 |
v1 | Schema:
categories (alias: catg)(code, status, id, amount)
staff(name, amount, value, id)
Task: Select code from categories where status exists in staff for the same level.
SQL: | SELECT code FROM categories AS catg
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_06676 | train | T2 |
v1 | Schema:
employees (alias: emp)(date, code, type, amount)
products(level, code, value, date)
Task: Select id from employees where level exists in products for the same id.
SQL: | SELECT id FROM employees AS emp
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_06677 | train | T1 |
v2 | Schema:
requests (alias: ordr)(status, type, date, name)
regions(name, amount, salary, code)
Task: Retrieve id from requests that have at least one corresponding entry in regions sharing the same level.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_06678 | train | T2 |
v3 | Schema:
staff (alias: empl)(status, id, date, code)
departments(status, salary, value, amount)
Task: Retrieve salary from staff with value above the AVG(amount) of departments rows sharing the same type.
SQL: | SELECT salary FROM staff AS empl
WHERE value > (
SELECT AVG(amount) FROM departments AS dept
WHERE dept.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_06679 | train | T2 |
v2 | Schema:
requests (alias: ordr)(type, amount, value, status)
services(status, value, salary, name)
Task: Find code from requests where a matching record exists in services with the same level.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "services",
"outer_alias": "ordr",
"inner_alias": "srvc",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_06680 | train | T2 |
v1 | Schema:
staff (alias: empl)(salary, status, id, type)
orders(value, date, name, salary)
Task: Retrieve value from staff whose code is found in orders rows where id matches the outer record.
SQL: | SELECT value FROM staff AS empl
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_06681 | train | T2 |
v2 | Schema:
schedules (alias: schd)(type, date, value, level)
categories(date, code, id, name)
Task: Retrieve value from schedules that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_06682 | train | T2 |
v2 | Schema:
customers (alias: cust)(level, code, name, value)
requests(type, status, value, amount)
Task: Find value from customers where a matching record exists in requests with the same type.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_06683 | train | T1 |
v2 | Schema:
customers (alias: cust)(id, name, value, amount)
sales(salary, status, level, amount)
Task: Retrieve amount from customers that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_06684 | train | T1 |
v1 | Schema:
budgets (alias: budg)(type, date, amount, status)
items(date, amount, salary, level)
Task: Find name from budgets where level appears in items entries with matching id.
SQL: | SELECT name FROM budgets AS budg
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "items",
"outer_alias": "budg",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_06685 | train | T2 |
v1 | Schema:
schedules (alias: schd)(id, type, date, name)
orders(amount, date, level, salary)
Task: Select salary from schedules where type exists in orders for the same code.
SQL: | SELECT salary FROM schedules AS schd
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_06686 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(code, amount, id, name)
transactions(value, type, code, date)
Task: Find id from warehouses where value exceeds the average salary from transactions for the same status.
SQL: | SELECT id FROM warehouses AS whs
WHERE value > (
SELECT SUM(salary) FROM transactions AS txn
WHERE txn.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "transactions",
"outer_alias": "whs",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_06687 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(salary, status, id, date)
staff(id, date, type, status)
Task: Find id from warehouses where a matching record exists in staff with the same code.
SQL: | SELECT id FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "staff",
"outer_alias": "whs",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_06688 | train | T2 |
v2 | Schema:
services (alias: srvc)(level, value, type, salary)
budgets(type, amount, id, value)
Task: Find name from services where a matching record exists in budgets with the same level.
SQL: | SELECT name FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "budgets",
"outer_alias": "srvc",
"inner_alias": "budg",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_06689 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(code, date, value, level)
managers(level, type, name, code)
Task: Find name from warehouses where status appears in managers entries with matching id.
SQL: | SELECT name FROM warehouses AS whs
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "managers",
"outer_alias": "whs",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_06690 | train | T2 |
v1 | Schema:
categories (alias: catg)(id, value, status, amount)
schedules(name, value, amount, status)
Task: Find amount from categories where status appears in schedules entries with matching code.
SQL: | SELECT amount FROM categories AS catg
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_06691 | train | T2 |
v3 | Schema:
budgets (alias: budg)(level, value, date, id)
items(date, amount, type, value)
Task: Retrieve value from budgets with salary above the AVG(salary) of items rows sharing the same code.
SQL: | SELECT value FROM budgets AS budg
WHERE salary > (
SELECT AVG(salary) FROM items AS lne
WHERE lne.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "items",
"outer_alias": "budg",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_06692 | train | T2 |
v1 | Schema:
sales (alias: sale)(status, name, amount, type)
requests(status, name, amount, date)
Task: Retrieve amount from sales whose id is found in requests rows where code matches the outer record.
SQL: | SELECT amount FROM sales AS sale
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_06693 | train | T1 |
v1 | Schema:
staff (alias: empl)(level, value, name, salary)
budgets(type, id, status, date)
Task: Retrieve salary from staff whose code is found in budgets rows where id matches the outer record.
SQL: | SELECT salary FROM staff AS empl
WHERE code IN (
SELECT code FROM budgets AS budg
WHERE budg.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "budgets",
"outer_alias": "empl",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_06694 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(id, type, date, status)
sales(status, level, name, date)
Task: Retrieve name from warehouses whose code is found in sales rows where level matches the outer record.
SQL: | SELECT name FROM warehouses AS whs
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "sales",
"outer_alias": "whs",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_06695 | train | T2 |
v3 | Schema:
budgets (alias: budg)(date, type, code, salary)
items(amount, code, level, status)
Task: Retrieve id from budgets with salary above the COUNT(amount) of items rows sharing the same code.
SQL: | SELECT id FROM budgets AS budg
WHERE salary > (
SELECT COUNT(amount) FROM items AS lne
WHERE lne.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "items",
"outer_alias": "budg",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_06696 | train | T2 |
v1 | Schema:
accounts (alias: acct)(amount, name, type, status)
shipments(value, type, date, name)
Task: Find name from accounts where code appears in shipments entries with matching code.
SQL: | SELECT name FROM accounts AS acct
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_06697 | train | T1 |
v3 | Schema:
orders (alias: ord)(value, status, code, salary)
items(id, status, salary, amount)
Task: Find amount from orders where value exceeds the average salary from items for the same code.
SQL: | SELECT amount FROM orders AS ord
WHERE value > (
SELECT COUNT(salary) FROM items AS lne
WHERE lne.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_06698 | train | T1 |
v1 | Schema:
transactions (alias: txn)(status, name, salary, value)
budgets(amount, level, date, status)
Task: Select name from transactions where code exists in budgets for the same level.
SQL: | SELECT name FROM transactions AS txn
WHERE code IN (
SELECT code FROM budgets AS budg
WHERE budg.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "budgets",
"outer_alias": "txn",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_06699 | train | T1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.