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)(salary, type, status, level)
regions(level, id, code, type)
Task: Retrieve code from requests that have at least one corresponding entry in regions sharing the same level.
SQL: | SELECT code 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": "code",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_00800 | train | T2 |
v2 | Schema:
schedules (alias: schd)(date, salary, id, type)
departments(id, salary, date, code)
Task: Retrieve name from schedules that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_00801 | train | T2 |
v3 | Schema:
orders (alias: ord)(level, type, salary, value)
regions(level, value, code, status)
Task: Find amount from orders where value exceeds the average salary from regions for the same status.
SQL: | SELECT amount FROM orders AS ord
WHERE value > (
SELECT MAX(salary) FROM regions AS rgn
WHERE rgn.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_00802 | train | T1 |
v3 | Schema:
managers (alias: mgr)(code, salary, type, status)
items(code, level, amount, date)
Task: Find amount from managers where amount exceeds the average salary from items for the same status.
SQL: | SELECT amount FROM managers AS mgr
WHERE amount > (
SELECT SUM(salary) FROM items AS lne
WHERE lne.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_00803 | train | T1 |
v3 | Schema:
transactions (alias: txn)(type, code, level, salary)
categories(type, level, status, value)
Task: Find amount from transactions where amount exceeds the average salary from categories for the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE amount > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_00804 | train | T1 |
v2 | Schema:
managers (alias: mgr)(status, name, code, amount)
categories(status, date, amount, name)
Task: Retrieve name from managers that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_00805 | train | T1 |
v2 | Schema:
departments (alias: dept)(value, name, status, amount)
requests(code, level, status, id)
Task: Find value from departments where a matching record exists in requests with the same id.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_00806 | train | T1 |
v1 | Schema:
categories (alias: catg)(name, status, id, level)
requests(amount, id, level, name)
Task: Find name from categories where level appears in requests entries with matching code.
SQL: | SELECT name FROM categories AS catg
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_00807 | train | T2 |
v3 | Schema:
requests (alias: ordr)(level, amount, id, salary)
departments(amount, value, type, level)
Task: Retrieve value from requests with amount above the SUM(amount) of departments rows sharing the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE amount > (
SELECT SUM(amount) FROM departments AS dept
WHERE dept.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_00808 | train | T2 |
v1 | Schema:
accounts (alias: acct)(type, level, id, name)
staff(date, name, type, salary)
Task: Select id from accounts where status exists in staff for the same code.
SQL: | SELECT id FROM accounts AS acct
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_00809 | train | T1 |
v3 | Schema:
orders (alias: ord)(amount, code, id, name)
invoices(amount, type, level, name)
Task: Retrieve amount from orders with amount above the SUM(amount) of invoices rows sharing the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE amount > (
SELECT SUM(amount) FROM invoices AS inv
WHERE inv.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_00810 | train | T1 |
v3 | Schema:
transactions (alias: txn)(value, date, name, type)
budgets(salary, type, date, code)
Task: Retrieve amount from transactions with amount above the MIN(amount) of budgets rows sharing the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE amount > (
SELECT MIN(amount) FROM budgets AS budg
WHERE budg.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "budgets",
"outer_alias": "txn",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_00811 | train | T1 |
v1 | Schema:
staff (alias: empl)(id, level, date, name)
accounts(status, id, code, amount)
Task: Select name from staff where level exists in accounts for the same type.
SQL: | SELECT name FROM staff AS empl
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_00812 | train | T2 |
v2 | Schema:
accounts (alias: acct)(status, amount, date, value)
invoices(level, salary, name, value)
Task: Find amount from accounts where a matching record exists in invoices with the same level.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_00813 | train | T1 |
v1 | Schema:
budgets (alias: budg)(value, id, date, name)
employees(date, code, status, id)
Task: Select salary from budgets where type exists in employees for the same type.
SQL: | SELECT salary FROM budgets AS budg
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "employees",
"outer_alias": "budg",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_00814 | train | T2 |
v1 | Schema:
budgets (alias: budg)(id, amount, status, type)
customers(code, id, amount, name)
Task: Retrieve name from budgets whose status is found in customers rows where status matches the outer record.
SQL: | SELECT name FROM budgets AS budg
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "customers",
"outer_alias": "budg",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_00815 | train | T2 |
v3 | Schema:
services (alias: srvc)(id, type, name, code)
sales(amount, level, code, name)
Task: Find id from services where amount exceeds the average value from sales for the same level.
SQL: | SELECT id FROM services AS srvc
WHERE amount > (
SELECT SUM(value) FROM sales AS sale
WHERE sale.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "sales",
"outer_alias": "srvc",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_00816 | train | T2 |
v3 | Schema:
regions (alias: rgn)(salary, name, date, code)
employees(amount, id, date, name)
Task: Find name from regions where salary exceeds the average amount from employees for the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE salary > (
SELECT AVG(amount) FROM employees AS emp
WHERE emp.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_00817 | train | T2 |
v1 | Schema:
orders (alias: ord)(amount, date, type, id)
customers(salary, level, status, name)
Task: Retrieve salary from orders whose status is found in customers rows where code matches the outer record.
SQL: | SELECT salary FROM orders AS ord
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_00818 | train | T1 |
v1 | Schema:
transactions (alias: txn)(date, type, name, amount)
employees(code, id, salary, status)
Task: Select amount from transactions where code exists in employees for the same code.
SQL: | SELECT amount FROM transactions AS txn
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_00819 | train | T1 |
v1 | Schema:
products (alias: prod)(status, salary, id, date)
items(salary, date, name, code)
Task: Find id from products where status appears in items entries with matching code.
SQL: | SELECT id FROM products AS prod
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.code = prod.code
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_00820 | train | T1 |
v1 | Schema:
shipments (alias: shp)(salary, id, amount, type)
sales(date, amount, level, id)
Task: Find code from shipments where status appears in sales entries with matching level.
SQL: | SELECT code FROM shipments AS shp
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_00821 | train | T2 |
v2 | Schema:
regions (alias: rgn)(name, salary, value, code)
items(type, salary, date, code)
Task: Retrieve name from regions that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_00822 | train | T2 |
v1 | Schema:
invoices (alias: inv)(value, level, type, date)
budgets(code, salary, name, id)
Task: Find amount from invoices where level appears in budgets entries with matching id.
SQL: | SELECT amount FROM invoices AS inv
WHERE level IN (
SELECT level FROM budgets AS budg
WHERE budg.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "budgets",
"outer_alias": "inv",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_00823 | train | T1 |
v2 | Schema:
requests (alias: ordr)(level, value, id, type)
warehouses(name, value, level, type)
Task: Retrieve amount from requests that have at least one corresponding entry in warehouses sharing the same status.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "warehouses",
"outer_alias": "ordr",
"inner_alias": "whs",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_00824 | train | T2 |
v2 | Schema:
staff (alias: empl)(salary, amount, status, date)
employees(type, date, code, status)
Task: Retrieve salary from staff that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_00825 | train | T2 |
v2 | Schema:
requests (alias: ordr)(status, level, amount, code)
services(name, date, value, amount)
Task: Retrieve value from requests that have at least one corresponding entry in services sharing the same status.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "services",
"outer_alias": "ordr",
"inner_alias": "srvc",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_00826 | train | T2 |
v3 | Schema:
managers (alias: mgr)(status, date, value, name)
transactions(type, level, status, salary)
Task: Retrieve code from managers with salary above the COUNT(amount) of transactions rows sharing the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE salary > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_00827 | train | T1 |
v1 | Schema:
requests (alias: ordr)(status, id, name, level)
services(id, type, amount, status)
Task: Retrieve name from requests whose type is found in services rows where code matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE type IN (
SELECT type FROM services AS srvc
WHERE srvc.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "services",
"outer_alias": "ordr",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_00828 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(code, id, salary, type)
customers(name, value, type, status)
Task: Find value from warehouses where type appears in customers entries with matching id.
SQL: | SELECT value FROM warehouses AS whs
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "customers",
"outer_alias": "whs",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_00829 | train | T2 |
v2 | Schema:
departments (alias: dept)(name, type, salary, amount)
warehouses(salary, name, value, type)
Task: Retrieve salary from departments that have at least one corresponding entry in warehouses sharing the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "warehouses",
"outer_alias": "dept",
"inner_alias": "whs",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_00830 | train | T1 |
v3 | Schema:
customers (alias: cust)(code, value, id, name)
warehouses(salary, code, date, id)
Task: Find name from customers where amount exceeds the average salary from warehouses for the same code.
SQL: | SELECT name FROM customers AS cust
WHERE amount > (
SELECT MAX(salary) FROM warehouses AS whs
WHERE whs.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "warehouses",
"outer_alias": "cust",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_00831 | train | T1 |
v2 | Schema:
shipments (alias: shp)(date, level, type, id)
regions(salary, status, amount, id)
Task: Retrieve value from shipments that have at least one corresponding entry in regions sharing the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_00832 | train | T2 |
v1 | Schema:
customers (alias: cust)(amount, status, date, id)
accounts(code, date, status, level)
Task: Find name from customers where status appears in accounts entries with matching level.
SQL: | SELECT name FROM customers AS cust
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_00833 | train | T1 |
v1 | Schema:
customers (alias: cust)(code, amount, type, status)
managers(id, code, status, value)
Task: Find id from customers where type appears in managers entries with matching level.
SQL: | SELECT id FROM customers AS cust
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_00834 | train | T1 |
v3 | Schema:
shipments (alias: shp)(type, value, status, salary)
employees(code, type, value, date)
Task: Find id from shipments where amount exceeds the average amount from employees for the same status.
SQL: | SELECT id FROM shipments AS shp
WHERE amount > (
SELECT MAX(amount) FROM employees AS emp
WHERE emp.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_00835 | train | T2 |
v1 | Schema:
items (alias: lne)(salary, id, name, date)
categories(value, status, id, code)
Task: Find id from items where level appears in categories entries with matching type.
SQL: | SELECT id FROM items AS lne
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.type = lne.type
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_00836 | train | T2 |
v2 | Schema:
employees (alias: emp)(value, code, type, level)
requests(value, id, code, salary)
Task: Retrieve code from employees that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_00837 | train | T1 |
v1 | Schema:
sales (alias: sale)(status, code, level, date)
orders(salary, amount, date, status)
Task: Retrieve name from sales whose code is found in orders rows where status matches the outer record.
SQL: | SELECT name FROM sales AS sale
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_00838 | train | T1 |
v1 | Schema:
budgets (alias: budg)(amount, code, name, type)
sales(amount, code, value, name)
Task: Select value from budgets where type exists in sales for the same type.
SQL: | SELECT value FROM budgets AS budg
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "sales",
"outer_alias": "budg",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_00839 | train | T2 |
v1 | Schema:
orders (alias: ord)(name, date, status, value)
categories(code, status, level, type)
Task: Find value from orders where code appears in categories entries with matching code.
SQL: | SELECT value FROM orders AS ord
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_00840 | train | T1 |
v2 | Schema:
regions (alias: rgn)(date, amount, value, id)
customers(level, date, code, type)
Task: Retrieve name from regions that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_00841 | train | T2 |
v1 | Schema:
transactions (alias: txn)(id, level, date, code)
managers(level, salary, type, name)
Task: Select name from transactions where level exists in managers for the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_00842 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(status, code, salary, amount)
categories(code, level, name, id)
Task: Find amount from warehouses where id appears in categories entries with matching status.
SQL: | SELECT amount FROM warehouses AS whs
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "categories",
"outer_alias": "whs",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_00843 | train | T2 |
v2 | Schema:
sales (alias: sale)(value, status, id, level)
shipments(id, value, name, status)
Task: Find id from sales where a matching record exists in shipments with the same code.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_00844 | train | T1 |
v2 | Schema:
invoices (alias: inv)(name, type, level, salary)
regions(amount, name, id, status)
Task: Retrieve amount from invoices that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_00845 | train | T1 |
v1 | Schema:
employees (alias: emp)(salary, name, code, level)
regions(name, code, value, status)
Task: Retrieve salary from employees whose id is found in regions rows where status matches the outer record.
SQL: | SELECT salary FROM employees AS emp
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_00846 | train | T1 |
v3 | Schema:
schedules (alias: schd)(status, type, date, name)
customers(name, status, value, salary)
Task: Find value from schedules where value exceeds the average salary from customers for the same code.
SQL: | SELECT value FROM schedules AS schd
WHERE value > (
SELECT SUM(salary) FROM customers AS cust
WHERE cust.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_00847 | train | T2 |
v3 | Schema:
regions (alias: rgn)(amount, type, date, id)
orders(level, value, type, date)
Task: Retrieve id from regions with amount above the SUM(value) of orders rows sharing the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE amount > (
SELECT SUM(value) FROM orders AS ord
WHERE ord.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_00848 | train | T2 |
v3 | Schema:
budgets (alias: budg)(date, type, value, id)
employees(id, type, salary, name)
Task: Find name from budgets where value exceeds the average amount from employees for the same code.
SQL: | SELECT name FROM budgets AS budg
WHERE value > (
SELECT SUM(amount) FROM employees AS emp
WHERE emp.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "employees",
"outer_alias": "budg",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_00849 | train | T2 |
v3 | Schema:
schedules (alias: schd)(value, date, id, code)
invoices(value, level, code, salary)
Task: Find code from schedules where value exceeds the average value from invoices for the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE value > (
SELECT MIN(value) FROM invoices AS inv
WHERE inv.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_00850 | train | T2 |
v2 | Schema:
managers (alias: mgr)(name, status, code, level)
requests(salary, type, id, value)
Task: Retrieve code from managers that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_00851 | train | T1 |
v1 | Schema:
managers (alias: mgr)(code, amount, level, date)
schedules(type, status, name, id)
Task: Retrieve id from managers whose status is found in schedules rows where code matches the outer record.
SQL: | SELECT id FROM managers AS mgr
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_00852 | train | T1 |
v1 | Schema:
departments (alias: dept)(code, date, level, name)
budgets(amount, code, id, type)
Task: Retrieve amount from departments whose code is found in budgets rows where status matches the outer record.
SQL: | SELECT amount FROM departments AS dept
WHERE code IN (
SELECT code FROM budgets AS budg
WHERE budg.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "budgets",
"outer_alias": "dept",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_00853 | train | T1 |
v1 | Schema:
services (alias: srvc)(code, level, status, salary)
employees(id, salary, date, level)
Task: Select salary from services where type exists in employees for the same status.
SQL: | SELECT salary FROM services AS srvc
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "employees",
"outer_alias": "srvc",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_00854 | train | T2 |
v2 | Schema:
products (alias: prod)(id, date, status, amount)
managers(date, level, code, type)
Task: Retrieve amount from products that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = prod.code
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_00855 | train | T1 |
v1 | Schema:
invoices (alias: inv)(code, level, amount, type)
managers(level, amount, status, value)
Task: Select amount from invoices where code exists in managers for the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_00856 | train | T1 |
v2 | Schema:
staff (alias: empl)(status, salary, name, amount)
customers(code, level, id, amount)
Task: Retrieve value from staff that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_00857 | train | T2 |
v2 | Schema:
budgets (alias: budg)(amount, type, code, date)
invoices(id, code, type, name)
Task: Find code from budgets where a matching record exists in invoices with the same id.
SQL: | SELECT code FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "invoices",
"outer_alias": "budg",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_00858 | train | T2 |
v2 | Schema:
products (alias: prod)(value, level, code, salary)
employees(amount, salary, id, status)
Task: Find name from products where a matching record exists in employees with the same id.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = prod.id
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_00859 | train | T1 |
v2 | Schema:
schedules (alias: schd)(value, level, id, salary)
requests(type, id, level, value)
Task: Find id from schedules where a matching record exists in requests with the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_00860 | train | T2 |
v3 | Schema:
sales (alias: sale)(level, status, amount, type)
categories(name, date, value, salary)
Task: Retrieve salary from sales with salary above the MIN(salary) of categories rows sharing the same level.
SQL: | SELECT salary FROM sales AS sale
WHERE salary > (
SELECT MIN(salary) FROM categories AS catg
WHERE catg.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_00861 | train | T1 |
v1 | Schema:
services (alias: srvc)(level, type, value, code)
categories(status, code, value, date)
Task: Select code from services where level exists in categories for the same level.
SQL: | SELECT code FROM services AS srvc
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "categories",
"outer_alias": "srvc",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_00862 | train | T2 |
v3 | Schema:
invoices (alias: inv)(type, date, salary, amount)
sales(amount, id, status, date)
Task: Retrieve amount from invoices with value above the MAX(amount) of sales rows sharing the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE value > (
SELECT MAX(amount) FROM sales AS sale
WHERE sale.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_00863 | train | T1 |
v3 | Schema:
services (alias: srvc)(value, salary, id, status)
categories(date, level, name, id)
Task: Retrieve salary from services with amount above the MIN(salary) of categories rows sharing the same level.
SQL: | SELECT salary FROM services AS srvc
WHERE amount > (
SELECT MIN(salary) FROM categories AS catg
WHERE catg.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "categories",
"outer_alias": "srvc",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_00864 | train | T2 |
v3 | Schema:
shipments (alias: shp)(status, name, amount, level)
customers(amount, salary, name, type)
Task: Retrieve id from shipments with amount above the SUM(amount) of customers rows sharing the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE amount > (
SELECT SUM(amount) FROM customers AS cust
WHERE cust.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_00865 | train | T2 |
v3 | Schema:
orders (alias: ord)(type, salary, date, id)
accounts(id, date, amount, name)
Task: Find id from orders where salary exceeds the average value from accounts for the same status.
SQL: | SELECT id FROM orders AS ord
WHERE salary > (
SELECT AVG(value) FROM accounts AS acct
WHERE acct.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_00866 | train | T1 |
v1 | Schema:
schedules (alias: schd)(level, value, salary, id)
employees(type, level, id, amount)
Task: Retrieve salary from schedules whose id is found in employees rows where id matches the outer record.
SQL: | SELECT salary FROM schedules AS schd
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_00867 | train | T2 |
v1 | Schema:
departments (alias: dept)(date, salary, amount, level)
schedules(salary, level, status, type)
Task: Find value from departments where id appears in schedules entries with matching level.
SQL: | SELECT value FROM departments AS dept
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_00868 | train | T1 |
v3 | Schema:
transactions (alias: txn)(salary, date, type, level)
departments(name, value, salary, date)
Task: Retrieve salary from transactions with amount above the AVG(salary) of departments rows sharing the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE amount > (
SELECT AVG(salary) FROM departments AS dept
WHERE dept.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_00869 | train | T1 |
v1 | Schema:
employees (alias: emp)(status, amount, code, salary)
shipments(level, amount, status, code)
Task: Retrieve amount from employees whose code is found in shipments rows where id matches the outer record.
SQL: | SELECT amount FROM employees AS emp
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_00870 | train | T1 |
v3 | Schema:
budgets (alias: budg)(id, type, status, value)
categories(salary, type, id, value)
Task: Retrieve value from budgets with salary above the COUNT(value) of categories rows sharing the same type.
SQL: | SELECT value FROM budgets AS budg
WHERE salary > (
SELECT COUNT(value) FROM categories AS catg
WHERE catg.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "categories",
"outer_alias": "budg",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_00871 | train | T2 |
v1 | Schema:
accounts (alias: acct)(id, code, amount, type)
services(salary, type, id, level)
Task: Select id from accounts where type exists in services for the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE type IN (
SELECT type FROM services AS srvc
WHERE srvc.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "services",
"outer_alias": "acct",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_00872 | train | T1 |
v1 | Schema:
shipments (alias: shp)(code, value, amount, name)
departments(level, salary, date, type)
Task: Find id from shipments where id appears in departments entries with matching code.
SQL: | SELECT id FROM shipments AS shp
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_00873 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(value, salary, date, name)
accounts(id, status, level, type)
Task: Select salary from warehouses where code exists in accounts for the same status.
SQL: | SELECT salary FROM warehouses AS whs
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "accounts",
"outer_alias": "whs",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_00874 | train | T2 |
v2 | Schema:
employees (alias: emp)(id, salary, type, amount)
regions(level, id, status, date)
Task: Find code from employees where a matching record exists in regions with the same status.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_00875 | train | T1 |
v2 | Schema:
requests (alias: ordr)(salary, value, date, code)
categories(salary, date, level, type)
Task: Find code from requests where a matching record exists in categories with the same level.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_00876 | train | T2 |
v2 | Schema:
shipments (alias: shp)(value, code, salary, name)
items(level, status, value, id)
Task: Find value from shipments where a matching record exists in items with the same status.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_00877 | train | T2 |
v1 | Schema:
sales (alias: sale)(salary, amount, type, status)
categories(amount, value, type, salary)
Task: Select name from sales where status exists in categories for the same code.
SQL: | SELECT name FROM sales AS sale
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_00878 | train | T1 |
v2 | Schema:
schedules (alias: schd)(id, value, code, name)
employees(status, name, salary, code)
Task: Find salary from schedules where a matching record exists in employees with the same level.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_00879 | train | T2 |
v1 | Schema:
sales (alias: sale)(name, type, level, value)
schedules(amount, status, date, id)
Task: Retrieve value from sales whose status is found in schedules rows where type matches the outer record.
SQL: | SELECT value FROM sales AS sale
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_00880 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(salary, status, type, name)
budgets(type, status, value, salary)
Task: Find amount from warehouses where a matching record exists in budgets with the same type.
SQL: | SELECT amount FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "budgets",
"outer_alias": "whs",
"inner_alias": "budg",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_00881 | train | T2 |
v3 | Schema:
requests (alias: ordr)(id, salary, date, level)
sales(type, level, name, value)
Task: Find id from requests where amount exceeds the average value from sales for the same type.
SQL: | SELECT id FROM requests AS ordr
WHERE amount > (
SELECT MAX(value) FROM sales AS sale
WHERE sale.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_00882 | train | T2 |
v2 | Schema:
managers (alias: mgr)(code, name, value, salary)
departments(date, salary, name, amount)
Task: Retrieve value from managers that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_00883 | train | T1 |
v2 | Schema:
sales (alias: sale)(amount, salary, name, level)
services(value, type, name, date)
Task: Retrieve code from sales that have at least one corresponding entry in services sharing the same status.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "services",
"outer_alias": "sale",
"inner_alias": "srvc",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_00884 | train | T1 |
v3 | Schema:
staff (alias: empl)(level, value, type, amount)
accounts(salary, value, level, status)
Task: Retrieve name from staff with salary above the MIN(salary) of accounts rows sharing the same status.
SQL: | SELECT name FROM staff AS empl
WHERE salary > (
SELECT MIN(salary) FROM accounts AS acct
WHERE acct.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_00885 | train | T2 |
v2 | Schema:
departments (alias: dept)(level, date, type, value)
warehouses(status, salary, amount, type)
Task: Find salary from departments where a matching record exists in warehouses with the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "warehouses",
"outer_alias": "dept",
"inner_alias": "whs",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_00886 | train | T1 |
v1 | Schema:
requests (alias: ordr)(type, salary, code, level)
accounts(level, type, salary, id)
Task: Select value from requests where code exists in accounts for the same status.
SQL: | SELECT value FROM requests AS ordr
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_00887 | train | T2 |
v1 | Schema:
services (alias: srvc)(status, salary, id, amount)
employees(type, value, salary, level)
Task: Retrieve value from services whose status is found in employees rows where type matches the outer record.
SQL: | SELECT value FROM services AS srvc
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "employees",
"outer_alias": "srvc",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_00888 | train | T2 |
v1 | Schema:
services (alias: srvc)(name, status, amount, code)
managers(type, name, status, date)
Task: Find salary from services where level appears in managers entries with matching level.
SQL: | SELECT salary FROM services AS srvc
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "managers",
"outer_alias": "srvc",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_00889 | train | T2 |
v2 | Schema:
employees (alias: emp)(salary, code, value, amount)
accounts(id, salary, name, level)
Task: Find id from employees where a matching record exists in accounts with the same id.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_00890 | train | T1 |
v3 | Schema:
items (alias: lne)(amount, status, salary, type)
accounts(code, status, amount, date)
Task: Find amount from items where amount exceeds the average salary from accounts for the same type.
SQL: | SELECT amount FROM items AS lne
WHERE amount > (
SELECT COUNT(salary) FROM accounts AS acct
WHERE acct.type = lne.type
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_00891 | train | T2 |
v2 | Schema:
regions (alias: rgn)(name, id, code, date)
products(type, name, amount, id)
Task: Find salary from regions where a matching record exists in products with the same type.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_00892 | train | T2 |
v2 | Schema:
shipments (alias: shp)(code, date, name, amount)
budgets(value, amount, salary, date)
Task: Retrieve salary from shipments that have at least one corresponding entry in budgets sharing the same id.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "budgets",
"outer_alias": "shp",
"inner_alias": "budg",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_00893 | train | T2 |
v1 | Schema:
departments (alias: dept)(amount, salary, name, date)
regions(type, code, date, salary)
Task: Select id from departments where code exists in regions for the same type.
SQL: | SELECT id FROM departments AS dept
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_00894 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(value, level, name, salary)
transactions(id, value, amount, status)
Task: Retrieve id from warehouses that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT id FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "transactions",
"outer_alias": "whs",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_00895 | train | T2 |
v3 | Schema:
orders (alias: ord)(code, status, name, level)
services(status, type, date, amount)
Task: Find code from orders where salary exceeds the average value from services for the same code.
SQL: | SELECT code FROM orders AS ord
WHERE salary > (
SELECT MAX(value) FROM services AS srvc
WHERE srvc.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "services",
"outer_alias": "ord",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_00896 | train | T1 |
v1 | Schema:
transactions (alias: txn)(code, value, type, name)
sales(date, level, code, value)
Task: Find salary from transactions where type appears in sales entries with matching status.
SQL: | SELECT salary FROM transactions AS txn
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_00897 | train | T1 |
v2 | Schema:
products (alias: prod)(salary, code, amount, value)
departments(value, date, id, level)
Task: Retrieve id from products that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = prod.code
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_00898 | train | T1 |
v2 | Schema:
staff (alias: empl)(date, salary, amount, level)
budgets(id, type, date, status)
Task: Find salary from staff where a matching record exists in budgets with the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "budgets",
"outer_alias": "empl",
"inner_alias": "budg",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_00899 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.