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:
sales (alias: sale)(status, amount, code, level)
requests(type, date, status, level)
Task: Retrieve amount from sales that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_10100 | train | T1 |
v3 | Schema:
categories (alias: catg)(code, amount, status, id)
budgets(amount, code, level, value)
Task: Retrieve salary from categories with value above the AVG(value) of budgets rows sharing the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE value > (
SELECT AVG(value) FROM budgets AS budg
WHERE budg.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "budgets",
"outer_alias": "catg",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_10101 | train | T2 |
v1 | Schema:
employees (alias: emp)(amount, date, status, salary)
categories(date, id, value, status)
Task: Select salary from employees where status exists in categories for the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_10102 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(name, code, value, level)
budgets(name, type, date, id)
Task: Find salary from warehouses where amount exceeds the average amount from budgets for the same id.
SQL: | SELECT salary FROM warehouses AS whs
WHERE amount > (
SELECT MIN(amount) FROM budgets AS budg
WHERE budg.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "budgets",
"outer_alias": "whs",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_10103 | train | T2 |
v3 | Schema:
departments (alias: dept)(name, salary, code, id)
employees(id, type, date, name)
Task: Find salary from departments where amount exceeds the average amount from employees for the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE amount > (
SELECT SUM(amount) FROM employees AS emp
WHERE emp.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_10104 | train | T1 |
v3 | Schema:
managers (alias: mgr)(type, date, name, code)
departments(id, level, amount, salary)
Task: Find salary from managers where value exceeds the average salary from departments for the same id.
SQL: | SELECT salary FROM managers AS mgr
WHERE value > (
SELECT AVG(salary) FROM departments AS dept
WHERE dept.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_10105 | train | T1 |
v2 | Schema:
customers (alias: cust)(code, salary, level, amount)
sales(type, value, date, id)
Task: Retrieve salary from customers that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_10106 | train | T1 |
v3 | Schema:
requests (alias: ordr)(level, id, type, salary)
categories(amount, level, type, salary)
Task: Retrieve salary from requests with amount above the MIN(amount) of categories rows sharing the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE amount > (
SELECT MIN(amount) FROM categories AS catg
WHERE catg.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_10107 | train | T2 |
v1 | Schema:
staff (alias: empl)(value, status, name, level)
items(value, id, code, date)
Task: Select id from staff where level exists in items for the same status.
SQL: | SELECT id FROM staff AS empl
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_10108 | train | T2 |
v2 | Schema:
employees (alias: emp)(value, code, amount, status)
services(date, salary, type, level)
Task: Retrieve code from employees that have at least one corresponding entry in services sharing the same code.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "services",
"outer_alias": "emp",
"inner_alias": "srvc",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_10109 | train | T1 |
v2 | Schema:
staff (alias: empl)(status, value, type, code)
transactions(value, status, type, date)
Task: Find amount from staff where a matching record exists in transactions with the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_10110 | train | T2 |
v1 | Schema:
categories (alias: catg)(salary, name, amount, value)
schedules(type, name, status, amount)
Task: Retrieve salary from categories whose id is found in schedules rows where code matches the outer record.
SQL: | SELECT salary FROM categories AS catg
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_10111 | train | T2 |
v2 | Schema:
items (alias: lne)(value, id, name, salary)
services(code, salary, level, name)
Task: Find code from items where a matching record exists in services with the same level.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.level = lne.level
); | {
"outer_table": "items",
"inner_table": "services",
"outer_alias": "lne",
"inner_alias": "srvc",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_10112 | train | T2 |
v2 | Schema:
budgets (alias: budg)(amount, status, date, code)
categories(name, code, date, type)
Task: Find name from budgets where a matching record exists in categories with the same id.
SQL: | SELECT name FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "categories",
"outer_alias": "budg",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_10113 | train | T2 |
v3 | Schema:
invoices (alias: inv)(name, type, status, level)
transactions(status, id, amount, type)
Task: Find salary from invoices where value exceeds the average value from transactions for the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE value > (
SELECT COUNT(value) FROM transactions AS txn
WHERE txn.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_10114 | train | T1 |
v2 | Schema:
regions (alias: rgn)(code, salary, name, value)
categories(amount, salary, type, name)
Task: Retrieve salary from regions that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_10115 | train | T2 |
v2 | Schema:
budgets (alias: budg)(level, name, date, value)
services(amount, code, type, value)
Task: Retrieve name from budgets that have at least one corresponding entry in services sharing the same id.
SQL: | SELECT name FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "services",
"outer_alias": "budg",
"inner_alias": "srvc",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_10116 | train | T2 |
v2 | Schema:
customers (alias: cust)(status, id, date, type)
shipments(code, salary, amount, name)
Task: Find code from customers where a matching record exists in shipments with the same id.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_10117 | train | T1 |
v1 | Schema:
invoices (alias: inv)(code, value, type, salary)
budgets(level, date, code, type)
Task: Select salary from invoices where level exists in budgets for the same type.
SQL: | SELECT salary FROM invoices AS inv
WHERE level IN (
SELECT level FROM budgets AS budg
WHERE budg.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "budgets",
"outer_alias": "inv",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_10118 | train | T1 |
v1 | Schema:
managers (alias: mgr)(name, value, id, type)
sales(level, date, name, value)
Task: Find value from managers where level appears in sales entries with matching id.
SQL: | SELECT value FROM managers AS mgr
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_10119 | train | T1 |
v1 | Schema:
accounts (alias: acct)(id, amount, salary, code)
requests(value, level, salary, code)
Task: Retrieve value from accounts whose type is found in requests rows where code matches the outer record.
SQL: | SELECT value FROM accounts AS acct
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_10120 | train | T1 |
v2 | Schema:
customers (alias: cust)(value, level, name, code)
requests(level, amount, type, code)
Task: Retrieve id from customers that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_10121 | train | T1 |
v2 | Schema:
schedules (alias: schd)(date, id, value, type)
warehouses(value, name, amount, status)
Task: Find salary from schedules where a matching record exists in warehouses with the same id.
SQL: | SELECT salary 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": "salary",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_10122 | train | T2 |
v1 | Schema:
managers (alias: mgr)(amount, type, level, code)
items(amount, type, status, date)
Task: Select amount from managers where level exists in items for the same code.
SQL: | SELECT amount FROM managers AS mgr
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_10123 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(value, type, salary, level)
services(level, type, amount, value)
Task: Find id from warehouses where a matching record exists in services with the same code.
SQL: | SELECT id FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "services",
"outer_alias": "whs",
"inner_alias": "srvc",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_10124 | train | T2 |
v2 | Schema:
staff (alias: empl)(name, id, code, status)
transactions(amount, code, name, id)
Task: Find name from staff where a matching record exists in transactions with the same level.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_10125 | train | T2 |
v1 | Schema:
schedules (alias: schd)(name, id, code, amount)
regions(salary, status, level, date)
Task: Retrieve code from schedules whose status is found in regions rows where status matches the outer record.
SQL: | SELECT code FROM schedules AS schd
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_10126 | train | T2 |
v3 | Schema:
staff (alias: empl)(code, value, status, type)
sales(value, date, level, salary)
Task: Retrieve salary from staff with amount above the AVG(amount) of sales rows sharing the same id.
SQL: | SELECT salary FROM staff AS empl
WHERE amount > (
SELECT AVG(amount) FROM sales AS sale
WHERE sale.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_10127 | train | T2 |
v1 | Schema:
orders (alias: ord)(status, amount, level, value)
sales(value, name, type, id)
Task: Find id from orders where level appears in sales entries with matching id.
SQL: | SELECT id 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": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_10128 | train | T1 |
v3 | Schema:
products (alias: prod)(date, salary, id, name)
items(id, date, salary, value)
Task: Find name from products where amount exceeds the average salary from items for the same status.
SQL: | SELECT name FROM products AS prod
WHERE amount > (
SELECT MIN(salary) FROM items AS lne
WHERE lne.status = prod.status
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_10129 | train | T1 |
v1 | Schema:
schedules (alias: schd)(date, status, type, amount)
services(level, code, value, date)
Task: Find id from schedules where level appears in services entries with matching id.
SQL: | SELECT id FROM schedules AS schd
WHERE level IN (
SELECT level FROM services AS srvc
WHERE srvc.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "services",
"outer_alias": "schd",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_10130 | train | T2 |
v2 | Schema:
employees (alias: emp)(date, salary, id, level)
schedules(code, salary, name, type)
Task: Retrieve id from employees that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_10131 | train | T1 |
v1 | Schema:
transactions (alias: txn)(name, status, value, salary)
departments(code, level, date, type)
Task: Retrieve value from transactions whose type is found in departments rows where type matches the outer record.
SQL: | SELECT value FROM transactions AS txn
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_10132 | train | T1 |
v1 | Schema:
employees (alias: emp)(salary, code, value, id)
schedules(level, id, salary, date)
Task: Find name from employees where level appears in schedules entries with matching code.
SQL: | SELECT name FROM employees AS emp
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_10133 | train | T1 |
v3 | Schema:
categories (alias: catg)(name, code, level, date)
customers(id, salary, value, date)
Task: Find value from categories where amount exceeds the average amount from customers for the same code.
SQL: | SELECT value FROM categories AS catg
WHERE amount > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_10134 | train | T2 |
v1 | Schema:
regions (alias: rgn)(amount, salary, level, type)
staff(id, amount, status, name)
Task: Find id from regions where id appears in staff entries with matching code.
SQL: | SELECT id FROM regions AS rgn
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_10135 | train | T2 |
v3 | Schema:
regions (alias: rgn)(id, code, date, salary)
products(code, value, salary, name)
Task: Retrieve amount from regions with amount above the SUM(value) of products rows sharing the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE amount > (
SELECT SUM(value) FROM products AS prod
WHERE prod.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_10136 | train | T2 |
v3 | Schema:
managers (alias: mgr)(name, status, value, id)
items(value, status, name, date)
Task: Retrieve name from managers with salary above the AVG(amount) of items rows sharing the same code.
SQL: | SELECT name FROM managers AS mgr
WHERE salary > (
SELECT AVG(amount) FROM items AS lne
WHERE lne.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_10137 | train | T1 |
v3 | Schema:
regions (alias: rgn)(type, id, salary, status)
services(salary, code, status, amount)
Task: Find id from regions where value exceeds the average value from services for the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE value > (
SELECT AVG(value) FROM services AS srvc
WHERE srvc.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "services",
"outer_alias": "rgn",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_10138 | train | T2 |
v1 | Schema:
services (alias: srvc)(level, name, salary, type)
schedules(name, code, status, type)
Task: Find id from services where level appears in schedules entries with matching level.
SQL: | SELECT id FROM services AS srvc
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "schedules",
"outer_alias": "srvc",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_10139 | train | T2 |
v1 | Schema:
invoices (alias: inv)(type, code, salary, date)
customers(date, type, amount, status)
Task: Find value from invoices where code appears in customers entries with matching status.
SQL: | SELECT value FROM invoices AS inv
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_10140 | train | T1 |
v3 | Schema:
managers (alias: mgr)(salary, code, type, amount)
departments(date, type, value, id)
Task: Find name from managers where value exceeds the average value from departments for the same type.
SQL: | SELECT name FROM managers AS mgr
WHERE value > (
SELECT SUM(value) FROM departments AS dept
WHERE dept.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_10141 | train | T1 |
v3 | Schema:
managers (alias: mgr)(id, type, level, code)
requests(type, code, level, name)
Task: Retrieve code from managers with value above the MIN(salary) of requests rows sharing the same level.
SQL: | SELECT code FROM managers AS mgr
WHERE value > (
SELECT MIN(salary) FROM requests AS ordr
WHERE ordr.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_10142 | train | T1 |
v1 | Schema:
sales (alias: sale)(date, value, status, salary)
staff(type, status, code, id)
Task: Find code from sales where code appears in staff entries with matching type.
SQL: | SELECT code FROM sales AS sale
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_10143 | train | T1 |
v3 | Schema:
transactions (alias: txn)(type, level, salary, amount)
products(id, type, date, status)
Task: Find value from transactions where value exceeds the average salary from products for the same code.
SQL: | SELECT value FROM transactions AS txn
WHERE value > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_10144 | train | T1 |
v3 | Schema:
accounts (alias: acct)(code, value, type, name)
orders(code, name, date, amount)
Task: Find code from accounts where amount exceeds the average salary from orders for the same id.
SQL: | SELECT code FROM accounts AS acct
WHERE amount > (
SELECT MAX(salary) FROM orders AS ord
WHERE ord.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_10145 | train | T1 |
v3 | Schema:
employees (alias: emp)(level, value, status, amount)
shipments(type, level, date, id)
Task: Find code from employees where value exceeds the average salary from shipments for the same code.
SQL: | SELECT code FROM employees AS emp
WHERE value > (
SELECT SUM(salary) FROM shipments AS shp
WHERE shp.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_10146 | train | T1 |
v1 | Schema:
customers (alias: cust)(value, type, salary, id)
categories(name, amount, level, id)
Task: Find value from customers where type appears in categories entries with matching id.
SQL: | SELECT value FROM customers AS cust
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_10147 | train | T1 |
v1 | Schema:
shipments (alias: shp)(amount, date, value, type)
schedules(value, amount, id, status)
Task: Find code from shipments where level appears in schedules entries with matching id.
SQL: | SELECT code FROM shipments AS shp
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_10148 | train | T2 |
v1 | Schema:
transactions (alias: txn)(status, name, amount, code)
staff(id, status, date, value)
Task: Find name from transactions where status appears in staff entries with matching id.
SQL: | SELECT name FROM transactions AS txn
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_10149 | train | T1 |
v2 | Schema:
shipments (alias: shp)(salary, date, value, amount)
departments(name, date, salary, id)
Task: Retrieve salary from shipments that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_10150 | train | T2 |
v2 | Schema:
customers (alias: cust)(type, amount, name, salary)
accounts(id, type, level, amount)
Task: Find salary from customers where a matching record exists in accounts with the same id.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_10151 | train | T1 |
v3 | Schema:
services (alias: srvc)(level, value, date, name)
sales(level, name, code, date)
Task: Retrieve id from services with amount above the AVG(amount) of sales rows sharing the same level.
SQL: | SELECT id FROM services AS srvc
WHERE amount > (
SELECT AVG(amount) 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": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_10152 | train | T2 |
v3 | Schema:
items (alias: lne)(type, status, name, salary)
schedules(date, status, level, name)
Task: Find id from items where value exceeds the average amount from schedules for the same id.
SQL: | SELECT id FROM items AS lne
WHERE value > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.id = lne.id
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_10153 | train | T2 |
v3 | Schema:
shipments (alias: shp)(level, value, id, status)
items(id, name, value, status)
Task: Retrieve id from shipments with amount above the MAX(salary) of items rows sharing the same level.
SQL: | SELECT id FROM shipments AS shp
WHERE amount > (
SELECT MAX(salary) FROM items AS lne
WHERE lne.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_10154 | train | T2 |
v2 | Schema:
invoices (alias: inv)(id, value, salary, code)
items(salary, name, status, date)
Task: Retrieve value from invoices that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_10155 | train | T1 |
v2 | Schema:
services (alias: srvc)(salary, code, type, value)
employees(status, date, name, level)
Task: Find amount from services where a matching record exists in employees with the same level.
SQL: | SELECT amount FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "employees",
"outer_alias": "srvc",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_10156 | train | T2 |
v3 | Schema:
employees (alias: emp)(type, status, level, salary)
transactions(type, value, salary, id)
Task: Retrieve code from employees with amount above the MIN(value) of transactions rows sharing the same status.
SQL: | SELECT code FROM employees AS emp
WHERE amount > (
SELECT MIN(value) FROM transactions AS txn
WHERE txn.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_10157 | train | T1 |
v2 | Schema:
sales (alias: sale)(status, value, type, code)
budgets(type, code, name, date)
Task: Find value from sales where a matching record exists in budgets with the same code.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "budgets",
"outer_alias": "sale",
"inner_alias": "budg",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_10158 | train | T1 |
v1 | Schema:
regions (alias: rgn)(salary, date, name, id)
items(type, value, id, name)
Task: Retrieve amount from regions whose type is found in items rows where status matches the outer record.
SQL: | SELECT amount FROM regions AS rgn
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_10159 | train | T2 |
v1 | Schema:
customers (alias: cust)(level, name, amount, status)
accounts(id, type, amount, date)
Task: Retrieve id from customers whose level is found in accounts rows where type matches the outer record.
SQL: | SELECT id FROM customers AS cust
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_10160 | train | T1 |
v2 | Schema:
transactions (alias: txn)(salary, name, type, level)
invoices(date, id, status, amount)
Task: Retrieve amount from transactions that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_10161 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(id, date, code, name)
employees(level, salary, type, date)
Task: Find amount from warehouses where amount exceeds the average salary from employees for the same status.
SQL: | SELECT amount FROM warehouses AS whs
WHERE amount > (
SELECT MIN(salary) FROM employees AS emp
WHERE emp.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "employees",
"outer_alias": "whs",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_10162 | train | T2 |
v1 | Schema:
services (alias: srvc)(code, date, level, id)
departments(name, salary, value, code)
Task: Retrieve name from services whose code is found in departments rows where status matches the outer record.
SQL: | SELECT name FROM services AS srvc
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "departments",
"outer_alias": "srvc",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_10163 | train | T2 |
v1 | Schema:
staff (alias: empl)(salary, id, date, code)
transactions(salary, status, id, amount)
Task: Retrieve id from staff whose id is found in transactions rows where level matches the outer record.
SQL: | SELECT id FROM staff AS empl
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_10164 | train | T2 |
v1 | Schema:
regions (alias: rgn)(status, level, id, amount)
shipments(level, status, id, code)
Task: Select code from regions where id exists in shipments for the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_10165 | train | T2 |
v2 | Schema:
departments (alias: dept)(level, amount, date, name)
employees(level, code, date, status)
Task: Find name from departments where a matching record exists in employees with the same id.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_10166 | train | T1 |
v2 | Schema:
orders (alias: ord)(id, amount, date, status)
accounts(code, value, amount, id)
Task: Retrieve salary from orders that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_10167 | train | T1 |
v1 | Schema:
transactions (alias: txn)(date, amount, code, level)
managers(status, code, amount, name)
Task: Select salary from transactions where level exists in managers for the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_10168 | train | T1 |
v3 | Schema:
departments (alias: dept)(level, amount, value, name)
budgets(date, value, name, id)
Task: Find code from departments where value exceeds the average salary from budgets for the same id.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT MAX(salary) FROM budgets AS budg
WHERE budg.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "budgets",
"outer_alias": "dept",
"inner_alias": "budg",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_10169 | train | T1 |
v2 | Schema:
managers (alias: mgr)(amount, level, id, status)
shipments(date, id, level, amount)
Task: Retrieve name from managers that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_10170 | train | T1 |
v1 | Schema:
staff (alias: empl)(date, value, code, level)
invoices(type, amount, level, name)
Task: Find value from staff where type appears in invoices entries with matching id.
SQL: | SELECT value FROM staff AS empl
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_10171 | train | T2 |
v2 | Schema:
schedules (alias: schd)(code, amount, value, salary)
services(status, type, date, value)
Task: Find id from schedules where a matching record exists in services with the same level.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "services",
"outer_alias": "schd",
"inner_alias": "srvc",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_10172 | train | T2 |
v1 | Schema:
requests (alias: ordr)(status, amount, date, level)
employees(name, level, date, amount)
Task: Find salary from requests where status appears in employees entries with matching level.
SQL: | SELECT salary FROM requests AS ordr
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_10173 | train | T2 |
v1 | Schema:
shipments (alias: shp)(name, value, status, type)
managers(value, id, type, status)
Task: Find code from shipments where id appears in managers entries with matching status.
SQL: | SELECT code FROM shipments AS shp
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_10174 | train | T2 |
v1 | Schema:
items (alias: lne)(id, code, salary, date)
managers(id, level, type, code)
Task: Select code from items where status exists in managers for the same code.
SQL: | SELECT code FROM items AS lne
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_10175 | train | T2 |
v2 | Schema:
invoices (alias: inv)(amount, type, code, date)
transactions(status, id, type, level)
Task: Find name from invoices where a matching record exists in transactions with the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_10176 | train | T1 |
v3 | Schema:
customers (alias: cust)(name, value, level, type)
warehouses(date, amount, name, level)
Task: Retrieve salary from customers with salary above the MAX(salary) of warehouses rows sharing the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE salary > (
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": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_10177 | train | T1 |
v3 | Schema:
schedules (alias: schd)(level, type, status, id)
sales(type, name, amount, date)
Task: Retrieve value from schedules with amount above the MIN(value) of sales rows sharing the same type.
SQL: | SELECT value FROM schedules AS schd
WHERE amount > (
SELECT MIN(value) 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": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_10178 | train | T2 |
v2 | Schema:
categories (alias: catg)(name, code, level, value)
services(code, salary, level, date)
Task: Retrieve code from categories that have at least one corresponding entry in services sharing the same type.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "services",
"outer_alias": "catg",
"inner_alias": "srvc",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_10179 | train | T2 |
v2 | Schema:
products (alias: prod)(code, status, id, salary)
orders(amount, salary, id, level)
Task: Retrieve amount from products that have at least one corresponding entry in orders sharing the same status.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = prod.status
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_10180 | train | T1 |
v2 | Schema:
orders (alias: ord)(date, value, code, amount)
requests(code, amount, salary, id)
Task: Find name from orders where a matching record exists in requests with the same id.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_10181 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(date, type, level, salary)
budgets(date, value, type, status)
Task: Find value from warehouses where a matching record exists in budgets with the same level.
SQL: | SELECT value FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "budgets",
"outer_alias": "whs",
"inner_alias": "budg",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_10182 | train | T2 |
v2 | Schema:
staff (alias: empl)(id, date, code, amount)
orders(salary, date, name, id)
Task: Retrieve id from staff that have at least one corresponding entry in orders sharing the same status.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_10183 | train | T2 |
v3 | Schema:
items (alias: lne)(type, id, value, status)
transactions(type, id, value, status)
Task: Retrieve code from items with salary above the COUNT(amount) of transactions rows sharing the same level.
SQL: | SELECT code FROM items AS lne
WHERE salary > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_10184 | train | T2 |
v2 | Schema:
shipments (alias: shp)(date, level, amount, status)
departments(salary, code, amount, type)
Task: Find id from shipments where a matching record exists in departments with the same status.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_10185 | train | T2 |
v1 | Schema:
services (alias: srvc)(type, status, date, id)
items(date, amount, id, status)
Task: Find salary from services where code appears in items entries with matching level.
SQL: | SELECT salary FROM services AS srvc
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "items",
"outer_alias": "srvc",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_10186 | train | T2 |
v3 | Schema:
schedules (alias: schd)(code, id, name, amount)
transactions(code, name, status, date)
Task: Retrieve id from schedules with amount above the SUM(amount) of transactions rows sharing the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE amount > (
SELECT SUM(amount) FROM transactions AS txn
WHERE txn.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_10187 | train | T2 |
v1 | Schema:
regions (alias: rgn)(id, level, amount, value)
products(id, status, salary, amount)
Task: Retrieve value from regions whose level is found in products rows where code matches the outer record.
SQL: | SELECT value FROM regions AS rgn
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_10188 | train | T2 |
v2 | Schema:
requests (alias: ordr)(code, status, level, date)
products(code, type, level, value)
Task: Retrieve code from requests that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_10189 | train | T2 |
v1 | Schema:
shipments (alias: shp)(code, type, amount, level)
staff(code, id, value, type)
Task: Select amount from shipments where type exists in staff for the same code.
SQL: | SELECT amount FROM shipments AS shp
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_10190 | train | T2 |
v1 | Schema:
products (alias: prod)(type, name, id, salary)
categories(value, amount, level, date)
Task: Select code from products where status exists in categories for the same type.
SQL: | SELECT code FROM products AS prod
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.type = prod.type
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_10191 | train | T1 |
v3 | Schema:
regions (alias: rgn)(level, type, status, code)
requests(name, status, salary, date)
Task: Retrieve salary from regions with salary above the MIN(amount) of requests rows sharing the same type.
SQL: | SELECT salary FROM regions AS rgn
WHERE salary > (
SELECT MIN(amount) FROM requests AS ordr
WHERE ordr.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_10192 | train | T2 |
v2 | Schema:
accounts (alias: acct)(date, salary, id, level)
managers(name, status, code, salary)
Task: Find amount from accounts where a matching record exists in managers with the same code.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_10193 | train | T1 |
v2 | Schema:
customers (alias: cust)(id, level, salary, type)
invoices(type, name, value, level)
Task: Find amount from customers where a matching record exists in invoices with the same code.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_10194 | train | T1 |
v2 | Schema:
staff (alias: empl)(id, level, status, value)
managers(id, date, type, value)
Task: Find amount from staff where a matching record exists in managers with the same type.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_10195 | train | T2 |
v2 | Schema:
customers (alias: cust)(value, salary, type, name)
accounts(level, date, name, code)
Task: Retrieve amount from customers that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_10196 | train | T1 |
v1 | Schema:
regions (alias: rgn)(id, name, value, level)
warehouses(salary, value, date, amount)
Task: Retrieve salary from regions whose code is found in warehouses rows where id matches the outer record.
SQL: | SELECT salary FROM regions AS rgn
WHERE code IN (
SELECT code FROM warehouses AS whs
WHERE whs.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "warehouses",
"outer_alias": "rgn",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_10197 | train | T2 |
v3 | Schema:
departments (alias: dept)(id, value, type, salary)
staff(status, type, value, salary)
Task: Retrieve id from departments with value above the MAX(value) of staff rows sharing the same status.
SQL: | SELECT id FROM departments AS dept
WHERE value > (
SELECT MAX(value) FROM staff AS empl
WHERE empl.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_10198 | train | T1 |
v3 | Schema:
categories (alias: catg)(value, date, salary, level)
accounts(type, salary, value, amount)
Task: Find name from categories where value exceeds the average value from accounts for the same code.
SQL: | SELECT name FROM categories AS catg
WHERE value > (
SELECT COUNT(value) FROM accounts AS acct
WHERE acct.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_10199 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.