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:
staff (alias: empl)(salary, id, date, amount)
shipments(name, type, level, value)
Task: Retrieve code from staff with amount above the MIN(value) of shipments rows sharing the same status.
SQL: | SELECT code FROM staff AS empl
WHERE amount > (
SELECT MIN(value) FROM shipments AS shp
WHERE shp.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_08300 | train | T2 |
v2 | Schema:
services (alias: srvc)(code, id, date, name)
transactions(amount, code, type, name)
Task: Retrieve salary from services that have at least one corresponding entry in transactions sharing the same type.
SQL: | SELECT salary FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "transactions",
"outer_alias": "srvc",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_08301 | train | T2 |
v2 | Schema:
orders (alias: ord)(level, salary, amount, status)
shipments(amount, id, salary, date)
Task: Retrieve code from orders that have at least one corresponding entry in shipments sharing the same status.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_08302 | train | T1 |
v1 | Schema:
shipments (alias: shp)(level, name, code, status)
services(status, code, amount, date)
Task: Select name from shipments where level exists in services for the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE level IN (
SELECT level FROM services AS srvc
WHERE srvc.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "services",
"outer_alias": "shp",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_08303 | train | T2 |
v2 | Schema:
orders (alias: ord)(type, level, name, value)
regions(name, salary, value, date)
Task: Retrieve name from orders that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_08304 | train | T1 |
v2 | Schema:
sales (alias: sale)(date, status, name, code)
shipments(date, id, level, name)
Task: Retrieve id from sales that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT id 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": "id",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_08305 | train | T1 |
v2 | Schema:
categories (alias: catg)(status, name, date, value)
services(type, amount, code, status)
Task: Retrieve salary from categories that have at least one corresponding entry in services sharing the same type.
SQL: | SELECT salary 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": "salary",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_08306 | train | T2 |
v3 | Schema:
transactions (alias: txn)(id, value, level, status)
employees(amount, name, level, value)
Task: Retrieve amount from transactions with value above the SUM(amount) of employees rows sharing the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE value > (
SELECT SUM(amount) FROM employees AS emp
WHERE emp.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_08307 | train | T1 |
v1 | Schema:
departments (alias: dept)(type, code, amount, value)
requests(salary, type, level, code)
Task: Find value from departments where status appears in requests entries with matching id.
SQL: | SELECT value FROM departments AS dept
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_08308 | train | T1 |
v1 | Schema:
services (alias: srvc)(value, date, name, level)
products(code, id, name, date)
Task: Find name from services where code appears in products entries with matching status.
SQL: | SELECT name FROM services AS srvc
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "products",
"outer_alias": "srvc",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_08309 | train | T2 |
v2 | Schema:
employees (alias: emp)(level, id, status, salary)
requests(value, type, salary, status)
Task: Find name from employees where a matching record exists in requests with the same id.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_08310 | train | T1 |
v2 | Schema:
budgets (alias: budg)(amount, status, date, name)
accounts(code, level, name, salary)
Task: Retrieve salary from budgets that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT salary FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "accounts",
"outer_alias": "budg",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_08311 | train | T2 |
v3 | Schema:
employees (alias: emp)(status, name, code, amount)
requests(amount, level, status, type)
Task: Retrieve amount from employees with value above the SUM(value) of requests rows sharing the same level.
SQL: | SELECT amount FROM employees AS emp
WHERE value > (
SELECT SUM(value) FROM requests AS ordr
WHERE ordr.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_08312 | train | T1 |
v1 | Schema:
transactions (alias: txn)(amount, value, level, code)
requests(status, level, name, date)
Task: Retrieve id from transactions whose level is found in requests rows where type matches the outer record.
SQL: | SELECT id FROM transactions AS txn
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_08313 | train | T1 |
v1 | Schema:
regions (alias: rgn)(id, salary, type, code)
invoices(status, salary, date, type)
Task: Retrieve id from regions whose id is found in invoices rows where id matches the outer record.
SQL: | SELECT id FROM regions AS rgn
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_08314 | train | T2 |
v3 | Schema:
services (alias: srvc)(level, id, type, date)
invoices(code, value, status, amount)
Task: Find code from services where amount exceeds the average amount from invoices for the same status.
SQL: | SELECT code FROM services AS srvc
WHERE amount > (
SELECT MAX(amount) FROM invoices AS inv
WHERE inv.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "invoices",
"outer_alias": "srvc",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_08315 | train | T2 |
v1 | Schema:
customers (alias: cust)(level, date, code, amount)
budgets(type, level, name, date)
Task: Retrieve salary from customers whose level is found in budgets rows where level matches the outer record.
SQL: | SELECT salary FROM customers AS cust
WHERE level IN (
SELECT level FROM budgets AS budg
WHERE budg.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "budgets",
"outer_alias": "cust",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_08316 | train | T1 |
v1 | Schema:
items (alias: lne)(code, amount, type, date)
regions(code, type, value, name)
Task: Find salary from items where id appears in regions entries with matching status.
SQL: | SELECT salary FROM items AS lne
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_08317 | train | T2 |
v3 | Schema:
transactions (alias: txn)(type, date, code, amount)
schedules(type, name, value, id)
Task: Retrieve name from transactions with amount above the COUNT(salary) of schedules rows sharing the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE amount > (
SELECT COUNT(salary) FROM schedules AS schd
WHERE schd.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_08318 | train | T1 |
v3 | Schema:
schedules (alias: schd)(name, level, code, amount)
services(code, date, name, amount)
Task: Retrieve name from schedules with value above the MAX(value) of services rows sharing the same level.
SQL: | SELECT name FROM schedules AS schd
WHERE value > (
SELECT MAX(value) FROM services AS srvc
WHERE srvc.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "services",
"outer_alias": "schd",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_08319 | train | T2 |
v2 | Schema:
sales (alias: sale)(code, value, date, salary)
employees(value, type, amount, date)
Task: Find amount from sales where a matching record exists in employees with the same id.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_08320 | train | T1 |
v2 | Schema:
shipments (alias: shp)(value, id, type, name)
transactions(amount, value, salary, type)
Task: Find amount from shipments where a matching record exists in transactions with the same type.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_08321 | train | T2 |
v2 | Schema:
items (alias: lne)(id, code, name, salary)
departments(type, level, code, value)
Task: Retrieve id from items that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = lne.level
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_08322 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(value, status, id, amount)
budgets(date, value, type, salary)
Task: Find amount from warehouses where level appears in budgets entries with matching id.
SQL: | SELECT amount FROM warehouses AS whs
WHERE level IN (
SELECT level FROM budgets AS budg
WHERE budg.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "budgets",
"outer_alias": "whs",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_08323 | train | T2 |
v1 | Schema:
requests (alias: ordr)(code, status, amount, type)
schedules(level, type, date, salary)
Task: Find amount from requests where code appears in schedules entries with matching type.
SQL: | SELECT amount FROM requests AS ordr
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_08324 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(salary, status, id, date)
budgets(name, type, amount, status)
Task: Find code from warehouses where a matching record exists in budgets with the same id.
SQL: | SELECT code FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "budgets",
"outer_alias": "whs",
"inner_alias": "budg",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_08325 | train | T2 |
v2 | Schema:
categories (alias: catg)(id, code, status, level)
budgets(date, salary, id, type)
Task: Retrieve salary from categories that have at least one corresponding entry in budgets sharing the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "budgets",
"outer_alias": "catg",
"inner_alias": "budg",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_08326 | train | T2 |
v2 | Schema:
shipments (alias: shp)(level, type, code, date)
warehouses(id, salary, value, level)
Task: Retrieve id from shipments that have at least one corresponding entry in warehouses sharing the same type.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "warehouses",
"outer_alias": "shp",
"inner_alias": "whs",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_08327 | train | T2 |
v1 | Schema:
invoices (alias: inv)(value, type, name, date)
managers(status, date, type, level)
Task: Select salary from invoices where type exists in managers for the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_08328 | train | T1 |
v1 | Schema:
employees (alias: emp)(code, name, salary, status)
products(value, amount, date, status)
Task: Find salary from employees where code appears in products entries with matching status.
SQL: | SELECT salary FROM employees AS emp
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_08329 | train | T1 |
v3 | Schema:
transactions (alias: txn)(status, value, id, level)
schedules(date, status, amount, code)
Task: Retrieve name from transactions with value above the AVG(amount) of schedules rows sharing the same status.
SQL: | SELECT name FROM transactions AS txn
WHERE value > (
SELECT AVG(amount) FROM schedules AS schd
WHERE schd.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_08330 | train | T1 |
v1 | Schema:
departments (alias: dept)(type, level, salary, name)
budgets(level, id, salary, amount)
Task: Retrieve code from departments whose level is found in budgets rows where type matches the outer record.
SQL: | SELECT code FROM departments AS dept
WHERE level IN (
SELECT level FROM budgets AS budg
WHERE budg.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "budgets",
"outer_alias": "dept",
"inner_alias": "budg",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_08331 | train | T1 |
v2 | Schema:
sales (alias: sale)(type, amount, id, name)
transactions(type, value, date, id)
Task: Find value from sales where a matching record exists in transactions with the same type.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_08332 | train | T1 |
v3 | Schema:
invoices (alias: inv)(code, name, type, amount)
requests(date, name, type, id)
Task: Retrieve name from invoices with salary above the MAX(amount) of requests rows sharing the same level.
SQL: | SELECT name FROM invoices AS inv
WHERE salary > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_08333 | train | T1 |
v3 | Schema:
services (alias: srvc)(status, level, amount, date)
accounts(status, salary, id, date)
Task: Retrieve id from services with salary above the MAX(value) of accounts rows sharing the same level.
SQL: | SELECT id FROM services AS srvc
WHERE salary > (
SELECT MAX(value) FROM accounts AS acct
WHERE acct.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "accounts",
"outer_alias": "srvc",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_08334 | train | T2 |
v3 | Schema:
products (alias: prod)(date, name, value, amount)
budgets(salary, date, id, status)
Task: Retrieve amount from products with salary above the SUM(salary) of budgets rows sharing the same status.
SQL: | SELECT amount FROM products AS prod
WHERE salary > (
SELECT SUM(salary) FROM budgets AS budg
WHERE budg.status = prod.status
); | {
"outer_table": "products",
"inner_table": "budgets",
"outer_alias": "prod",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_08335 | train | T1 |
v2 | Schema:
services (alias: srvc)(type, code, id, salary)
transactions(code, name, amount, level)
Task: Retrieve salary from services that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT salary FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "transactions",
"outer_alias": "srvc",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_08336 | train | T2 |
v1 | Schema:
employees (alias: emp)(type, date, level, id)
customers(code, id, salary, date)
Task: Retrieve name from employees whose level is found in customers rows where id matches the outer record.
SQL: | SELECT name FROM employees AS emp
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_08337 | train | T1 |
v1 | Schema:
regions (alias: rgn)(value, level, name, type)
invoices(code, status, level, salary)
Task: Select value from regions where type exists in invoices for the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_08338 | train | T2 |
v1 | Schema:
sales (alias: sale)(name, type, id, amount)
shipments(amount, level, code, name)
Task: Select id from sales where id exists in shipments for the same status.
SQL: | SELECT id FROM sales AS sale
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_08339 | train | T1 |
v2 | Schema:
transactions (alias: txn)(code, type, id, status)
departments(salary, type, name, code)
Task: Retrieve id from transactions that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_08340 | train | T1 |
v2 | Schema:
orders (alias: ord)(date, code, id, value)
items(code, type, amount, name)
Task: Retrieve id from orders that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_08341 | train | T1 |
v3 | Schema:
accounts (alias: acct)(type, date, value, name)
categories(status, salary, id, value)
Task: Find id from accounts where salary exceeds the average amount from categories for the same level.
SQL: | SELECT id FROM accounts AS acct
WHERE salary > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_08342 | train | T1 |
v2 | Schema:
sales (alias: sale)(code, date, id, level)
customers(type, amount, level, name)
Task: Find name from sales where a matching record exists in customers with the same id.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_08343 | train | T1 |
v2 | Schema:
services (alias: srvc)(status, id, value, amount)
transactions(type, salary, amount, level)
Task: Find value from services where a matching record exists in transactions with the same code.
SQL: | SELECT value FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "transactions",
"outer_alias": "srvc",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_08344 | train | T2 |
v1 | Schema:
transactions (alias: txn)(amount, value, date, id)
shipments(name, status, id, salary)
Task: Select id from transactions where type exists in shipments for the same type.
SQL: | SELECT id FROM transactions AS txn
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_08345 | train | T1 |
v1 | Schema:
services (alias: srvc)(date, value, id, code)
accounts(type, date, amount, value)
Task: Select id from services where code exists in accounts for the same level.
SQL: | SELECT id FROM services AS srvc
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "accounts",
"outer_alias": "srvc",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_08346 | train | T2 |
v3 | Schema:
managers (alias: mgr)(code, amount, id, value)
accounts(status, value, name, code)
Task: Retrieve salary from managers with value above the MAX(value) of accounts rows sharing the same id.
SQL: | SELECT salary FROM managers AS mgr
WHERE value > (
SELECT MAX(value) FROM accounts AS acct
WHERE acct.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_08347 | train | T1 |
v3 | Schema:
categories (alias: catg)(code, level, id, amount)
customers(id, level, date, type)
Task: Find id from categories where amount exceeds the average amount from customers for the same id.
SQL: | SELECT id FROM categories AS catg
WHERE amount > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_08348 | train | T2 |
v3 | Schema:
transactions (alias: txn)(code, id, level, status)
products(value, date, code, id)
Task: Find name from transactions where salary exceeds the average salary from products for the same status.
SQL: | SELECT name FROM transactions AS txn
WHERE salary > (
SELECT MIN(salary) FROM products AS prod
WHERE prod.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_08349 | train | T1 |
v1 | Schema:
customers (alias: cust)(level, type, name, status)
sales(amount, name, code, id)
Task: Find value from customers where status appears in sales entries with matching status.
SQL: | SELECT value FROM customers AS cust
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_08350 | train | T1 |
v1 | Schema:
schedules (alias: schd)(id, name, type, level)
items(value, name, salary, code)
Task: Retrieve salary from schedules whose type is found in items rows where status matches the outer record.
SQL: | SELECT salary FROM schedules AS schd
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_08351 | train | T2 |
v3 | Schema:
orders (alias: ord)(amount, value, salary, level)
transactions(status, type, salary, level)
Task: Find code from orders where salary exceeds the average amount from transactions for the same level.
SQL: | SELECT code FROM orders AS ord
WHERE salary > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_08352 | train | T1 |
v2 | Schema:
categories (alias: catg)(amount, salary, value, level)
managers(value, name, type, amount)
Task: Find code from categories where a matching record exists in managers with the same id.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_08353 | train | T2 |
v3 | Schema:
shipments (alias: shp)(level, date, value, status)
departments(id, code, value, status)
Task: Retrieve code from shipments with value above the SUM(value) of departments rows sharing the same level.
SQL: | SELECT code FROM shipments AS shp
WHERE value > (
SELECT SUM(value) FROM departments AS dept
WHERE dept.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_08354 | train | T2 |
v1 | Schema:
employees (alias: emp)(date, status, level, amount)
regions(name, level, salary, type)
Task: Find code from employees where id appears in regions entries with matching level.
SQL: | SELECT code FROM employees AS emp
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_08355 | train | T1 |
v3 | Schema:
orders (alias: ord)(value, salary, name, date)
staff(code, amount, date, level)
Task: Retrieve name from orders with salary above the COUNT(amount) of staff rows sharing the same code.
SQL: | SELECT name FROM orders AS ord
WHERE salary > (
SELECT COUNT(amount) FROM staff AS empl
WHERE empl.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_08356 | train | T1 |
v1 | Schema:
services (alias: srvc)(salary, status, id, level)
items(date, amount, salary, code)
Task: Select amount from services where code exists in items for the same code.
SQL: | SELECT amount FROM services AS srvc
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "items",
"outer_alias": "srvc",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_08357 | train | T2 |
v1 | Schema:
accounts (alias: acct)(type, date, id, status)
staff(value, name, date, salary)
Task: Select salary from accounts where id exists in staff for the same type.
SQL: | SELECT salary FROM accounts AS acct
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_08358 | train | T1 |
v3 | Schema:
requests (alias: ordr)(code, value, type, amount)
products(amount, value, type, level)
Task: Find salary from requests where amount exceeds the average salary from products for the same code.
SQL: | SELECT salary FROM requests AS ordr
WHERE amount > (
SELECT SUM(salary) FROM products AS prod
WHERE prod.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_08359 | train | T2 |
v1 | Schema:
shipments (alias: shp)(value, date, code, amount)
customers(salary, status, id, value)
Task: Retrieve code from shipments whose id is found in customers rows where id matches the outer record.
SQL: | SELECT code FROM shipments AS shp
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_08360 | train | T2 |
v3 | Schema:
orders (alias: ord)(id, date, salary, amount)
managers(amount, level, salary, code)
Task: Find salary from orders where amount exceeds the average value from managers for the same id.
SQL: | SELECT salary FROM orders AS ord
WHERE amount > (
SELECT AVG(value) FROM managers AS mgr
WHERE mgr.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_08361 | train | T1 |
v3 | Schema:
services (alias: srvc)(salary, status, type, level)
accounts(id, level, amount, status)
Task: Find id from services where salary exceeds the average amount from accounts for the same id.
SQL: | SELECT id FROM services AS srvc
WHERE salary > (
SELECT SUM(amount) FROM accounts AS acct
WHERE acct.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "accounts",
"outer_alias": "srvc",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_08362 | train | T2 |
v3 | Schema:
sales (alias: sale)(level, status, value, code)
services(name, status, amount, salary)
Task: Retrieve code from sales with value above the MAX(salary) of services rows sharing the same status.
SQL: | SELECT code FROM sales AS sale
WHERE value > (
SELECT MAX(salary) FROM services AS srvc
WHERE srvc.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "services",
"outer_alias": "sale",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_08363 | train | T1 |
v2 | Schema:
budgets (alias: budg)(status, type, id, name)
categories(name, value, status, id)
Task: Find salary from budgets where a matching record exists in categories with the same level.
SQL: | SELECT salary FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "categories",
"outer_alias": "budg",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_08364 | train | T2 |
v3 | Schema:
schedules (alias: schd)(level, amount, value, code)
regions(amount, type, id, code)
Task: Find id from schedules where value exceeds the average amount from regions for the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE value > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_08365 | train | T2 |
v1 | Schema:
items (alias: lne)(amount, id, date, level)
warehouses(level, type, code, date)
Task: Find code from items where status appears in warehouses entries with matching level.
SQL: | SELECT code FROM items AS lne
WHERE status IN (
SELECT status FROM warehouses AS whs
WHERE whs.level = lne.level
); | {
"outer_table": "items",
"inner_table": "warehouses",
"outer_alias": "lne",
"inner_alias": "whs",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_08366 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(status, level, date, id)
regions(type, salary, status, value)
Task: Find code from warehouses where salary exceeds the average value from regions for the same status.
SQL: | SELECT code FROM warehouses AS whs
WHERE salary > (
SELECT SUM(value) FROM regions AS rgn
WHERE rgn.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "regions",
"outer_alias": "whs",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_08367 | train | T2 |
v2 | Schema:
services (alias: srvc)(salary, amount, name, code)
items(id, salary, name, date)
Task: Retrieve salary from services that have at least one corresponding entry in items sharing the same status.
SQL: | SELECT salary FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "items",
"outer_alias": "srvc",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_08368 | train | T2 |
v3 | Schema:
managers (alias: mgr)(code, date, name, id)
accounts(level, code, status, value)
Task: Find name from managers where value exceeds the average salary from accounts for the same level.
SQL: | SELECT name FROM managers AS mgr
WHERE value > (
SELECT MIN(salary) FROM accounts AS acct
WHERE acct.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_08369 | train | T1 |
v3 | Schema:
accounts (alias: acct)(amount, name, code, value)
employees(salary, level, code, name)
Task: Retrieve amount from accounts with salary above the COUNT(amount) of employees rows sharing the same level.
SQL: | SELECT amount FROM accounts AS acct
WHERE salary > (
SELECT COUNT(amount) FROM employees AS emp
WHERE emp.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_08370 | train | T1 |
v3 | Schema:
categories (alias: catg)(code, date, name, salary)
requests(name, type, date, value)
Task: Retrieve value from categories with salary above the AVG(value) of requests rows sharing the same code.
SQL: | SELECT value FROM categories AS catg
WHERE salary > (
SELECT AVG(value) FROM requests AS ordr
WHERE ordr.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_08371 | train | T2 |
v3 | Schema:
services (alias: srvc)(value, code, salary, name)
managers(date, type, status, value)
Task: Retrieve code from services with amount above the COUNT(salary) of managers rows sharing the same type.
SQL: | SELECT code FROM services AS srvc
WHERE amount > (
SELECT COUNT(salary) FROM managers AS mgr
WHERE mgr.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "managers",
"outer_alias": "srvc",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_08372 | train | T2 |
v3 | Schema:
transactions (alias: txn)(code, salary, value, id)
staff(value, code, name, amount)
Task: Retrieve value from transactions with value above the MIN(value) of staff rows sharing the same status.
SQL: | SELECT value FROM transactions AS txn
WHERE value > (
SELECT MIN(value) FROM staff AS empl
WHERE empl.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_08373 | train | T1 |
v3 | Schema:
schedules (alias: schd)(date, value, code, type)
shipments(name, status, value, salary)
Task: Find code from schedules where value exceeds the average salary from shipments for the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE value > (
SELECT COUNT(salary) FROM shipments AS shp
WHERE shp.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_08374 | train | T2 |
v1 | Schema:
shipments (alias: shp)(code, level, name, date)
staff(code, salary, id, name)
Task: Select code from shipments where type exists in staff for the same id.
SQL: | SELECT code FROM shipments AS shp
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_08375 | train | T2 |
v2 | Schema:
services (alias: srvc)(level, status, value, name)
regions(amount, salary, type, value)
Task: Retrieve code from services that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT code FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "regions",
"outer_alias": "srvc",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_08376 | train | T2 |
v3 | Schema:
sales (alias: sale)(status, salary, id, name)
products(status, amount, date, name)
Task: Find id from sales where amount exceeds the average value from products for the same id.
SQL: | SELECT id FROM sales AS sale
WHERE amount > (
SELECT SUM(value) FROM products AS prod
WHERE prod.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_08377 | train | T1 |
v1 | Schema:
managers (alias: mgr)(id, name, code, amount)
warehouses(status, name, level, type)
Task: Select name from managers where code exists in warehouses for the same level.
SQL: | SELECT name FROM managers AS mgr
WHERE code IN (
SELECT code FROM warehouses AS whs
WHERE whs.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "warehouses",
"outer_alias": "mgr",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_08378 | train | T1 |
v3 | Schema:
managers (alias: mgr)(value, amount, code, id)
orders(name, id, type, value)
Task: Find code from managers where amount exceeds the average amount from orders for the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE amount > (
SELECT MIN(amount) FROM orders AS ord
WHERE ord.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_08379 | train | T1 |
v1 | Schema:
orders (alias: ord)(code, salary, status, value)
departments(type, id, date, name)
Task: Find name from orders where type appears in departments entries with matching level.
SQL: | SELECT name FROM orders AS ord
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_08380 | train | T1 |
v3 | Schema:
schedules (alias: schd)(value, name, id, salary)
employees(id, date, type, value)
Task: Retrieve id from schedules with amount above the SUM(value) of employees rows sharing the same type.
SQL: | SELECT id FROM schedules AS schd
WHERE amount > (
SELECT SUM(value) FROM employees AS emp
WHERE emp.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_08381 | train | T2 |
v2 | Schema:
invoices (alias: inv)(id, code, amount, level)
items(id, type, date, status)
Task: Find name from invoices where a matching record exists in items with the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_08382 | train | T1 |
v1 | Schema:
categories (alias: catg)(type, id, value, amount)
services(value, status, salary, amount)
Task: Retrieve code from categories whose id is found in services rows where type matches the outer record.
SQL: | SELECT code FROM categories AS catg
WHERE id IN (
SELECT id FROM services AS srvc
WHERE srvc.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "services",
"outer_alias": "catg",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_08383 | train | T2 |
v3 | Schema:
orders (alias: ord)(name, type, salary, level)
accounts(id, code, date, type)
Task: Retrieve salary from orders with value above the SUM(salary) of accounts rows sharing the same level.
SQL: | SELECT salary FROM orders AS ord
WHERE value > (
SELECT SUM(salary) FROM accounts AS acct
WHERE acct.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_08384 | train | T1 |
v3 | Schema:
services (alias: srvc)(salary, name, code, amount)
requests(date, salary, name, code)
Task: Find name from services where value exceeds the average amount from requests for the same status.
SQL: | SELECT name FROM services AS srvc
WHERE value > (
SELECT SUM(amount) FROM requests AS ordr
WHERE ordr.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "requests",
"outer_alias": "srvc",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_08385 | train | T2 |
v2 | Schema:
managers (alias: mgr)(status, name, type, code)
customers(id, level, salary, value)
Task: Find id from managers where a matching record exists in customers with the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_08386 | train | T1 |
v2 | Schema:
products (alias: prod)(id, status, date, level)
regions(amount, salary, id, type)
Task: Find name from products where a matching record exists in regions with the same code.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = prod.code
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_08387 | train | T1 |
v1 | Schema:
requests (alias: ordr)(code, type, salary, value)
budgets(date, salary, status, amount)
Task: Find value from requests where type appears in budgets entries with matching code.
SQL: | SELECT value FROM requests AS ordr
WHERE type IN (
SELECT type FROM budgets AS budg
WHERE budg.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "budgets",
"outer_alias": "ordr",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_08388 | train | T2 |
v2 | Schema:
staff (alias: empl)(amount, type, code, value)
schedules(name, id, code, date)
Task: Find id from staff where a matching record exists in schedules with the same type.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_08389 | train | T2 |
v1 | Schema:
items (alias: lne)(status, level, type, amount)
staff(type, level, name, status)
Task: Select amount from items where type exists in staff for the same status.
SQL: | SELECT amount FROM items AS lne
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.status = lne.status
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_08390 | train | T2 |
v2 | Schema:
employees (alias: emp)(id, value, level, amount)
categories(value, id, amount, date)
Task: Find salary from employees where a matching record exists in categories with the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_08391 | train | T1 |
v3 | Schema:
products (alias: prod)(level, name, salary, status)
shipments(code, status, type, salary)
Task: Retrieve name from products with amount above the MIN(amount) of shipments rows sharing the same type.
SQL: | SELECT name FROM products AS prod
WHERE amount > (
SELECT MIN(amount) FROM shipments AS shp
WHERE shp.type = prod.type
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_08392 | train | T1 |
v3 | Schema:
services (alias: srvc)(salary, code, type, date)
shipments(date, status, code, amount)
Task: Retrieve code from services with amount above the MIN(amount) of shipments rows sharing the same level.
SQL: | SELECT code FROM services AS srvc
WHERE amount > (
SELECT MIN(amount) FROM shipments AS shp
WHERE shp.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "shipments",
"outer_alias": "srvc",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_08393 | train | T2 |
v1 | Schema:
budgets (alias: budg)(amount, name, salary, value)
items(amount, id, status, level)
Task: Retrieve salary from budgets whose type is found in items rows where status matches the outer record.
SQL: | SELECT salary FROM budgets AS budg
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "items",
"outer_alias": "budg",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_08394 | train | T2 |
v2 | Schema:
transactions (alias: txn)(salary, name, level, value)
employees(date, name, level, status)
Task: Retrieve name from transactions that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_08395 | train | T1 |
v1 | Schema:
invoices (alias: inv)(salary, name, type, code)
items(amount, value, id, level)
Task: Retrieve id from invoices whose id is found in items rows where code matches the outer record.
SQL: | SELECT id FROM invoices AS inv
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_08396 | train | T1 |
v2 | Schema:
items (alias: lne)(id, level, value, type)
categories(type, status, name, amount)
Task: Find code from items where a matching record exists in categories with the same level.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = lne.level
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_08397 | train | T2 |
v3 | Schema:
orders (alias: ord)(salary, amount, level, status)
categories(code, type, amount, value)
Task: Find code from orders where salary exceeds the average salary from categories for the same code.
SQL: | SELECT code FROM orders AS ord
WHERE salary > (
SELECT MIN(salary) FROM categories AS catg
WHERE catg.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_08398 | train | T1 |
v2 | Schema:
accounts (alias: acct)(salary, amount, level, id)
categories(amount, level, status, value)
Task: Retrieve salary from accounts that have at least one corresponding entry in categories sharing the same level.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_08399 | train | T1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.