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:
managers (alias: mgr)(amount, value, code, id)
services(salary, amount, status, value)
Task: Retrieve code from managers with value above the SUM(value) of services rows sharing the same type.
SQL: | SELECT code FROM managers AS mgr
WHERE value > (
SELECT SUM(value) FROM services AS srvc
WHERE srvc.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "services",
"outer_alias": "mgr",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_09200 | train | T1 |
v3 | Schema:
schedules (alias: schd)(name, level, id, code)
items(level, salary, value, amount)
Task: Find name from schedules where salary exceeds the average salary from items for the same type.
SQL: | SELECT name FROM schedules AS schd
WHERE salary > (
SELECT SUM(salary) FROM items AS lne
WHERE lne.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_09201 | train | T2 |
v3 | Schema:
requests (alias: ordr)(amount, type, level, date)
customers(value, code, salary, id)
Task: Retrieve amount from requests with value above the MAX(value) of customers rows sharing the same status.
SQL: | SELECT amount FROM requests AS ordr
WHERE value > (
SELECT MAX(value) FROM customers AS cust
WHERE cust.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_09202 | train | T2 |
v2 | Schema:
accounts (alias: acct)(date, type, name, amount)
departments(status, name, id, amount)
Task: Find id from accounts where a matching record exists in departments with the same id.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_09203 | train | T1 |
v1 | Schema:
services (alias: srvc)(date, value, amount, level)
schedules(id, salary, name, code)
Task: Select salary from services where status exists in schedules for the same level.
SQL: | SELECT salary FROM services AS srvc
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "schedules",
"outer_alias": "srvc",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_09204 | train | T2 |
v3 | Schema:
employees (alias: emp)(status, id, value, type)
schedules(type, status, level, date)
Task: Find id from employees where amount exceeds the average value from schedules for the same code.
SQL: | SELECT id FROM employees AS emp
WHERE amount > (
SELECT MIN(value) FROM schedules AS schd
WHERE schd.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_09205 | train | T1 |
v3 | Schema:
categories (alias: catg)(value, type, amount, id)
orders(level, salary, status, type)
Task: Retrieve name from categories with value above the MAX(amount) of orders rows sharing the same status.
SQL: | SELECT name FROM categories AS catg
WHERE value > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_09206 | train | T2 |
v2 | Schema:
departments (alias: dept)(amount, type, value, code)
categories(code, status, id, salary)
Task: Retrieve amount from departments that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_09207 | train | T1 |
v1 | Schema:
transactions (alias: txn)(amount, date, value, salary)
customers(name, level, value, code)
Task: Retrieve value from transactions whose status is found in customers rows where type matches the outer record.
SQL: | SELECT value FROM transactions AS txn
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_09208 | train | T1 |
v1 | Schema:
invoices (alias: inv)(name, code, date, level)
products(date, status, type, level)
Task: Find name from invoices where type appears in products entries with matching status.
SQL: | SELECT name FROM invoices AS inv
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_09209 | train | T1 |
v2 | Schema:
departments (alias: dept)(code, value, amount, status)
orders(id, value, status, level)
Task: Retrieve id from departments that have at least one corresponding entry in orders sharing the same status.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_09210 | train | T1 |
v3 | Schema:
regions (alias: rgn)(id, code, name, value)
requests(date, type, status, id)
Task: Find value from regions where value exceeds the average salary from requests for the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE value > (
SELECT COUNT(salary) FROM requests AS ordr
WHERE ordr.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_09211 | train | T2 |
v3 | Schema:
products (alias: prod)(id, status, code, level)
sales(id, type, code, value)
Task: Find code from products where value exceeds the average amount from sales for the same level.
SQL: | SELECT code FROM products AS prod
WHERE value > (
SELECT AVG(amount) FROM sales AS sale
WHERE sale.level = prod.level
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_09212 | train | T1 |
v1 | Schema:
customers (alias: cust)(salary, status, name, value)
budgets(code, type, name, level)
Task: Retrieve amount from customers whose code is found in budgets rows where level matches the outer record.
SQL: | SELECT amount FROM customers AS cust
WHERE code IN (
SELECT code FROM budgets AS budg
WHERE budg.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "budgets",
"outer_alias": "cust",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_09213 | train | T1 |
v1 | Schema:
invoices (alias: inv)(name, code, id, status)
sales(date, name, id, status)
Task: Select code from invoices where level exists in sales for the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_09214 | train | T1 |
v3 | Schema:
requests (alias: ordr)(value, amount, name, level)
shipments(value, type, id, salary)
Task: Find code from requests where amount exceeds the average amount from shipments for the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE amount > (
SELECT MAX(amount) FROM shipments AS shp
WHERE shp.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_09215 | train | T2 |
v3 | Schema:
requests (alias: ordr)(level, status, code, date)
employees(id, type, salary, level)
Task: Find value from requests where amount exceeds the average salary from employees for the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE amount > (
SELECT MIN(salary) FROM employees AS emp
WHERE emp.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_09216 | train | T2 |
v1 | Schema:
categories (alias: catg)(date, amount, level, status)
staff(value, type, name, code)
Task: Find salary from categories where type appears in staff entries with matching type.
SQL: | SELECT salary FROM categories AS catg
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_09217 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(type, salary, code, value)
regions(value, amount, level, status)
Task: Find salary from warehouses where value exceeds the average amount from regions for the same code.
SQL: | SELECT salary FROM warehouses AS whs
WHERE value > (
SELECT AVG(amount) FROM regions AS rgn
WHERE rgn.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "regions",
"outer_alias": "whs",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_09218 | train | T2 |
v3 | Schema:
categories (alias: catg)(level, status, value, amount)
products(name, date, id, salary)
Task: Retrieve amount from categories with value above the SUM(salary) of products rows sharing the same id.
SQL: | SELECT amount FROM categories AS catg
WHERE value > (
SELECT SUM(salary) FROM products AS prod
WHERE prod.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_09219 | train | T2 |
v1 | Schema:
transactions (alias: txn)(amount, name, level, salary)
invoices(date, amount, value, type)
Task: Select name from transactions where level exists in invoices for the same type.
SQL: | SELECT name FROM transactions AS txn
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_09220 | train | T1 |
v3 | Schema:
orders (alias: ord)(status, type, date, salary)
regions(code, id, name, amount)
Task: Find name from orders where amount exceeds the average value from regions for the same id.
SQL: | SELECT name FROM orders AS ord
WHERE amount > (
SELECT AVG(value) FROM regions AS rgn
WHERE rgn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_09221 | train | T1 |
v1 | Schema:
employees (alias: emp)(amount, salary, level, code)
managers(date, amount, value, status)
Task: Find amount from employees where level appears in managers entries with matching id.
SQL: | SELECT amount FROM employees AS emp
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_09222 | train | T1 |
v1 | Schema:
schedules (alias: schd)(value, level, salary, date)
employees(level, amount, salary, type)
Task: Retrieve name from schedules whose code is found in employees rows where type matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_09223 | train | T2 |
v3 | Schema:
regions (alias: rgn)(value, amount, code, status)
transactions(date, name, level, salary)
Task: Retrieve value from regions with amount above the COUNT(amount) of transactions rows sharing the same level.
SQL: | SELECT value FROM regions AS rgn
WHERE amount > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_09224 | train | T2 |
v1 | Schema:
requests (alias: ordr)(level, code, date, status)
managers(status, name, date, amount)
Task: Select salary from requests where status exists in managers for the same code.
SQL: | SELECT salary FROM requests AS ordr
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_09225 | train | T2 |
v2 | Schema:
requests (alias: ordr)(amount, status, salary, name)
managers(amount, value, salary, name)
Task: Retrieve amount from requests that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_09226 | train | T2 |
v2 | Schema:
shipments (alias: shp)(type, date, status, level)
budgets(id, level, code, name)
Task: Retrieve value from shipments that have at least one corresponding entry in budgets sharing the same type.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "budgets",
"outer_alias": "shp",
"inner_alias": "budg",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_09227 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(value, code, status, date)
managers(type, id, level, status)
Task: Find amount from warehouses where type appears in managers entries with matching code.
SQL: | SELECT amount FROM warehouses AS whs
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "managers",
"outer_alias": "whs",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_09228 | train | T2 |
v1 | Schema:
budgets (alias: budg)(value, amount, code, status)
customers(amount, name, salary, status)
Task: Retrieve salary from budgets whose type is found in customers rows where level matches the outer record.
SQL: | SELECT salary FROM budgets AS budg
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "customers",
"outer_alias": "budg",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_09229 | train | T2 |
v3 | Schema:
requests (alias: ordr)(id, date, level, amount)
shipments(id, level, name, status)
Task: Find name from requests where salary exceeds the average amount from shipments for the same type.
SQL: | SELECT name FROM requests AS ordr
WHERE salary > (
SELECT MAX(amount) FROM shipments AS shp
WHERE shp.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_09230 | train | T2 |
v3 | Schema:
schedules (alias: schd)(level, value, type, salary)
accounts(level, code, value, id)
Task: Retrieve salary from schedules with salary above the SUM(salary) of accounts rows sharing the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE salary > (
SELECT SUM(salary) FROM accounts AS acct
WHERE acct.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_09231 | train | T2 |
v1 | Schema:
services (alias: srvc)(code, type, salary, value)
orders(level, id, date, salary)
Task: Retrieve salary from services whose status is found in orders rows where type matches the outer record.
SQL: | SELECT salary FROM services AS srvc
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "orders",
"outer_alias": "srvc",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_09232 | train | T2 |
v1 | Schema:
customers (alias: cust)(status, value, name, level)
categories(date, salary, type, name)
Task: Select id from customers where level exists in categories for the same type.
SQL: | SELECT id FROM customers AS cust
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_09233 | train | T1 |
v2 | Schema:
customers (alias: cust)(code, salary, amount, level)
orders(value, type, status, date)
Task: Find salary from customers where a matching record exists in orders with the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_09234 | train | T1 |
v2 | Schema:
regions (alias: rgn)(code, name, date, status)
invoices(type, salary, date, status)
Task: Retrieve value from regions that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_09235 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(status, name, amount, value)
orders(status, type, amount, salary)
Task: Select value from warehouses where id exists in orders for the same type.
SQL: | SELECT value FROM warehouses AS whs
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "orders",
"outer_alias": "whs",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_09236 | train | T2 |
v1 | Schema:
shipments (alias: shp)(date, id, status, amount)
managers(code, type, status, salary)
Task: Retrieve name from shipments whose code is found in managers rows where code matches the outer record.
SQL: | SELECT name FROM shipments AS shp
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_09237 | train | T2 |
v1 | Schema:
categories (alias: catg)(type, status, value, salary)
managers(date, status, name, value)
Task: Find amount from categories where status appears in managers entries with matching status.
SQL: | SELECT amount FROM categories AS catg
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_09238 | train | T2 |
v3 | Schema:
shipments (alias: shp)(name, code, status, type)
transactions(id, amount, value, name)
Task: Find amount from shipments where salary exceeds the average amount from transactions for the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE salary > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_09239 | train | T2 |
v1 | Schema:
departments (alias: dept)(salary, amount, level, value)
managers(level, date, name, value)
Task: Retrieve amount from departments whose code is found in managers rows where code matches the outer record.
SQL: | SELECT amount FROM departments AS dept
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_09240 | train | T1 |
v3 | Schema:
sales (alias: sale)(level, id, date, type)
departments(level, id, type, name)
Task: Retrieve salary from sales with salary above the AVG(amount) of departments rows sharing the same status.
SQL: | SELECT salary FROM sales AS sale
WHERE salary > (
SELECT AVG(amount) FROM departments AS dept
WHERE dept.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_09241 | train | T1 |
v2 | Schema:
schedules (alias: schd)(id, salary, status, amount)
orders(salary, date, name, code)
Task: Find code from schedules where a matching record exists in orders with the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_09242 | train | T2 |
v2 | Schema:
staff (alias: empl)(salary, value, name, status)
requests(value, level, salary, status)
Task: Find value from staff where a matching record exists in requests with the same status.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_09243 | train | T2 |
v1 | Schema:
products (alias: prod)(level, value, status, salary)
shipments(name, id, amount, type)
Task: Select name from products where id exists in shipments for the same code.
SQL: | SELECT name FROM products AS prod
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.code = prod.code
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_09244 | train | T1 |
v2 | Schema:
requests (alias: ordr)(code, value, amount, type)
departments(date, code, name, status)
Task: Retrieve salary from requests that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_09245 | train | T2 |
v1 | Schema:
orders (alias: ord)(salary, date, value, id)
services(amount, value, level, type)
Task: Find name from orders where code appears in services entries with matching code.
SQL: | SELECT name FROM orders AS ord
WHERE code IN (
SELECT code FROM services AS srvc
WHERE srvc.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "services",
"outer_alias": "ord",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_09246 | train | T1 |
v1 | Schema:
staff (alias: empl)(date, salary, id, type)
employees(salary, level, name, id)
Task: Retrieve name from staff whose level is found in employees rows where status matches the outer record.
SQL: | SELECT name FROM staff AS empl
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_09247 | train | T2 |
v2 | Schema:
transactions (alias: txn)(level, id, status, name)
regions(status, value, salary, amount)
Task: Find code from transactions where a matching record exists in regions with the same type.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_09248 | train | T1 |
v1 | Schema:
services (alias: srvc)(type, value, status, code)
items(id, type, salary, level)
Task: Select value from services where code exists in items for the same type.
SQL: | SELECT value FROM services AS srvc
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "items",
"outer_alias": "srvc",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_09249 | train | T2 |
v3 | Schema:
orders (alias: ord)(amount, value, salary, id)
departments(amount, name, id, level)
Task: Retrieve id from orders with value above the AVG(amount) of departments rows sharing the same status.
SQL: | SELECT id FROM orders AS ord
WHERE value > (
SELECT AVG(amount) FROM departments AS dept
WHERE dept.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_09250 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(value, level, date, status)
budgets(code, amount, level, status)
Task: Find value from warehouses where value exceeds the average value from budgets for the same type.
SQL: | SELECT value FROM warehouses AS whs
WHERE value > (
SELECT COUNT(value) FROM budgets AS budg
WHERE budg.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "budgets",
"outer_alias": "whs",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_09251 | train | T2 |
v3 | Schema:
items (alias: lne)(level, date, amount, status)
budgets(value, salary, id, code)
Task: Find name from items where salary exceeds the average amount from budgets for the same id.
SQL: | SELECT name FROM items AS lne
WHERE salary > (
SELECT MAX(amount) FROM budgets AS budg
WHERE budg.id = lne.id
); | {
"outer_table": "items",
"inner_table": "budgets",
"outer_alias": "lne",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_09252 | train | T2 |
v2 | Schema:
employees (alias: emp)(status, name, code, type)
budgets(salary, status, id, amount)
Task: Retrieve amount from employees that have at least one corresponding entry in budgets sharing the same id.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "budgets",
"outer_alias": "emp",
"inner_alias": "budg",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_09253 | train | T1 |
v3 | Schema:
departments (alias: dept)(level, name, id, date)
orders(type, status, amount, id)
Task: Retrieve amount from departments with amount above the SUM(value) of orders rows sharing the same code.
SQL: | SELECT amount FROM departments AS dept
WHERE amount > (
SELECT SUM(value) FROM orders AS ord
WHERE ord.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_09254 | train | T1 |
v2 | Schema:
staff (alias: empl)(type, id, status, name)
accounts(salary, name, id, level)
Task: Retrieve code from staff that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_09255 | train | T2 |
v2 | Schema:
departments (alias: dept)(level, id, value, amount)
services(code, date, salary, id)
Task: Find name from departments where a matching record exists in services with the same code.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "services",
"outer_alias": "dept",
"inner_alias": "srvc",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_09256 | train | T1 |
v2 | Schema:
staff (alias: empl)(amount, date, name, level)
employees(id, salary, date, name)
Task: Find name from staff where a matching record exists in employees with the same type.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_09257 | train | T2 |
v2 | Schema:
employees (alias: emp)(code, level, id, status)
budgets(value, name, id, type)
Task: Retrieve id from employees that have at least one corresponding entry in budgets sharing the same status.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "budgets",
"outer_alias": "emp",
"inner_alias": "budg",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_09258 | train | T1 |
v1 | Schema:
employees (alias: emp)(id, salary, date, type)
accounts(date, value, level, status)
Task: Select name from employees where type exists in accounts for the same status.
SQL: | SELECT name FROM employees AS emp
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_09259 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(date, name, code, amount)
transactions(id, name, type, code)
Task: Find id from warehouses where type appears in transactions entries with matching code.
SQL: | SELECT id FROM warehouses AS whs
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "transactions",
"outer_alias": "whs",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_09260 | train | T2 |
v2 | Schema:
categories (alias: catg)(level, type, amount, id)
managers(name, value, date, code)
Task: Find id from categories where a matching record exists in managers with the same code.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_09261 | train | T2 |
v2 | Schema:
staff (alias: empl)(code, status, date, value)
regions(name, amount, level, salary)
Task: Retrieve code from staff that have at least one corresponding entry in regions sharing the same level.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_09262 | train | T2 |
v1 | Schema:
employees (alias: emp)(level, id, code, salary)
warehouses(salary, type, date, level)
Task: Select code from employees where id exists in warehouses for the same status.
SQL: | SELECT code FROM employees AS emp
WHERE id IN (
SELECT id FROM warehouses AS whs
WHERE whs.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "warehouses",
"outer_alias": "emp",
"inner_alias": "whs",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_09263 | train | T1 |
v2 | Schema:
employees (alias: emp)(date, value, salary, type)
invoices(type, id, status, salary)
Task: Retrieve id from employees that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_09264 | train | T1 |
v1 | Schema:
items (alias: lne)(type, amount, value, id)
transactions(type, id, status, salary)
Task: Select salary from items where id exists in transactions for the same level.
SQL: | SELECT salary FROM items AS lne
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_09265 | train | T2 |
v3 | Schema:
budgets (alias: budg)(salary, type, status, code)
orders(id, type, amount, level)
Task: Retrieve salary from budgets with value above the MAX(value) of orders rows sharing the same code.
SQL: | SELECT salary FROM budgets AS budg
WHERE value > (
SELECT MAX(value) FROM orders AS ord
WHERE ord.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "orders",
"outer_alias": "budg",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_09266 | train | T2 |
v2 | Schema:
invoices (alias: inv)(level, type, amount, date)
employees(amount, date, status, level)
Task: Find name from invoices where a matching record exists in employees with the same code.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_09267 | train | T1 |
v1 | Schema:
categories (alias: catg)(salary, level, value, amount)
customers(status, code, amount, type)
Task: Select salary from categories where code exists in customers for the same status.
SQL: | SELECT salary FROM categories AS catg
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_09268 | train | T2 |
v2 | Schema:
regions (alias: rgn)(date, level, salary, name)
products(id, level, code, date)
Task: Retrieve value from regions that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_09269 | train | T2 |
v3 | Schema:
items (alias: lne)(name, code, date, id)
sales(amount, status, code, name)
Task: Find amount from items where amount exceeds the average amount from sales for the same level.
SQL: | SELECT amount FROM items AS lne
WHERE amount > (
SELECT AVG(amount) FROM sales AS sale
WHERE sale.level = lne.level
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_09270 | train | T2 |
v3 | Schema:
products (alias: prod)(type, code, level, value)
schedules(code, id, value, name)
Task: Find name from products where salary exceeds the average amount from schedules for the same status.
SQL: | SELECT name FROM products AS prod
WHERE salary > (
SELECT MIN(amount) FROM schedules AS schd
WHERE schd.status = prod.status
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_09271 | train | T1 |
v1 | Schema:
employees (alias: emp)(amount, level, date, type)
requests(date, salary, id, status)
Task: Find salary from employees where status appears in requests entries with matching code.
SQL: | SELECT salary FROM employees AS emp
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_09272 | train | T1 |
v1 | Schema:
orders (alias: ord)(value, name, amount, code)
requests(code, type, id, date)
Task: Find name from orders where type appears in requests entries with matching code.
SQL: | SELECT name FROM orders AS ord
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_09273 | train | T1 |
v2 | Schema:
services (alias: srvc)(type, salary, level, name)
products(type, value, date, salary)
Task: Retrieve code from services that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT code FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "products",
"outer_alias": "srvc",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_09274 | train | T2 |
v1 | Schema:
customers (alias: cust)(salary, level, name, date)
managers(salary, code, level, value)
Task: Retrieve amount from customers whose level is found in managers rows where status matches the outer record.
SQL: | SELECT amount FROM customers AS cust
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_09275 | train | T1 |
v1 | Schema:
categories (alias: catg)(type, status, id, date)
items(code, salary, id, name)
Task: Select salary from categories where code exists in items for the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_09276 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(code, name, type, status)
products(date, code, id, name)
Task: Find code from warehouses where type appears in products entries with matching status.
SQL: | SELECT code FROM warehouses AS whs
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "products",
"outer_alias": "whs",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_09277 | train | T2 |
v1 | Schema:
employees (alias: emp)(status, value, amount, name)
items(level, date, code, name)
Task: Retrieve salary from employees whose type is found in items rows where status matches the outer record.
SQL: | SELECT salary FROM employees AS emp
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_09278 | train | T1 |
v1 | Schema:
invoices (alias: inv)(value, name, status, type)
sales(salary, level, amount, status)
Task: Find salary from invoices where type appears in sales entries with matching type.
SQL: | SELECT salary FROM invoices AS inv
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_09279 | train | T1 |
v1 | Schema:
transactions (alias: txn)(value, status, amount, id)
managers(value, status, name, code)
Task: Select name from transactions where code exists in managers for the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_09280 | train | T1 |
v3 | Schema:
employees (alias: emp)(amount, level, id, salary)
departments(status, salary, amount, name)
Task: Retrieve amount from employees with value above the MAX(amount) of departments rows sharing the same level.
SQL: | SELECT amount FROM employees AS emp
WHERE value > (
SELECT MAX(amount) FROM departments AS dept
WHERE dept.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_09281 | train | T1 |
v1 | Schema:
budgets (alias: budg)(date, type, level, value)
products(code, amount, id, status)
Task: Find amount from budgets where type appears in products entries with matching code.
SQL: | SELECT amount FROM budgets AS budg
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "products",
"outer_alias": "budg",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_09282 | train | T2 |
v2 | Schema:
invoices (alias: inv)(value, id, date, type)
services(id, salary, level, status)
Task: Find amount from invoices where a matching record exists in services with the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "services",
"outer_alias": "inv",
"inner_alias": "srvc",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_09283 | train | T1 |
v2 | Schema:
categories (alias: catg)(type, name, value, amount)
requests(value, amount, type, code)
Task: Retrieve code from categories that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_09284 | train | T2 |
v1 | Schema:
products (alias: prod)(type, date, code, id)
managers(code, date, id, amount)
Task: Select value from products where id exists in managers for the same code.
SQL: | SELECT value FROM products AS prod
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.code = prod.code
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_09285 | train | T1 |
v2 | Schema:
items (alias: lne)(level, status, amount, id)
sales(status, type, name, value)
Task: Find code from items where a matching record exists in sales with the same type.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = lne.type
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_09286 | train | T2 |
v3 | Schema:
staff (alias: empl)(level, type, status, code)
regions(status, type, id, value)
Task: Find code from staff where value exceeds the average salary from regions for the same type.
SQL: | SELECT code FROM staff AS empl
WHERE value > (
SELECT MAX(salary) FROM regions AS rgn
WHERE rgn.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_09287 | train | T2 |
v3 | Schema:
managers (alias: mgr)(status, date, level, code)
shipments(name, amount, id, code)
Task: Find salary from managers where amount exceeds the average amount from shipments for the same type.
SQL: | SELECT salary FROM managers AS mgr
WHERE amount > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_09288 | train | T1 |
v2 | Schema:
orders (alias: ord)(name, value, date, amount)
schedules(name, code, salary, status)
Task: Retrieve salary from orders that have at least one corresponding entry in schedules sharing the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_09289 | train | T1 |
v2 | Schema:
sales (alias: sale)(type, salary, name, amount)
shipments(name, level, type, date)
Task: Find amount from sales where a matching record exists in shipments with the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_09290 | train | T1 |
v2 | Schema:
orders (alias: ord)(value, id, date, code)
budgets(type, id, code, value)
Task: Find code from orders where a matching record exists in budgets with the same code.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "budgets",
"outer_alias": "ord",
"inner_alias": "budg",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_09291 | train | T1 |
v2 | Schema:
regions (alias: rgn)(code, type, name, salary)
customers(status, salary, date, value)
Task: Retrieve code from regions that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_09292 | train | T2 |
v2 | Schema:
items (alias: lne)(value, name, code, type)
customers(type, value, status, name)
Task: Find amount from items where a matching record exists in customers with the same id.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = lne.id
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_09293 | train | T2 |
v3 | Schema:
services (alias: srvc)(date, code, amount, name)
schedules(salary, id, date, name)
Task: Retrieve code from services with amount above the COUNT(value) of schedules rows sharing the same status.
SQL: | SELECT code FROM services AS srvc
WHERE amount > (
SELECT COUNT(value) FROM schedules AS schd
WHERE schd.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "schedules",
"outer_alias": "srvc",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_09294 | train | T2 |
v1 | Schema:
departments (alias: dept)(salary, status, code, amount)
items(status, salary, name, amount)
Task: Select id from departments where level exists in items for the same type.
SQL: | SELECT id FROM departments AS dept
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_09295 | train | T1 |
v1 | Schema:
sales (alias: sale)(amount, salary, id, status)
invoices(value, amount, name, code)
Task: Select name from sales where status exists in invoices for the same level.
SQL: | SELECT name FROM sales AS sale
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_09296 | train | T1 |
v1 | Schema:
requests (alias: ordr)(salary, amount, status, date)
categories(name, value, level, amount)
Task: Select salary from requests where code exists in categories for the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE code IN (
SELECT code 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": "code",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_09297 | train | T2 |
v2 | Schema:
items (alias: lne)(id, name, level, date)
budgets(level, type, id, amount)
Task: Find salary from items where a matching record exists in budgets with the same status.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.status = lne.status
); | {
"outer_table": "items",
"inner_table": "budgets",
"outer_alias": "lne",
"inner_alias": "budg",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_09298 | train | T2 |
v3 | Schema:
customers (alias: cust)(code, name, value, id)
requests(id, date, salary, type)
Task: Retrieve id from customers with salary above the AVG(value) of requests rows sharing the same code.
SQL: | SELECT id FROM customers AS cust
WHERE salary > (
SELECT AVG(value) FROM requests AS ordr
WHERE ordr.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_09299 | train | T1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.