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:
regions (alias: rgn)(value, status, date, id)
budgets(value, amount, id, salary)
Task: Find id from regions where amount exceeds the average amount from budgets for the same type.
SQL: | SELECT id FROM regions AS rgn
WHERE amount > (
SELECT MIN(amount) FROM budgets AS budg
WHERE budg.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "budgets",
"outer_alias": "rgn",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_08700 | train | T2 |
v3 | Schema:
orders (alias: ord)(code, id, amount, salary)
departments(salary, amount, type, code)
Task: Retrieve code from orders with amount above the AVG(salary) of departments rows sharing the same type.
SQL: | SELECT code FROM orders AS ord
WHERE amount > (
SELECT AVG(salary) FROM departments AS dept
WHERE dept.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_08701 | train | T1 |
v3 | Schema:
sales (alias: sale)(code, level, status, id)
budgets(level, salary, type, date)
Task: Retrieve code from sales with salary above the COUNT(amount) of budgets rows sharing the same id.
SQL: | SELECT code FROM sales AS sale
WHERE salary > (
SELECT COUNT(amount) FROM budgets AS budg
WHERE budg.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "budgets",
"outer_alias": "sale",
"inner_alias": "budg",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_08702 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(id, date, code, level)
invoices(code, value, level, name)
Task: Retrieve amount from warehouses that have at least one corresponding entry in invoices sharing the same level.
SQL: | SELECT amount FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "invoices",
"outer_alias": "whs",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_08703 | train | T2 |
v2 | Schema:
shipments (alias: shp)(date, amount, value, salary)
products(status, level, name, salary)
Task: Find code from shipments where a matching record exists in products with the same type.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_08704 | train | T2 |
v2 | Schema:
managers (alias: mgr)(code, value, salary, type)
categories(level, status, value, id)
Task: Find amount from managers where a matching record exists in categories with the same id.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_08705 | train | T1 |
v2 | Schema:
accounts (alias: acct)(name, amount, salary, type)
categories(status, salary, name, amount)
Task: Retrieve salary from accounts that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_08706 | train | T1 |
v2 | Schema:
schedules (alias: schd)(level, amount, date, name)
managers(level, salary, status, type)
Task: Find value from schedules where a matching record exists in managers with the same status.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_08707 | train | T2 |
v1 | Schema:
employees (alias: emp)(status, name, code, level)
transactions(salary, id, level, value)
Task: Find salary from employees where status appears in transactions entries with matching level.
SQL: | SELECT salary FROM employees AS emp
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_08708 | train | T1 |
v2 | Schema:
staff (alias: empl)(amount, level, id, name)
departments(level, salary, status, code)
Task: Retrieve code from staff that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_08709 | train | T2 |
v2 | Schema:
services (alias: srvc)(code, name, date, type)
sales(value, amount, date, code)
Task: Retrieve amount from services that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT amount FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "sales",
"outer_alias": "srvc",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_08710 | train | T2 |
v2 | Schema:
items (alias: lne)(type, salary, status, date)
orders(code, date, salary, status)
Task: Retrieve code from items that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = lne.level
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_08711 | train | T2 |
v2 | Schema:
customers (alias: cust)(salary, name, code, level)
requests(id, date, status, code)
Task: Find salary from customers where a matching record exists in requests with the same status.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_08712 | train | T1 |
v1 | Schema:
managers (alias: mgr)(value, id, amount, name)
customers(date, name, code, level)
Task: Select id from managers where level exists in customers for the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_08713 | train | T1 |
v2 | Schema:
shipments (alias: shp)(code, type, date, amount)
regions(id, code, value, status)
Task: Retrieve salary from shipments that have at least one corresponding entry in regions sharing the same level.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_08714 | train | T2 |
v1 | Schema:
categories (alias: catg)(code, status, amount, value)
customers(amount, type, date, status)
Task: Retrieve id from categories whose type is found in customers rows where id matches the outer record.
SQL: | SELECT id FROM categories AS catg
WHERE type IN (
SELECT type 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": "type",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_08715 | train | T2 |
v2 | Schema:
requests (alias: ordr)(level, type, date, id)
invoices(code, date, amount, id)
Task: Retrieve id from requests that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_08716 | train | T2 |
v2 | Schema:
invoices (alias: inv)(status, level, value, type)
items(code, id, amount, type)
Task: Retrieve id from invoices that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT id 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": "id",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_08717 | train | T1 |
v1 | Schema:
accounts (alias: acct)(date, id, code, status)
budgets(level, date, status, id)
Task: Select id from accounts where code exists in budgets for the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE code IN (
SELECT code FROM budgets AS budg
WHERE budg.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "budgets",
"outer_alias": "acct",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_08718 | train | T1 |
v3 | Schema:
shipments (alias: shp)(date, salary, name, code)
departments(type, amount, level, name)
Task: Find amount from shipments where value exceeds the average salary from departments for the same level.
SQL: | SELECT amount FROM shipments AS shp
WHERE value > (
SELECT COUNT(salary) FROM departments AS dept
WHERE dept.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_08719 | train | T2 |
v1 | Schema:
schedules (alias: schd)(amount, salary, id, value)
accounts(status, name, code, amount)
Task: Retrieve name from schedules whose status is found in accounts rows where code matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_08720 | train | T2 |
v3 | Schema:
services (alias: srvc)(code, type, value, level)
departments(value, salary, amount, date)
Task: Retrieve salary from services with salary above the MAX(amount) of departments rows sharing the same id.
SQL: | SELECT salary FROM services AS srvc
WHERE salary > (
SELECT MAX(amount) FROM departments AS dept
WHERE dept.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "departments",
"outer_alias": "srvc",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_08721 | train | T2 |
v2 | Schema:
categories (alias: catg)(salary, amount, date, value)
budgets(name, type, date, id)
Task: Find salary from categories where a matching record exists in budgets with the same id.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "budgets",
"outer_alias": "catg",
"inner_alias": "budg",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_08722 | train | T2 |
v2 | Schema:
products (alias: prod)(level, code, name, id)
managers(level, value, amount, date)
Task: Retrieve code from products that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = prod.code
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_08723 | train | T1 |
v1 | Schema:
accounts (alias: acct)(name, type, code, level)
shipments(code, name, level, value)
Task: Retrieve id from accounts whose level is found in shipments rows where id matches the outer record.
SQL: | SELECT id FROM accounts AS acct
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_08724 | train | T1 |
v3 | Schema:
employees (alias: emp)(name, level, date, id)
items(salary, id, date, status)
Task: Retrieve code from employees with salary above the MIN(value) of items rows sharing the same level.
SQL: | SELECT code FROM employees AS emp
WHERE salary > (
SELECT MIN(value) FROM items AS lne
WHERE lne.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_08725 | train | T1 |
v3 | Schema:
categories (alias: catg)(name, type, code, status)
services(amount, level, name, date)
Task: Find name from categories where salary exceeds the average value from services for the same code.
SQL: | SELECT name FROM categories AS catg
WHERE salary > (
SELECT AVG(value) FROM services AS srvc
WHERE srvc.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "services",
"outer_alias": "catg",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_08726 | train | T2 |
v2 | Schema:
services (alias: srvc)(amount, salary, name, status)
departments(id, status, amount, salary)
Task: Find value from services where a matching record exists in departments with the same code.
SQL: | SELECT value FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "departments",
"outer_alias": "srvc",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_08727 | train | T2 |
v1 | Schema:
transactions (alias: txn)(name, code, date, value)
managers(type, value, amount, code)
Task: Find value from transactions where code appears in managers entries with matching id.
SQL: | SELECT value FROM transactions AS txn
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_08728 | train | T1 |
v2 | Schema:
departments (alias: dept)(date, type, id, amount)
sales(name, status, amount, date)
Task: Retrieve amount from departments that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_08729 | train | T1 |
v1 | Schema:
budgets (alias: budg)(id, value, name, code)
sales(type, status, id, level)
Task: Select amount from budgets where id exists in sales for the same status.
SQL: | SELECT amount FROM budgets AS budg
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "sales",
"outer_alias": "budg",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_08730 | train | T2 |
v2 | Schema:
services (alias: srvc)(amount, name, status, level)
staff(status, type, id, value)
Task: Retrieve salary from services that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT salary FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "staff",
"outer_alias": "srvc",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_08731 | train | T2 |
v2 | Schema:
requests (alias: ordr)(name, id, status, type)
services(date, name, status, value)
Task: Find id from requests where a matching record exists in services with the same code.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "services",
"outer_alias": "ordr",
"inner_alias": "srvc",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_08732 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(status, salary, code, name)
accounts(amount, salary, type, name)
Task: Retrieve salary from warehouses with value above the COUNT(value) of accounts rows sharing the same code.
SQL: | SELECT salary FROM warehouses AS whs
WHERE value > (
SELECT COUNT(value) FROM accounts AS acct
WHERE acct.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "accounts",
"outer_alias": "whs",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_08733 | train | T2 |
v3 | Schema:
categories (alias: catg)(id, salary, name, amount)
requests(salary, amount, id, name)
Task: Find id from categories where value exceeds the average value from requests for the same level.
SQL: | SELECT id FROM categories AS catg
WHERE value > (
SELECT MAX(value) FROM requests AS ordr
WHERE ordr.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_08734 | train | T2 |
v3 | Schema:
schedules (alias: schd)(type, name, id, salary)
transactions(value, name, status, amount)
Task: Find salary from schedules where amount exceeds the average salary from transactions for the same code.
SQL: | SELECT salary FROM schedules AS schd
WHERE amount > (
SELECT COUNT(salary) FROM transactions AS txn
WHERE txn.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_08735 | train | T2 |
v2 | Schema:
managers (alias: mgr)(id, amount, value, type)
accounts(value, date, status, type)
Task: Find value from managers where a matching record exists in accounts with the same level.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_08736 | train | T1 |
v2 | Schema:
requests (alias: ordr)(name, date, status, id)
shipments(value, status, date, code)
Task: Find salary from requests where a matching record exists in shipments with the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_08737 | train | T2 |
v1 | Schema:
schedules (alias: schd)(salary, value, date, status)
departments(status, type, salary, code)
Task: Select value from schedules where type exists in departments for the same code.
SQL: | SELECT value FROM schedules AS schd
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_08738 | train | T2 |
v2 | Schema:
transactions (alias: txn)(date, level, status, value)
products(value, date, amount, status)
Task: Find salary from transactions where a matching record exists in products with the same level.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_08739 | train | T1 |
v3 | Schema:
requests (alias: ordr)(code, status, date, level)
staff(value, date, salary, type)
Task: Retrieve name from requests with value above the COUNT(salary) of staff rows sharing the same type.
SQL: | SELECT name FROM requests AS ordr
WHERE value > (
SELECT COUNT(salary) FROM staff AS empl
WHERE empl.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_08740 | train | T2 |
v1 | Schema:
regions (alias: rgn)(id, value, type, status)
warehouses(status, value, level, id)
Task: Find value from regions where code appears in warehouses entries with matching status.
SQL: | SELECT value FROM regions AS rgn
WHERE code IN (
SELECT code FROM warehouses AS whs
WHERE whs.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "warehouses",
"outer_alias": "rgn",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_08741 | train | T2 |
v1 | Schema:
services (alias: srvc)(name, date, status, id)
employees(date, code, name, id)
Task: Find value from services where status appears in employees entries with matching status.
SQL: | SELECT value FROM services AS srvc
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "employees",
"outer_alias": "srvc",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_08742 | train | T2 |
v1 | Schema:
orders (alias: ord)(type, date, status, code)
accounts(value, amount, name, id)
Task: Retrieve id from orders whose id is found in accounts rows where type matches the outer record.
SQL: | SELECT id FROM orders AS ord
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_08743 | train | T1 |
v3 | Schema:
products (alias: prod)(code, type, amount, date)
items(level, date, status, name)
Task: Retrieve value from products with amount above the MAX(salary) of items rows sharing the same id.
SQL: | SELECT value FROM products AS prod
WHERE amount > (
SELECT MAX(salary) FROM items AS lne
WHERE lne.id = prod.id
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_08744 | train | T1 |
v1 | Schema:
services (alias: srvc)(name, status, type, code)
schedules(date, type, id, salary)
Task: Find name from services where level appears in schedules entries with matching code.
SQL: | SELECT name FROM services AS srvc
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "schedules",
"outer_alias": "srvc",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_08745 | train | T2 |
v1 | Schema:
regions (alias: rgn)(status, name, value, code)
managers(code, type, status, name)
Task: Find amount from regions where code appears in managers entries with matching status.
SQL: | SELECT amount FROM regions AS rgn
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_08746 | train | T2 |
v2 | Schema:
orders (alias: ord)(date, code, name, amount)
invoices(id, name, level, date)
Task: Find value from orders where a matching record exists in invoices with the same status.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_08747 | train | T1 |
v1 | Schema:
employees (alias: emp)(type, id, name, code)
warehouses(type, date, name, amount)
Task: Find id from employees where type appears in warehouses entries with matching status.
SQL: | SELECT id FROM employees AS emp
WHERE type IN (
SELECT type FROM warehouses AS whs
WHERE whs.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "warehouses",
"outer_alias": "emp",
"inner_alias": "whs",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_08748 | train | T1 |
v2 | Schema:
budgets (alias: budg)(amount, salary, type, value)
employees(amount, value, name, level)
Task: Find name from budgets where a matching record exists in employees with the same code.
SQL: | SELECT name FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "employees",
"outer_alias": "budg",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_08749 | train | T2 |
v3 | Schema:
invoices (alias: inv)(id, type, value, amount)
regions(level, salary, id, type)
Task: Retrieve name from invoices with value above the COUNT(value) of regions rows sharing the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE value > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_08750 | train | T1 |
v3 | Schema:
services (alias: srvc)(name, code, amount, type)
employees(status, type, id, name)
Task: Find value from services where value exceeds the average value from employees for the same status.
SQL: | SELECT value FROM services AS srvc
WHERE value > (
SELECT COUNT(value) FROM employees AS emp
WHERE emp.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "employees",
"outer_alias": "srvc",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_08751 | train | T2 |
v2 | Schema:
managers (alias: mgr)(salary, level, code, type)
budgets(amount, id, status, name)
Task: Find name from managers where a matching record exists in budgets with the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "budgets",
"outer_alias": "mgr",
"inner_alias": "budg",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_08752 | train | T1 |
v2 | Schema:
shipments (alias: shp)(level, type, date, salary)
items(name, id, code, salary)
Task: Find value from shipments where a matching record exists in items with the same code.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_08753 | train | T2 |
v3 | Schema:
managers (alias: mgr)(status, amount, type, salary)
staff(level, status, value, id)
Task: Retrieve value from managers with value above the AVG(value) of staff rows sharing the same id.
SQL: | SELECT value FROM managers AS mgr
WHERE value > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_08754 | train | T1 |
v1 | Schema:
categories (alias: catg)(name, id, salary, code)
schedules(amount, salary, value, date)
Task: Find value from categories where level appears in schedules entries with matching status.
SQL: | SELECT value FROM categories AS catg
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_08755 | train | T2 |
v2 | Schema:
budgets (alias: budg)(value, type, level, status)
sales(value, name, status, type)
Task: Find id from budgets where a matching record exists in sales with the same level.
SQL: | SELECT id FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "sales",
"outer_alias": "budg",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_08756 | train | T2 |
v2 | Schema:
accounts (alias: acct)(id, amount, status, value)
orders(status, value, id, amount)
Task: Find name from accounts where a matching record exists in orders with the same code.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_08757 | train | T1 |
v3 | Schema:
transactions (alias: txn)(date, name, salary, level)
orders(amount, id, salary, status)
Task: Find amount from transactions where value exceeds the average amount from orders for the same type.
SQL: | SELECT amount FROM transactions AS txn
WHERE value > (
SELECT AVG(amount) FROM orders AS ord
WHERE ord.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_08758 | train | T1 |
v3 | Schema:
transactions (alias: txn)(value, amount, level, code)
invoices(id, salary, type, status)
Task: Retrieve value from transactions with value above the MIN(salary) of invoices rows sharing the same level.
SQL: | SELECT value FROM transactions AS txn
WHERE value > (
SELECT MIN(salary) FROM invoices AS inv
WHERE inv.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_08759 | train | T1 |
v2 | Schema:
transactions (alias: txn)(amount, status, level, date)
accounts(name, type, status, amount)
Task: Find id from transactions where a matching record exists in accounts with the same id.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_08760 | train | T1 |
v2 | Schema:
shipments (alias: shp)(type, salary, date, value)
transactions(code, level, amount, name)
Task: Find name from shipments where a matching record exists in transactions with the same code.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_08761 | train | T2 |
v1 | Schema:
customers (alias: cust)(type, name, date, id)
departments(type, salary, id, value)
Task: Find id from customers where code appears in departments entries with matching id.
SQL: | SELECT id FROM customers AS cust
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_08762 | train | T1 |
v2 | Schema:
services (alias: srvc)(date, salary, amount, level)
managers(type, name, salary, code)
Task: Find id from services where a matching record exists in managers with the same type.
SQL: | SELECT id FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "managers",
"outer_alias": "srvc",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_08763 | train | T2 |
v1 | Schema:
items (alias: lne)(date, salary, amount, type)
departments(status, name, id, amount)
Task: Select name from items where level exists in departments for the same code.
SQL: | SELECT name FROM items AS lne
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.code = lne.code
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_08764 | train | T2 |
v3 | Schema:
budgets (alias: budg)(salary, code, name, level)
requests(name, code, value, type)
Task: Retrieve code from budgets with salary above the SUM(salary) of requests rows sharing the same status.
SQL: | SELECT code FROM budgets AS budg
WHERE salary > (
SELECT SUM(salary) FROM requests AS ordr
WHERE ordr.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "requests",
"outer_alias": "budg",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_08765 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(salary, id, name, value)
budgets(name, code, status, id)
Task: Retrieve salary from warehouses that have at least one corresponding entry in budgets sharing the same id.
SQL: | SELECT salary 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": "salary",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_08766 | train | T2 |
v1 | Schema:
managers (alias: mgr)(code, date, type, status)
staff(code, value, type, date)
Task: Retrieve value from managers whose status is found in staff rows where code matches the outer record.
SQL: | SELECT value FROM managers AS mgr
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_08767 | train | T1 |
v2 | Schema:
sales (alias: sale)(type, status, id, level)
items(value, amount, id, type)
Task: Find salary from sales where a matching record exists in items with the same id.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_08768 | train | T1 |
v3 | Schema:
budgets (alias: budg)(id, salary, code, amount)
services(salary, id, status, date)
Task: Find code from budgets where amount exceeds the average value from services for the same level.
SQL: | SELECT code FROM budgets AS budg
WHERE amount > (
SELECT AVG(value) FROM services AS srvc
WHERE srvc.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "services",
"outer_alias": "budg",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_08769 | train | T2 |
v2 | Schema:
services (alias: srvc)(id, amount, date, code)
requests(level, type, status, salary)
Task: Retrieve salary from services that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT salary FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "requests",
"outer_alias": "srvc",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_08770 | train | T2 |
v1 | Schema:
regions (alias: rgn)(amount, name, id, salary)
services(amount, name, value, status)
Task: Find amount from regions where code appears in services entries with matching code.
SQL: | SELECT amount FROM regions AS rgn
WHERE code IN (
SELECT code FROM services AS srvc
WHERE srvc.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "services",
"outer_alias": "rgn",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_08771 | train | T2 |
v1 | Schema:
staff (alias: empl)(level, date, amount, code)
shipments(id, code, status, salary)
Task: Find value from staff where level appears in shipments entries with matching level.
SQL: | SELECT value FROM staff AS empl
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_08772 | train | T2 |
v3 | Schema:
budgets (alias: budg)(salary, amount, name, level)
managers(code, level, date, salary)
Task: Find id from budgets where value exceeds the average value from managers for the same id.
SQL: | SELECT id FROM budgets AS budg
WHERE value > (
SELECT MAX(value) FROM managers AS mgr
WHERE mgr.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "managers",
"outer_alias": "budg",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_08773 | train | T2 |
v3 | Schema:
staff (alias: empl)(status, salary, level, type)
items(name, id, value, amount)
Task: Retrieve code from staff with amount above the MAX(amount) of items rows sharing the same id.
SQL: | SELECT code FROM staff AS empl
WHERE amount > (
SELECT MAX(amount) FROM items AS lne
WHERE lne.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_08774 | train | T2 |
v1 | Schema:
transactions (alias: txn)(level, id, code, amount)
accounts(status, amount, level, date)
Task: Select salary from transactions where status exists in accounts for the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_08775 | train | T1 |
v1 | Schema:
items (alias: lne)(level, amount, type, value)
orders(id, salary, value, amount)
Task: Select code from items where level exists in orders for the same level.
SQL: | SELECT code FROM items AS lne
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.level = lne.level
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_08776 | train | T2 |
v3 | Schema:
products (alias: prod)(date, status, type, name)
invoices(code, value, status, id)
Task: Retrieve amount from products with amount above the AVG(amount) of invoices rows sharing the same id.
SQL: | SELECT amount FROM products AS prod
WHERE amount > (
SELECT AVG(amount) FROM invoices AS inv
WHERE inv.id = prod.id
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_08777 | train | T1 |
v1 | Schema:
employees (alias: emp)(status, date, id, type)
transactions(amount, name, code, value)
Task: Select name from employees where status exists in transactions for the same code.
SQL: | SELECT name FROM employees AS emp
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_08778 | train | T1 |
v2 | Schema:
transactions (alias: txn)(amount, code, date, value)
sales(status, name, amount, type)
Task: Find amount from transactions where a matching record exists in sales with the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_08779 | train | T1 |
v3 | Schema:
budgets (alias: budg)(salary, id, amount, status)
sales(date, status, code, type)
Task: Retrieve salary from budgets with amount above the COUNT(value) of sales rows sharing the same status.
SQL: | SELECT salary FROM budgets AS budg
WHERE amount > (
SELECT COUNT(value) FROM sales AS sale
WHERE sale.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "sales",
"outer_alias": "budg",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_08780 | train | T2 |
v3 | Schema:
categories (alias: catg)(status, salary, type, name)
regions(id, code, salary, type)
Task: Find value from categories where amount exceeds the average salary from regions for the same id.
SQL: | SELECT value FROM categories AS catg
WHERE amount > (
SELECT COUNT(salary) FROM regions AS rgn
WHERE rgn.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_08781 | train | T2 |
v3 | Schema:
requests (alias: ordr)(type, level, date, id)
orders(type, code, date, amount)
Task: Retrieve name from requests with amount above the MAX(amount) of orders rows sharing the same status.
SQL: | SELECT name FROM requests AS ordr
WHERE amount > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_08782 | train | T2 |
v2 | Schema:
accounts (alias: acct)(level, name, id, salary)
departments(name, value, date, type)
Task: Find value from accounts where a matching record exists in departments with the same status.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_08783 | train | T1 |
v3 | Schema:
shipments (alias: shp)(amount, type, date, name)
accounts(status, type, code, id)
Task: Retrieve amount from shipments with value above the AVG(value) of accounts rows sharing the same code.
SQL: | SELECT amount FROM shipments AS shp
WHERE value > (
SELECT AVG(value) FROM accounts AS acct
WHERE acct.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_08784 | train | T2 |
v2 | Schema:
invoices (alias: inv)(code, date, name, type)
employees(type, status, date, salary)
Task: Find value from invoices where a matching record exists in employees with the same status.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_08785 | train | T1 |
v2 | Schema:
orders (alias: ord)(code, type, value, id)
staff(type, status, code, date)
Task: Find salary from orders where a matching record exists in staff with the same id.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_08786 | train | T1 |
v1 | Schema:
shipments (alias: shp)(amount, date, id, name)
items(name, code, date, salary)
Task: Select value from shipments where id exists in items for the same status.
SQL: | SELECT value FROM shipments AS shp
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_08787 | train | T2 |
v1 | Schema:
transactions (alias: txn)(level, type, amount, status)
items(status, level, amount, date)
Task: Select name from transactions where id exists in items for the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_08788 | train | T1 |
v1 | Schema:
services (alias: srvc)(amount, status, date, code)
invoices(amount, type, status, id)
Task: Find value from services where level appears in invoices entries with matching id.
SQL: | SELECT value FROM services AS srvc
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "invoices",
"outer_alias": "srvc",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_08789 | train | T2 |
v3 | Schema:
sales (alias: sale)(code, level, value, status)
categories(level, status, name, code)
Task: Retrieve amount from sales with salary above the AVG(value) of categories rows sharing the same level.
SQL: | SELECT amount FROM sales AS sale
WHERE salary > (
SELECT AVG(value) FROM categories AS catg
WHERE catg.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_08790 | train | T1 |
v2 | Schema:
transactions (alias: txn)(date, name, salary, amount)
invoices(date, salary, value, type)
Task: Retrieve amount from transactions that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_08791 | train | T1 |
v2 | Schema:
departments (alias: dept)(date, code, id, level)
transactions(status, id, level, salary)
Task: Retrieve value from departments that have at least one corresponding entry in transactions sharing the same code.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_08792 | train | T1 |
v2 | Schema:
orders (alias: ord)(date, name, salary, value)
regions(value, id, type, level)
Task: Retrieve amount from orders that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT amount 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": "amount",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_08793 | train | T1 |
v1 | Schema:
accounts (alias: acct)(salary, level, id, value)
managers(value, amount, salary, level)
Task: Find name from accounts where code appears in managers entries with matching level.
SQL: | SELECT name FROM accounts AS acct
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_08794 | train | T1 |
v3 | Schema:
requests (alias: ordr)(level, id, type, code)
sales(amount, name, id, code)
Task: Retrieve value from requests with amount above the COUNT(amount) of sales rows sharing the same code.
SQL: | SELECT value FROM requests AS ordr
WHERE amount > (
SELECT COUNT(amount) FROM sales AS sale
WHERE sale.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_08795 | train | T2 |
v2 | Schema:
products (alias: prod)(salary, name, status, level)
schedules(id, value, level, name)
Task: Find id from products where a matching record exists in schedules with the same type.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = prod.type
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_08796 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(status, name, level, code)
employees(id, amount, code, name)
Task: Retrieve value from warehouses with salary above the MAX(salary) of employees rows sharing the same code.
SQL: | SELECT value FROM warehouses AS whs
WHERE salary > (
SELECT MAX(salary) FROM employees AS emp
WHERE emp.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "employees",
"outer_alias": "whs",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_08797 | train | T2 |
v1 | Schema:
employees (alias: emp)(salary, amount, date, code)
schedules(status, id, amount, level)
Task: Select amount from employees where type exists in schedules for the same type.
SQL: | SELECT amount FROM employees AS emp
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_08798 | train | T1 |
v2 | Schema:
regions (alias: rgn)(salary, status, id, name)
schedules(salary, name, code, status)
Task: Retrieve code from regions that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_08799 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.