variant stringclasses 3
values | prompt stringlengths 163 237 | sql stringlengths 103 143 | metadata unknown | id stringlengths 21 21 | split stringclasses 1
value | token_group stringclasses 2
values |
|---|---|---|---|---|---|---|
v3 | Schema:
products (alias: prod)(type, status, name, salary)
orders(code, value, name, salary)
Task: Find salary from products where amount exceeds the average salary from orders for the same status.
SQL: | SELECT salary FROM products AS prod
WHERE amount > (
SELECT COUNT(salary) FROM orders AS ord
WHERE ord.status = prod.status
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_07800 | train | T1 |
v2 | Schema:
items (alias: lne)(date, level, name, status)
orders(code, level, type, date)
Task: Find id from items where a matching record exists in orders with the same code.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = lne.code
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_07801 | train | T2 |
v1 | Schema:
staff (alias: empl)(code, id, value, type)
schedules(status, type, level, salary)
Task: Find id from staff where code appears in schedules entries with matching status.
SQL: | SELECT id FROM staff AS empl
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_07802 | train | T2 |
v2 | Schema:
accounts (alias: acct)(salary, level, id, amount)
invoices(type, code, date, name)
Task: Retrieve code from accounts that have at least one corresponding entry in invoices sharing the same level.
SQL: | SELECT code 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": "code",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_07803 | train | T1 |
v3 | Schema:
products (alias: prod)(salary, status, code, id)
orders(status, type, code, date)
Task: Find value from products where salary exceeds the average amount from orders for the same code.
SQL: | SELECT value FROM products AS prod
WHERE salary > (
SELECT COUNT(amount) FROM orders AS ord
WHERE ord.code = prod.code
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_07804 | train | T1 |
v2 | Schema:
accounts (alias: acct)(code, name, date, id)
customers(salary, date, value, type)
Task: Retrieve code from accounts that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_07805 | train | T1 |
v3 | Schema:
invoices (alias: inv)(id, status, type, amount)
shipments(date, value, id, status)
Task: Retrieve id from invoices with salary above the SUM(amount) of shipments rows sharing the same code.
SQL: | SELECT id FROM invoices AS inv
WHERE salary > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_07806 | train | T1 |
v2 | Schema:
staff (alias: empl)(date, amount, type, name)
employees(level, type, name, code)
Task: Retrieve name from staff that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_07807 | train | T2 |
v2 | Schema:
shipments (alias: shp)(level, name, amount, type)
staff(code, value, name, salary)
Task: Find value from shipments where a matching record exists in staff with the same status.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_07808 | train | T2 |
v2 | Schema:
shipments (alias: shp)(date, salary, amount, code)
categories(date, status, type, level)
Task: Find name from shipments where a matching record exists in categories with the same type.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_07809 | train | T2 |
v3 | Schema:
shipments (alias: shp)(date, name, value, amount)
departments(name, type, status, salary)
Task: Retrieve salary from shipments with value above the MAX(amount) of departments rows sharing the same status.
SQL: | SELECT salary FROM shipments AS shp
WHERE value > (
SELECT MAX(amount) FROM departments AS dept
WHERE dept.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_07810 | train | T2 |
v3 | Schema:
services (alias: srvc)(level, type, salary, date)
regions(amount, code, date, name)
Task: Retrieve code from services with amount above the SUM(amount) of regions rows sharing the same code.
SQL: | SELECT code FROM services AS srvc
WHERE amount > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "regions",
"outer_alias": "srvc",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_07811 | train | T2 |
v1 | Schema:
transactions (alias: txn)(date, type, id, amount)
managers(type, id, level, salary)
Task: Select salary from transactions where id exists in managers for the same type.
SQL: | SELECT salary FROM transactions AS txn
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_07812 | train | T1 |
v2 | Schema:
shipments (alias: shp)(date, level, value, amount)
staff(name, id, type, level)
Task: Retrieve id from shipments that have at least one corresponding entry in staff sharing the same level.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_07813 | train | T2 |
v2 | Schema:
budgets (alias: budg)(value, code, level, salary)
regions(type, code, amount, status)
Task: Retrieve code from budgets that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT code FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "regions",
"outer_alias": "budg",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_07814 | train | T2 |
v1 | Schema:
budgets (alias: budg)(type, date, value, amount)
departments(date, amount, salary, status)
Task: Select salary from budgets where code exists in departments for the same type.
SQL: | SELECT salary FROM budgets AS budg
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "departments",
"outer_alias": "budg",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_07815 | train | T2 |
v2 | Schema:
shipments (alias: shp)(status, salary, amount, value)
departments(level, date, id, code)
Task: Retrieve amount from shipments that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_07816 | train | T2 |
v2 | Schema:
shipments (alias: shp)(id, status, date, salary)
managers(status, level, salary, name)
Task: Retrieve salary from shipments that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_07817 | train | T2 |
v3 | Schema:
services (alias: srvc)(value, code, type, amount)
orders(level, type, id, date)
Task: Retrieve name from services with salary above the MAX(salary) of orders rows sharing the same status.
SQL: | SELECT name FROM services AS srvc
WHERE salary > (
SELECT MAX(salary) FROM orders AS ord
WHERE ord.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "orders",
"outer_alias": "srvc",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_07818 | train | T2 |
v3 | Schema:
budgets (alias: budg)(code, value, date, type)
sales(amount, date, name, id)
Task: Find amount from budgets where amount exceeds the average value from sales for the same code.
SQL: | SELECT amount FROM budgets AS budg
WHERE amount > (
SELECT MIN(value) FROM sales AS sale
WHERE sale.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "sales",
"outer_alias": "budg",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_07819 | train | T2 |
v1 | Schema:
customers (alias: cust)(type, value, id, date)
employees(code, type, level, amount)
Task: Retrieve value from customers whose level is found in employees rows where type matches the outer record.
SQL: | SELECT value FROM customers AS cust
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_07820 | train | T1 |
v1 | Schema:
employees (alias: emp)(status, level, date, value)
items(value, name, type, code)
Task: Retrieve code from employees whose level is found in items rows where status matches the outer record.
SQL: | SELECT code FROM employees AS emp
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_07821 | train | T1 |
v3 | Schema:
schedules (alias: schd)(value, level, type, code)
regions(salary, type, value, level)
Task: Find amount from schedules where salary exceeds the average salary from regions for the same code.
SQL: | SELECT amount FROM schedules AS schd
WHERE salary > (
SELECT COUNT(salary) FROM regions AS rgn
WHERE rgn.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_07822 | train | T2 |
v2 | Schema:
accounts (alias: acct)(salary, date, type, status)
sales(id, type, level, name)
Task: Find name from accounts where a matching record exists in sales with the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_07823 | train | T1 |
v1 | Schema:
orders (alias: ord)(level, id, value, amount)
sales(amount, date, level, type)
Task: Select code from orders where level exists in sales for the same id.
SQL: | SELECT code FROM orders AS ord
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_07824 | train | T1 |
v2 | Schema:
transactions (alias: txn)(value, code, amount, status)
sales(salary, level, date, name)
Task: Find salary from transactions where a matching record exists in sales with the same status.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_07825 | train | T1 |
v2 | Schema:
schedules (alias: schd)(name, level, id, code)
transactions(type, id, date, code)
Task: Find id from schedules where a matching record exists in transactions with the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_07826 | train | T2 |
v2 | Schema:
services (alias: srvc)(id, date, type, level)
budgets(code, id, status, level)
Task: Retrieve value from services that have at least one corresponding entry in budgets sharing the same type.
SQL: | SELECT value FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "budgets",
"outer_alias": "srvc",
"inner_alias": "budg",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_07827 | train | T2 |
v2 | Schema:
customers (alias: cust)(type, id, status, code)
employees(name, level, type, value)
Task: Retrieve salary from customers that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_07828 | train | T1 |
v1 | Schema:
invoices (alias: inv)(value, salary, date, id)
staff(value, type, name, level)
Task: Select amount from invoices where id exists in staff for the same status.
SQL: | SELECT amount FROM invoices AS inv
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_07829 | train | T1 |
v3 | Schema:
schedules (alias: schd)(salary, date, name, amount)
warehouses(salary, level, amount, status)
Task: Retrieve amount from schedules with amount above the MIN(amount) of warehouses rows sharing the same code.
SQL: | SELECT amount FROM schedules AS schd
WHERE amount > (
SELECT MIN(amount) FROM warehouses AS whs
WHERE whs.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "warehouses",
"outer_alias": "schd",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_07830 | train | T2 |
v2 | Schema:
transactions (alias: txn)(name, code, level, amount)
budgets(status, level, id, name)
Task: Retrieve amount from transactions that have at least one corresponding entry in budgets sharing the same type.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "budgets",
"outer_alias": "txn",
"inner_alias": "budg",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_07831 | train | T1 |
v1 | Schema:
services (alias: srvc)(date, value, id, code)
requests(amount, code, value, salary)
Task: Find name from services where id appears in requests entries with matching level.
SQL: | SELECT name FROM services AS srvc
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "requests",
"outer_alias": "srvc",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_07832 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(name, date, type, status)
managers(type, name, level, status)
Task: Retrieve amount from warehouses with salary above the MAX(salary) of managers rows sharing the same type.
SQL: | SELECT amount FROM warehouses AS whs
WHERE salary > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "managers",
"outer_alias": "whs",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_07833 | train | T2 |
v3 | Schema:
services (alias: srvc)(level, amount, salary, type)
regions(amount, id, code, value)
Task: Retrieve name from services with value above the SUM(amount) of regions rows sharing the same code.
SQL: | SELECT name FROM services AS srvc
WHERE value > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "regions",
"outer_alias": "srvc",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_07834 | train | T2 |
v3 | Schema:
invoices (alias: inv)(id, salary, amount, value)
categories(date, type, name, status)
Task: Retrieve name from invoices with value above the AVG(value) of categories rows sharing the same code.
SQL: | SELECT name FROM invoices AS inv
WHERE value > (
SELECT AVG(value) FROM categories AS catg
WHERE catg.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_07835 | train | T1 |
v1 | Schema:
customers (alias: cust)(status, value, name, type)
staff(id, name, date, code)
Task: Retrieve value from customers whose id is found in staff rows where id matches the outer record.
SQL: | SELECT value FROM customers AS cust
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_07836 | train | T1 |
v2 | Schema:
regions (alias: rgn)(name, level, date, status)
items(salary, level, status, amount)
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_07837 | train | T2 |
v3 | Schema:
requests (alias: ordr)(salary, amount, date, value)
services(status, level, type, date)
Task: Find name from requests where salary exceeds the average value from services for the same type.
SQL: | SELECT name FROM requests AS ordr
WHERE salary > (
SELECT MIN(value) FROM services AS srvc
WHERE srvc.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "services",
"outer_alias": "ordr",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_07838 | train | T2 |
v3 | Schema:
departments (alias: dept)(amount, level, status, type)
budgets(code, date, status, name)
Task: Retrieve code from departments with value above the SUM(value) of budgets rows sharing the same status.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT SUM(value) FROM budgets AS budg
WHERE budg.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "budgets",
"outer_alias": "dept",
"inner_alias": "budg",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_07839 | train | T1 |
v2 | Schema:
products (alias: prod)(amount, name, type, code)
requests(date, id, amount, type)
Task: Retrieve amount from products that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = prod.type
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_07840 | train | T1 |
v2 | Schema:
schedules (alias: schd)(type, amount, code, date)
accounts(status, type, salary, name)
Task: Retrieve code from schedules that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_07841 | train | T2 |
v1 | Schema:
staff (alias: empl)(value, id, level, date)
managers(value, code, name, status)
Task: Select id from staff where id exists in managers for the same status.
SQL: | SELECT id FROM staff AS empl
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_07842 | train | T2 |
v3 | Schema:
invoices (alias: inv)(id, status, level, amount)
items(name, id, type, level)
Task: Find id from invoices where value exceeds the average amount from items for the same type.
SQL: | SELECT id FROM invoices AS inv
WHERE value > (
SELECT COUNT(amount) FROM items AS lne
WHERE lne.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_07843 | train | T1 |
v2 | Schema:
services (alias: srvc)(value, name, salary, code)
sales(type, name, value, status)
Task: Find salary from services where a matching record exists in sales with the same code.
SQL: | SELECT salary FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "sales",
"outer_alias": "srvc",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_07844 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(value, level, name, id)
staff(salary, code, value, name)
Task: Find id from warehouses where a matching record exists in staff with the same type.
SQL: | SELECT id FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "staff",
"outer_alias": "whs",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_07845 | train | T2 |
v3 | Schema:
items (alias: lne)(code, id, status, value)
regions(status, salary, type, value)
Task: Find name from items where salary exceeds the average salary from regions for the same level.
SQL: | SELECT name FROM items AS lne
WHERE salary > (
SELECT MIN(salary) FROM regions AS rgn
WHERE rgn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_07846 | train | T2 |
v3 | Schema:
employees (alias: emp)(value, code, date, id)
services(status, code, salary, id)
Task: Find name from employees where amount exceeds the average amount from services for the same id.
SQL: | SELECT name FROM employees AS emp
WHERE amount > (
SELECT AVG(amount) FROM services AS srvc
WHERE srvc.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "services",
"outer_alias": "emp",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_07847 | train | T1 |
v2 | Schema:
products (alias: prod)(date, code, name, id)
customers(date, type, code, value)
Task: Find salary from products where a matching record exists in customers with the same level.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = prod.level
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_07848 | train | T1 |
v3 | Schema:
requests (alias: ordr)(value, amount, salary, code)
customers(date, id, salary, status)
Task: Find value from requests where salary exceeds the average amount from customers for the same status.
SQL: | SELECT value FROM requests AS ordr
WHERE salary > (
SELECT SUM(amount) FROM customers AS cust
WHERE cust.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_07849 | train | T2 |
v1 | Schema:
departments (alias: dept)(level, code, name, status)
schedules(amount, code, value, level)
Task: Select id from departments where status exists in schedules for the same status.
SQL: | SELECT id FROM departments AS dept
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_07850 | train | T1 |
v1 | Schema:
products (alias: prod)(value, name, amount, id)
customers(status, id, salary, date)
Task: Find value from products where level appears in customers entries with matching code.
SQL: | SELECT value FROM products AS prod
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.code = prod.code
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_07851 | train | T1 |
v1 | Schema:
items (alias: lne)(code, value, name, type)
departments(name, amount, salary, date)
Task: Find name from items where id appears in departments entries with matching level.
SQL: | SELECT name FROM items AS lne
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.level = lne.level
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_07852 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(amount, value, id, type)
departments(type, id, amount, salary)
Task: Retrieve code from warehouses with salary above the MIN(amount) of departments rows sharing the same type.
SQL: | SELECT code FROM warehouses AS whs
WHERE salary > (
SELECT MIN(amount) FROM departments AS dept
WHERE dept.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "departments",
"outer_alias": "whs",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_07853 | train | T2 |
v2 | Schema:
schedules (alias: schd)(id, type, salary, value)
warehouses(code, level, amount, salary)
Task: Retrieve amount from schedules that have at least one corresponding entry in warehouses sharing the same id.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "warehouses",
"outer_alias": "schd",
"inner_alias": "whs",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_07854 | train | T2 |
v3 | Schema:
customers (alias: cust)(amount, id, type, status)
staff(status, value, level, type)
Task: Retrieve code from customers with salary above the COUNT(salary) of staff rows sharing the same id.
SQL: | SELECT code FROM customers AS cust
WHERE salary > (
SELECT COUNT(salary) FROM staff AS empl
WHERE empl.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_07855 | train | T1 |
v2 | Schema:
transactions (alias: txn)(value, type, code, status)
categories(code, salary, type, status)
Task: Find salary from transactions where a matching record exists in categories with the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_07856 | train | T1 |
v1 | Schema:
requests (alias: ordr)(amount, name, type, value)
regions(code, value, type, date)
Task: Find name from requests where id appears in regions entries with matching code.
SQL: | SELECT name FROM requests AS ordr
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_07857 | train | T2 |
v3 | Schema:
budgets (alias: budg)(name, code, status, level)
shipments(value, status, amount, type)
Task: Find code from budgets where salary exceeds the average value from shipments for the same id.
SQL: | SELECT code FROM budgets AS budg
WHERE salary > (
SELECT COUNT(value) FROM shipments AS shp
WHERE shp.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "shipments",
"outer_alias": "budg",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_07858 | train | T2 |
v3 | Schema:
employees (alias: emp)(amount, code, status, level)
products(level, type, date, salary)
Task: Find name from employees where salary exceeds the average amount from products for the same code.
SQL: | SELECT name FROM employees AS emp
WHERE salary > (
SELECT MAX(amount) FROM products AS prod
WHERE prod.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_07859 | train | T1 |
v2 | Schema:
accounts (alias: acct)(amount, code, id, salary)
shipments(id, date, type, name)
Task: Retrieve value from accounts that have at least one corresponding entry in shipments sharing the same status.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_07860 | train | T1 |
v3 | Schema:
regions (alias: rgn)(value, type, amount, level)
staff(code, amount, name, type)
Task: Retrieve id from regions with value above the MAX(salary) of staff rows sharing the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE value > (
SELECT MAX(salary) FROM staff AS empl
WHERE empl.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_07861 | train | T2 |
v3 | Schema:
departments (alias: dept)(amount, type, name, value)
products(status, salary, name, type)
Task: Retrieve name from departments with amount above the COUNT(salary) of products rows sharing the same level.
SQL: | SELECT name FROM departments AS dept
WHERE amount > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_07862 | train | T1 |
v3 | Schema:
departments (alias: dept)(date, salary, name, level)
sales(code, id, name, value)
Task: Find code from departments where salary exceeds the average salary from sales for the same type.
SQL: | SELECT code FROM departments AS dept
WHERE salary > (
SELECT MIN(salary) FROM sales AS sale
WHERE sale.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_07863 | train | T1 |
v2 | Schema:
accounts (alias: acct)(value, salary, status, id)
services(date, salary, amount, id)
Task: Retrieve id from accounts that have at least one corresponding entry in services sharing the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "services",
"outer_alias": "acct",
"inner_alias": "srvc",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_07864 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(id, name, status, date)
schedules(date, code, id, status)
Task: Find amount from warehouses where salary exceeds the average value from schedules for the same code.
SQL: | SELECT amount FROM warehouses AS whs
WHERE salary > (
SELECT SUM(value) FROM schedules AS schd
WHERE schd.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "schedules",
"outer_alias": "whs",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_07865 | train | T2 |
v1 | Schema:
budgets (alias: budg)(date, amount, type, salary)
accounts(value, status, name, code)
Task: Select id from budgets where level exists in accounts for the same id.
SQL: | SELECT id FROM budgets AS budg
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "accounts",
"outer_alias": "budg",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_07866 | train | T2 |
v2 | Schema:
customers (alias: cust)(value, type, code, amount)
accounts(name, value, salary, type)
Task: Retrieve name from customers that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_07867 | train | T1 |
v2 | Schema:
services (alias: srvc)(salary, id, amount, value)
sales(status, salary, amount, level)
Task: Find salary from services where a matching record exists in sales with the same code.
SQL: | SELECT salary FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "sales",
"outer_alias": "srvc",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_07868 | train | T2 |
v2 | Schema:
items (alias: lne)(name, type, salary, level)
shipments(status, amount, value, level)
Task: Find name from items where a matching record exists in shipments with the same code.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = lne.code
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_07869 | train | T2 |
v1 | Schema:
customers (alias: cust)(date, type, name, code)
orders(status, level, code, type)
Task: Find id from customers where id appears in orders entries with matching level.
SQL: | SELECT id FROM customers AS cust
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_07870 | train | T1 |
v1 | Schema:
orders (alias: ord)(code, type, date, amount)
employees(salary, value, code, type)
Task: Find salary from orders where status appears in employees entries with matching status.
SQL: | SELECT salary FROM orders AS ord
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_07871 | train | T1 |
v3 | Schema:
departments (alias: dept)(level, value, amount, id)
staff(value, type, salary, level)
Task: Find name from departments where salary exceeds the average salary from staff for the same level.
SQL: | SELECT name FROM departments AS dept
WHERE salary > (
SELECT SUM(salary) FROM staff AS empl
WHERE empl.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_07872 | train | T1 |
v2 | Schema:
managers (alias: mgr)(name, level, amount, salary)
shipments(name, date, type, code)
Task: Retrieve amount from managers that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_07873 | train | T1 |
v2 | Schema:
services (alias: srvc)(date, id, type, value)
orders(level, amount, status, value)
Task: Retrieve value from services that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT value FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "orders",
"outer_alias": "srvc",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_07874 | train | T2 |
v2 | Schema:
orders (alias: ord)(value, name, type, salary)
invoices(status, date, value, type)
Task: Find value from orders where a matching record exists in invoices with the same type.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_07875 | train | T1 |
v1 | Schema:
staff (alias: empl)(value, id, code, name)
managers(name, id, status, amount)
Task: Retrieve amount from staff whose code is found in managers rows where level matches the outer record.
SQL: | SELECT amount FROM staff AS empl
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_07876 | train | T2 |
v3 | Schema:
shipments (alias: shp)(level, salary, amount, date)
managers(id, type, value, date)
Task: Retrieve amount from shipments with salary above the MAX(salary) of managers rows sharing the same code.
SQL: | SELECT amount FROM shipments AS shp
WHERE salary > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_07877 | train | T2 |
v3 | Schema:
products (alias: prod)(type, name, amount, code)
shipments(code, status, salary, level)
Task: Find value from products where amount exceeds the average amount from shipments for the same level.
SQL: | SELECT value FROM products AS prod
WHERE amount > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.level = prod.level
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_07878 | train | T1 |
v1 | Schema:
orders (alias: ord)(type, value, status, salary)
schedules(salary, value, date, level)
Task: Retrieve salary from orders whose status is found in schedules rows where id matches the outer record.
SQL: | SELECT salary FROM orders AS ord
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_07879 | train | T1 |
v1 | Schema:
budgets (alias: budg)(value, code, id, date)
requests(id, level, amount, status)
Task: Retrieve amount from budgets whose type is found in requests rows where status matches the outer record.
SQL: | SELECT amount FROM budgets AS budg
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "requests",
"outer_alias": "budg",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_07880 | train | T2 |
v1 | Schema:
shipments (alias: shp)(name, status, amount, value)
services(amount, salary, code, type)
Task: Find id from shipments where code appears in services entries with matching status.
SQL: | SELECT id FROM shipments AS shp
WHERE code IN (
SELECT code FROM services AS srvc
WHERE srvc.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "services",
"outer_alias": "shp",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_07881 | train | T2 |
v1 | Schema:
managers (alias: mgr)(level, value, name, status)
staff(id, name, date, type)
Task: Select id from managers where id exists in staff for the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_07882 | train | T1 |
v1 | Schema:
services (alias: srvc)(amount, salary, name, level)
departments(code, id, name, date)
Task: Find code from services where level appears in departments entries with matching status.
SQL: | SELECT code FROM services AS srvc
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "departments",
"outer_alias": "srvc",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_07883 | train | T2 |
v1 | Schema:
managers (alias: mgr)(id, type, date, salary)
sales(code, amount, status, name)
Task: Select salary from managers where level exists in sales for the same status.
SQL: | SELECT salary FROM managers AS mgr
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_07884 | train | T1 |
v2 | Schema:
schedules (alias: schd)(id, value, name, status)
requests(date, level, amount, id)
Task: Retrieve name from schedules that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_07885 | train | T2 |
v3 | Schema:
accounts (alias: acct)(code, date, value, level)
transactions(name, code, id, value)
Task: Retrieve code from accounts with amount above the MAX(value) of transactions rows sharing the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE amount > (
SELECT MAX(value) FROM transactions AS txn
WHERE txn.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_07886 | train | T1 |
v3 | Schema:
schedules (alias: schd)(id, name, type, salary)
shipments(code, salary, date, id)
Task: Find salary from schedules where amount exceeds the average salary from shipments for the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE amount > (
SELECT MIN(salary) FROM shipments AS shp
WHERE shp.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_07887 | train | T2 |
v2 | Schema:
requests (alias: ordr)(type, name, id, status)
regions(id, type, code, level)
Task: Find id from requests where a matching record exists in regions with the same status.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_07888 | train | T2 |
v1 | Schema:
schedules (alias: schd)(value, level, status, code)
sales(amount, level, salary, name)
Task: Retrieve value from schedules whose id is found in sales rows where type matches the outer record.
SQL: | SELECT value FROM schedules AS schd
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_07889 | train | T2 |
v3 | Schema:
regions (alias: rgn)(amount, value, date, name)
customers(id, date, type, value)
Task: Retrieve id from regions with salary above the MAX(amount) of customers rows sharing the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE salary > (
SELECT MAX(amount) FROM customers AS cust
WHERE cust.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_07890 | train | T2 |
v1 | Schema:
services (alias: srvc)(code, value, type, salary)
invoices(type, salary, code, name)
Task: Retrieve id from services whose status is found in invoices rows where status matches the outer record.
SQL: | SELECT id FROM services AS srvc
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "invoices",
"outer_alias": "srvc",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_07891 | train | T2 |
v2 | Schema:
regions (alias: rgn)(code, salary, type, value)
departments(code, name, value, id)
Task: Retrieve value from regions that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_07892 | train | T2 |
v3 | Schema:
items (alias: lne)(type, status, value, date)
managers(code, name, status, level)
Task: Find value from items where salary exceeds the average amount from managers for the same code.
SQL: | SELECT value FROM items AS lne
WHERE salary > (
SELECT MAX(amount) FROM managers AS mgr
WHERE mgr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_07893 | train | T2 |
v2 | Schema:
departments (alias: dept)(value, date, code, type)
staff(amount, date, type, value)
Task: Retrieve amount from departments that have at least one corresponding entry in staff sharing the same type.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_07894 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(date, id, name, type)
sales(code, status, salary, level)
Task: Find amount from warehouses where level appears in sales entries with matching level.
SQL: | SELECT amount FROM warehouses AS whs
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "sales",
"outer_alias": "whs",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_07895 | train | T2 |
v1 | Schema:
budgets (alias: budg)(type, status, code, salary)
sales(type, name, amount, id)
Task: Find name from budgets where code appears in sales entries with matching level.
SQL: | SELECT name FROM budgets AS budg
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "sales",
"outer_alias": "budg",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_07896 | train | T2 |
v3 | Schema:
staff (alias: empl)(code, name, type, level)
departments(code, level, amount, date)
Task: Find value from staff where amount exceeds the average amount from departments for the same level.
SQL: | SELECT value FROM staff AS empl
WHERE amount > (
SELECT MAX(amount) FROM departments AS dept
WHERE dept.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_07897 | train | T2 |
v2 | Schema:
items (alias: lne)(level, amount, code, salary)
transactions(level, salary, date, amount)
Task: Retrieve name from items that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = lne.id
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_07898 | train | T2 |
v3 | Schema:
invoices (alias: inv)(salary, value, status, name)
accounts(id, level, salary, value)
Task: Retrieve id from invoices with salary above the MAX(salary) of accounts rows sharing the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE salary > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_07899 | train | T1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.