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 |
|---|---|---|---|---|---|---|
v1 | Schema:
schedules (alias: schd)(date, code, status, salary)
warehouses(level, code, name, status)
Task: Find amount from schedules where id appears in warehouses entries with matching level.
SQL: | SELECT amount FROM schedules AS schd
WHERE id IN (
SELECT id FROM warehouses AS whs
WHERE whs.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "warehouses",
"outer_alias": "schd",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_11600 | train | T2 |
v1 | Schema:
accounts (alias: acct)(type, value, amount, code)
transactions(amount, level, date, status)
Task: Select amount from accounts where type exists in transactions for the same level.
SQL: | SELECT amount FROM accounts AS acct
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_11601 | train | T1 |
v1 | Schema:
requests (alias: ordr)(level, code, name, type)
invoices(id, code, type, name)
Task: Retrieve name from requests whose status is found in invoices rows where id matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_11602 | train | T2 |
v1 | Schema:
schedules (alias: schd)(name, level, type, id)
warehouses(level, id, code, status)
Task: Retrieve salary from schedules whose id is found in warehouses rows where level matches the outer record.
SQL: | SELECT salary FROM schedules AS schd
WHERE id IN (
SELECT id FROM warehouses AS whs
WHERE whs.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "warehouses",
"outer_alias": "schd",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_11603 | train | T2 |
v1 | Schema:
employees (alias: emp)(level, value, id, name)
warehouses(level, name, id, amount)
Task: Select name from employees where status exists in warehouses for the same id.
SQL: | SELECT name FROM employees AS emp
WHERE status IN (
SELECT status FROM warehouses AS whs
WHERE whs.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "warehouses",
"outer_alias": "emp",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_11604 | train | T1 |
v2 | Schema:
staff (alias: empl)(code, level, status, salary)
managers(id, name, value, salary)
Task: Retrieve code from staff that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_11605 | train | T2 |
v3 | Schema:
budgets (alias: budg)(name, id, level, amount)
orders(amount, id, status, value)
Task: Find code from budgets where amount exceeds the average amount from orders for the same code.
SQL: | SELECT code FROM budgets AS budg
WHERE amount > (
SELECT COUNT(amount) FROM orders AS ord
WHERE ord.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "orders",
"outer_alias": "budg",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_11606 | train | T2 |
v3 | Schema:
categories (alias: catg)(id, level, salary, amount)
shipments(date, name, salary, id)
Task: Retrieve name from categories with value above the AVG(value) of shipments rows sharing the same id.
SQL: | SELECT name FROM categories AS catg
WHERE value > (
SELECT AVG(value) FROM shipments AS shp
WHERE shp.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_11607 | train | T2 |
v1 | Schema:
accounts (alias: acct)(value, amount, code, level)
categories(level, amount, date, code)
Task: Select code from accounts where code exists in categories for the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_11608 | train | T1 |
v1 | Schema:
services (alias: srvc)(level, name, type, code)
shipments(type, date, amount, code)
Task: Select amount from services where type exists in shipments for the same code.
SQL: | SELECT amount FROM services AS srvc
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "shipments",
"outer_alias": "srvc",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_11609 | train | T2 |
v3 | Schema:
staff (alias: empl)(status, salary, level, type)
services(date, name, level, value)
Task: Retrieve id from staff with value above the COUNT(amount) of services rows sharing the same id.
SQL: | SELECT id FROM staff AS empl
WHERE value > (
SELECT COUNT(amount) FROM services AS srvc
WHERE srvc.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "services",
"outer_alias": "empl",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_11610 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(amount, type, code, value)
regions(amount, type, id, status)
Task: Retrieve name from warehouses with salary above the COUNT(value) of regions rows sharing the same code.
SQL: | SELECT name FROM warehouses AS whs
WHERE salary > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "regions",
"outer_alias": "whs",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_11611 | train | T2 |
v1 | Schema:
orders (alias: ord)(value, amount, date, name)
requests(code, level, name, value)
Task: Find id from orders where status appears in requests entries with matching type.
SQL: | SELECT id FROM orders AS ord
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_11612 | train | T1 |
v3 | Schema:
departments (alias: dept)(status, date, code, name)
sales(amount, value, id, type)
Task: Find salary from departments where value exceeds the average salary from sales for the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE value > (
SELECT SUM(salary) FROM sales AS sale
WHERE sale.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_11613 | train | T1 |
v1 | Schema:
shipments (alias: shp)(name, code, amount, level)
staff(id, salary, status, code)
Task: Select value from shipments where type exists in staff for the same id.
SQL: | SELECT value 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": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_11614 | train | T2 |
v3 | Schema:
customers (alias: cust)(code, level, value, type)
products(status, level, date, id)
Task: Find amount from customers where value exceeds the average salary from products for the same type.
SQL: | SELECT amount FROM customers AS cust
WHERE value > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_11615 | train | T1 |
v3 | Schema:
invoices (alias: inv)(salary, code, amount, status)
customers(id, code, status, name)
Task: Find salary from invoices where salary exceeds the average salary from customers for the same level.
SQL: | SELECT salary FROM invoices AS inv
WHERE salary > (
SELECT SUM(salary) FROM customers AS cust
WHERE cust.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_11616 | train | T1 |
v2 | Schema:
sales (alias: sale)(date, name, salary, code)
orders(value, code, amount, salary)
Task: Find id from sales where a matching record exists in orders with the same level.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_11617 | train | T1 |
v2 | Schema:
managers (alias: mgr)(date, level, id, status)
orders(amount, id, salary, date)
Task: Find id from managers where a matching record exists in orders with the same id.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_11618 | train | T1 |
v2 | Schema:
services (alias: srvc)(type, id, amount, value)
requests(value, salary, date, type)
Task: Retrieve value from services that have at least one corresponding entry in requests sharing the same id.
SQL: | SELECT value FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "requests",
"outer_alias": "srvc",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_11619 | train | T2 |
v3 | Schema:
items (alias: lne)(date, name, type, level)
requests(level, amount, value, id)
Task: Find amount from items where salary exceeds the average salary from requests for the same status.
SQL: | SELECT amount FROM items AS lne
WHERE salary > (
SELECT AVG(salary) FROM requests AS ordr
WHERE ordr.status = lne.status
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_11620 | train | T2 |
v3 | Schema:
products (alias: prod)(salary, type, level, id)
services(salary, level, type, date)
Task: Retrieve amount from products with salary above the COUNT(amount) of services rows sharing the same level.
SQL: | SELECT amount FROM products AS prod
WHERE salary > (
SELECT COUNT(amount) FROM services AS srvc
WHERE srvc.level = prod.level
); | {
"outer_table": "products",
"inner_table": "services",
"outer_alias": "prod",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_11621 | train | T1 |
v3 | Schema:
staff (alias: empl)(date, amount, code, type)
customers(status, type, level, id)
Task: Retrieve id from staff with amount above the AVG(value) of customers rows sharing the same type.
SQL: | SELECT id FROM staff AS empl
WHERE amount > (
SELECT AVG(value) FROM customers AS cust
WHERE cust.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_11622 | train | T2 |
v1 | Schema:
transactions (alias: txn)(date, name, level, code)
employees(date, type, value, amount)
Task: Retrieve code from transactions whose type is found in employees rows where level matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_11623 | train | T1 |
v3 | Schema:
transactions (alias: txn)(id, type, date, status)
services(value, date, amount, type)
Task: Retrieve value from transactions with amount above the MAX(value) of services rows sharing the same code.
SQL: | SELECT value FROM transactions AS txn
WHERE amount > (
SELECT MAX(value) FROM services AS srvc
WHERE srvc.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "services",
"outer_alias": "txn",
"inner_alias": "srvc",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_11624 | train | T1 |
v2 | Schema:
requests (alias: ordr)(status, value, id, name)
items(level, type, name, value)
Task: Find value from requests where a matching record exists in items with the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_11625 | train | T2 |
v3 | Schema:
categories (alias: catg)(id, level, date, salary)
transactions(amount, value, status, code)
Task: Retrieve value from categories with amount above the COUNT(amount) of transactions rows sharing the same status.
SQL: | SELECT value FROM categories AS catg
WHERE amount > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_11626 | train | T2 |
v2 | Schema:
regions (alias: rgn)(code, amount, status, level)
transactions(level, name, date, amount)
Task: Find name from regions where a matching record exists in transactions with the same id.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_11627 | train | T2 |
v1 | Schema:
employees (alias: emp)(salary, code, status, level)
orders(name, amount, id, salary)
Task: Retrieve value from employees whose type is found in orders rows where level matches the outer record.
SQL: | SELECT value FROM employees AS emp
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_11628 | train | T1 |
v3 | Schema:
invoices (alias: inv)(type, level, salary, name)
employees(amount, id, code, name)
Task: Find salary from invoices where salary exceeds the average salary from employees for the same level.
SQL: | SELECT salary FROM invoices AS inv
WHERE salary > (
SELECT COUNT(salary) FROM employees AS emp
WHERE emp.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_11629 | train | T1 |
v2 | Schema:
accounts (alias: acct)(date, salary, level, status)
requests(amount, date, salary, code)
Task: Retrieve value from accounts that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_11630 | train | T1 |
v2 | Schema:
regions (alias: rgn)(level, id, code, status)
orders(amount, level, id, name)
Task: Retrieve name from regions that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_11631 | train | T2 |
v1 | Schema:
accounts (alias: acct)(salary, code, status, level)
transactions(level, type, id, salary)
Task: Retrieve value from accounts whose level is found in transactions rows where type matches the outer record.
SQL: | SELECT value FROM accounts AS acct
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_11632 | train | T1 |
v2 | Schema:
budgets (alias: budg)(code, value, name, salary)
sales(type, code, date, salary)
Task: Retrieve salary from budgets that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT salary 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": "salary",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_11633 | train | T2 |
v2 | Schema:
services (alias: srvc)(value, code, name, level)
regions(amount, level, id, salary)
Task: Find value from services where a matching record exists in regions with the same level.
SQL: | SELECT value FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "regions",
"outer_alias": "srvc",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_11634 | train | T2 |
v2 | Schema:
managers (alias: mgr)(id, name, code, value)
employees(level, id, salary, date)
Task: Retrieve name from managers that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_11635 | train | T1 |
v3 | Schema:
shipments (alias: shp)(name, level, id, type)
requests(amount, name, code, value)
Task: Find name from shipments where value exceeds the average amount from requests for the same status.
SQL: | SELECT name FROM shipments AS shp
WHERE value > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_11636 | train | T2 |
v1 | Schema:
departments (alias: dept)(code, id, amount, type)
accounts(date, code, type, salary)
Task: Retrieve id from departments whose type is found in accounts rows where level matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_11637 | train | T1 |
v2 | Schema:
customers (alias: cust)(type, status, id, value)
shipments(type, id, name, status)
Task: Find value from customers where a matching record exists in shipments with the same level.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_11638 | train | T1 |
v2 | Schema:
accounts (alias: acct)(level, date, name, code)
services(date, amount, name, status)
Task: Retrieve id from accounts that have at least one corresponding entry in services sharing the same type.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "services",
"outer_alias": "acct",
"inner_alias": "srvc",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_11639 | train | T1 |
v1 | Schema:
schedules (alias: schd)(amount, date, id, salary)
managers(id, value, date, level)
Task: Select amount from schedules where status exists in managers for the same code.
SQL: | SELECT amount FROM schedules AS schd
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_11640 | train | T2 |
v2 | Schema:
products (alias: prod)(type, code, salary, id)
items(amount, level, code, name)
Task: Retrieve amount from products that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = prod.type
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_11641 | train | T1 |
v1 | Schema:
departments (alias: dept)(status, amount, name, salary)
orders(value, salary, code, status)
Task: Retrieve id from departments whose id is found in orders rows where id matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_11642 | train | T1 |
v2 | Schema:
accounts (alias: acct)(amount, code, salary, id)
products(id, date, level, status)
Task: Retrieve code from accounts that have at least one corresponding entry in products sharing the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_11643 | train | T1 |
v1 | Schema:
staff (alias: empl)(value, date, status, salary)
items(level, code, amount, date)
Task: Select name from staff where status exists in items for the same code.
SQL: | SELECT name FROM staff AS empl
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_11644 | train | T2 |
v2 | Schema:
requests (alias: ordr)(date, code, type, value)
departments(amount, id, salary, type)
Task: Find amount from requests where a matching record exists in departments with the same level.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_11645 | train | T2 |
v3 | Schema:
requests (alias: ordr)(salary, code, status, level)
managers(status, salary, value, id)
Task: Find id from requests where salary exceeds the average salary from managers for the same type.
SQL: | SELECT id FROM requests AS ordr
WHERE salary > (
SELECT COUNT(salary) FROM managers AS mgr
WHERE mgr.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_11646 | train | T2 |
v3 | Schema:
budgets (alias: budg)(status, amount, name, salary)
schedules(id, name, value, amount)
Task: Retrieve amount from budgets with amount above the MIN(salary) of schedules rows sharing the same id.
SQL: | SELECT amount FROM budgets AS budg
WHERE amount > (
SELECT MIN(salary) FROM schedules AS schd
WHERE schd.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "schedules",
"outer_alias": "budg",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_11647 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(type, id, status, code)
regions(level, code, salary, name)
Task: Retrieve id from warehouses that have at least one corresponding entry in regions sharing the same level.
SQL: | SELECT id FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "regions",
"outer_alias": "whs",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_11648 | train | T2 |
v1 | Schema:
transactions (alias: txn)(salary, status, id, amount)
budgets(value, type, name, level)
Task: Select name from transactions where code exists in budgets for the same status.
SQL: | SELECT name FROM transactions AS txn
WHERE code IN (
SELECT code FROM budgets AS budg
WHERE budg.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "budgets",
"outer_alias": "txn",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_11649 | train | T1 |
v3 | Schema:
categories (alias: catg)(value, code, salary, amount)
sales(level, amount, id, status)
Task: Find id from categories where value exceeds the average amount from sales for the same type.
SQL: | SELECT id FROM categories AS catg
WHERE value > (
SELECT MAX(amount) FROM sales AS sale
WHERE sale.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_11650 | train | T2 |
v1 | Schema:
invoices (alias: inv)(name, salary, level, type)
sales(id, name, status, code)
Task: Find name from invoices where level appears in sales entries with matching id.
SQL: | SELECT name FROM invoices AS inv
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_11651 | train | T1 |
v1 | Schema:
categories (alias: catg)(type, code, level, id)
schedules(code, salary, date, value)
Task: Retrieve name from categories whose type is found in schedules rows where status matches the outer record.
SQL: | SELECT name FROM categories AS catg
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_11652 | train | T2 |
v3 | Schema:
requests (alias: ordr)(amount, date, level, value)
warehouses(id, amount, status, date)
Task: Retrieve salary from requests with value above the MAX(value) of warehouses rows sharing the same code.
SQL: | SELECT salary FROM requests AS ordr
WHERE value > (
SELECT MAX(value) FROM warehouses AS whs
WHERE whs.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "warehouses",
"outer_alias": "ordr",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_11653 | train | T2 |
v3 | Schema:
customers (alias: cust)(status, code, date, value)
requests(name, status, level, amount)
Task: Find amount from customers where salary exceeds the average salary from requests for the same type.
SQL: | SELECT amount FROM customers AS cust
WHERE salary > (
SELECT COUNT(salary) FROM requests AS ordr
WHERE ordr.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_11654 | train | T1 |
v2 | Schema:
requests (alias: ordr)(name, id, amount, date)
transactions(date, type, id, status)
Task: Find value from requests where a matching record exists in transactions with the same level.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_11655 | train | T2 |
v1 | Schema:
managers (alias: mgr)(salary, type, date, id)
invoices(level, id, status, amount)
Task: Find salary from managers where code appears in invoices entries with matching type.
SQL: | SELECT salary FROM managers AS mgr
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_11656 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(type, status, date, id)
budgets(status, code, level, type)
Task: Select amount from warehouses where status exists in budgets for the same type.
SQL: | SELECT amount FROM warehouses AS whs
WHERE status IN (
SELECT status FROM budgets AS budg
WHERE budg.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "budgets",
"outer_alias": "whs",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_11657 | train | T2 |
v2 | Schema:
customers (alias: cust)(value, amount, status, date)
items(salary, level, value, id)
Task: Find id from customers where a matching record exists in items with the same status.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_11658 | train | T1 |
v2 | Schema:
schedules (alias: schd)(value, name, status, type)
regions(level, value, status, salary)
Task: Retrieve name from schedules that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_11659 | train | T2 |
v3 | Schema:
invoices (alias: inv)(date, id, salary, code)
orders(code, level, type, date)
Task: Retrieve value from invoices with salary above the MAX(value) of orders rows sharing the same id.
SQL: | SELECT value FROM invoices AS inv
WHERE salary > (
SELECT MAX(value) FROM orders AS ord
WHERE ord.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_11660 | train | T1 |
v1 | Schema:
categories (alias: catg)(salary, date, level, id)
invoices(type, amount, date, status)
Task: Find id from categories where id appears in invoices entries with matching level.
SQL: | SELECT id FROM categories AS catg
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_11661 | train | T2 |
v3 | Schema:
invoices (alias: inv)(name, amount, salary, date)
managers(salary, name, value, status)
Task: Retrieve id from invoices with salary above the SUM(value) of managers rows sharing the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE salary > (
SELECT SUM(value) FROM managers AS mgr
WHERE mgr.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_11662 | train | T1 |
v1 | Schema:
products (alias: prod)(salary, name, status, code)
categories(type, salary, date, level)
Task: Retrieve amount from products whose level is found in categories rows where status matches the outer record.
SQL: | SELECT amount FROM products AS prod
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.status = prod.status
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_11663 | train | T1 |
v1 | Schema:
transactions (alias: txn)(amount, status, type, name)
warehouses(type, code, status, level)
Task: Retrieve id from transactions whose code is found in warehouses rows where code matches the outer record.
SQL: | SELECT id FROM transactions AS txn
WHERE code IN (
SELECT code FROM warehouses AS whs
WHERE whs.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "warehouses",
"outer_alias": "txn",
"inner_alias": "whs",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_11664 | train | T1 |
v3 | Schema:
items (alias: lne)(name, date, level, salary)
transactions(salary, type, status, name)
Task: Find name from items where amount exceeds the average amount from transactions for the same level.
SQL: | SELECT name FROM items AS lne
WHERE amount > (
SELECT SUM(amount) FROM transactions AS txn
WHERE txn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_11665 | train | T2 |
v2 | Schema:
invoices (alias: inv)(salary, id, value, date)
warehouses(status, salary, level, amount)
Task: Retrieve code from invoices that have at least one corresponding entry in warehouses sharing the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "warehouses",
"outer_alias": "inv",
"inner_alias": "whs",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_11666 | train | T1 |
v1 | Schema:
orders (alias: ord)(date, type, id, amount)
sales(name, code, level, amount)
Task: Select name from orders where status exists in sales for the same id.
SQL: | SELECT name FROM orders AS ord
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_11667 | train | T1 |
v2 | Schema:
staff (alias: empl)(status, salary, code, id)
services(status, name, amount, date)
Task: Find amount from staff where a matching record exists in services with the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "services",
"outer_alias": "empl",
"inner_alias": "srvc",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_11668 | train | T2 |
v3 | Schema:
items (alias: lne)(amount, value, status, type)
accounts(code, id, type, salary)
Task: Retrieve name from items with value above the MAX(salary) of accounts rows sharing the same status.
SQL: | SELECT name FROM items AS lne
WHERE value > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.status = lne.status
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_11669 | train | T2 |
v1 | Schema:
items (alias: lne)(amount, status, type, name)
departments(code, salary, name, date)
Task: Retrieve code from items whose level is found in departments rows where level matches the outer record.
SQL: | SELECT code FROM items AS lne
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.level = lne.level
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_11670 | train | T2 |
v3 | Schema:
requests (alias: ordr)(level, code, date, value)
customers(amount, status, value, salary)
Task: Retrieve id from requests with value above the MAX(value) of customers rows sharing the same type.
SQL: | SELECT id FROM requests AS ordr
WHERE value > (
SELECT MAX(value) FROM customers AS cust
WHERE cust.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_11671 | train | T2 |
v2 | Schema:
invoices (alias: inv)(type, amount, id, code)
requests(id, type, salary, level)
Task: Find code from invoices where a matching record exists in requests with the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_11672 | train | T1 |
v2 | Schema:
invoices (alias: inv)(salary, value, level, code)
sales(date, status, code, amount)
Task: Find name from invoices where a matching record exists in sales with the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_11673 | train | T1 |
v2 | Schema:
accounts (alias: acct)(type, code, salary, value)
regions(id, amount, date, code)
Task: Retrieve code from accounts that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_11674 | train | T1 |
v2 | Schema:
invoices (alias: inv)(level, salary, status, value)
accounts(amount, salary, id, name)
Task: Retrieve name from invoices that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_11675 | train | T1 |
v3 | Schema:
staff (alias: empl)(salary, date, id, value)
customers(salary, status, amount, type)
Task: Find id from staff where amount exceeds the average value from customers for the same level.
SQL: | SELECT id FROM staff AS empl
WHERE amount > (
SELECT MIN(value) FROM customers AS cust
WHERE cust.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_11676 | train | T2 |
v3 | Schema:
requests (alias: ordr)(level, date, name, salary)
orders(code, type, name, salary)
Task: Find name from requests where amount exceeds the average amount from orders for the same type.
SQL: | SELECT name FROM requests AS ordr
WHERE amount > (
SELECT SUM(amount) FROM orders AS ord
WHERE ord.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_11677 | train | T2 |
v2 | Schema:
invoices (alias: inv)(type, date, salary, code)
departments(code, level, type, date)
Task: Find salary from invoices where a matching record exists in departments with the same type.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_11678 | train | T1 |
v3 | Schema:
products (alias: prod)(salary, value, status, date)
requests(name, level, type, code)
Task: Retrieve value from products with salary above the SUM(value) of requests rows sharing the same type.
SQL: | SELECT value FROM products AS prod
WHERE salary > (
SELECT SUM(value) FROM requests AS ordr
WHERE ordr.type = prod.type
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_11679 | train | T1 |
v1 | Schema:
accounts (alias: acct)(salary, type, date, amount)
orders(amount, name, code, id)
Task: Retrieve id from accounts whose status is found in orders rows where id matches the outer record.
SQL: | SELECT id FROM accounts AS acct
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_11680 | train | T1 |
v1 | Schema:
products (alias: prod)(name, level, status, salary)
accounts(value, salary, id, status)
Task: Retrieve name from products whose id is found in accounts rows where id matches the outer record.
SQL: | SELECT name FROM products AS prod
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.id = prod.id
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_11681 | train | T1 |
v1 | Schema:
orders (alias: ord)(value, id, amount, type)
invoices(status, level, value, salary)
Task: Retrieve salary from orders whose type is found in invoices rows where code matches the outer record.
SQL: | SELECT salary FROM orders AS ord
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_11682 | train | T1 |
v1 | Schema:
items (alias: lne)(code, status, name, level)
requests(amount, date, name, salary)
Task: Retrieve amount from items whose level is found in requests rows where id matches the outer record.
SQL: | SELECT amount FROM items AS lne
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.id = lne.id
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_11683 | train | T2 |
v1 | Schema:
schedules (alias: schd)(type, amount, date, value)
categories(level, id, date, name)
Task: Select name from schedules where id exists in categories for the same id.
SQL: | SELECT name FROM schedules AS schd
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_11684 | train | T2 |
v1 | Schema:
requests (alias: ordr)(status, date, code, level)
invoices(level, date, type, amount)
Task: Find code from requests where type appears in invoices entries with matching id.
SQL: | SELECT code FROM requests AS ordr
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_11685 | train | T2 |
v1 | Schema:
services (alias: srvc)(date, id, name, type)
products(date, name, salary, id)
Task: Retrieve value from services whose level is found in products rows where status matches the outer record.
SQL: | SELECT value FROM services AS srvc
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "products",
"outer_alias": "srvc",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_11686 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(date, level, type, status)
transactions(amount, id, code, level)
Task: Find amount from warehouses where a matching record exists in transactions with the same status.
SQL: | SELECT amount FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "transactions",
"outer_alias": "whs",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_11687 | train | T2 |
v3 | Schema:
departments (alias: dept)(id, date, level, code)
shipments(salary, type, name, id)
Task: Retrieve salary from departments with amount above the MIN(amount) of shipments rows sharing the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE amount > (
SELECT MIN(amount) FROM shipments AS shp
WHERE shp.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_11688 | train | T1 |
v2 | Schema:
regions (alias: rgn)(name, date, level, value)
invoices(type, name, status, code)
Task: Retrieve code from regions that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_11689 | train | T2 |
v1 | Schema:
departments (alias: dept)(id, name, salary, value)
items(level, status, name, value)
Task: Find salary from departments where type appears in items entries with matching id.
SQL: | SELECT salary FROM departments AS dept
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_11690 | train | T1 |
v2 | Schema:
shipments (alias: shp)(level, code, date, type)
budgets(amount, id, date, status)
Task: Find name from shipments where a matching record exists in budgets with the same status.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "budgets",
"outer_alias": "shp",
"inner_alias": "budg",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_11691 | train | T2 |
v1 | Schema:
employees (alias: emp)(type, status, id, date)
departments(value, salary, id, name)
Task: Retrieve id from employees whose level is found in departments rows where level matches the outer record.
SQL: | SELECT id FROM employees AS emp
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_11692 | train | T1 |
v2 | Schema:
shipments (alias: shp)(name, id, value, status)
transactions(date, id, status, code)
Task: Find salary from shipments where a matching record exists in transactions with the same id.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_11693 | train | T2 |
v2 | Schema:
orders (alias: ord)(value, code, status, id)
products(salary, type, value, code)
Task: Retrieve amount from orders that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_11694 | train | T1 |
v2 | Schema:
invoices (alias: inv)(name, code, salary, level)
shipments(code, name, value, type)
Task: Retrieve amount from invoices that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_11695 | train | T1 |
v3 | Schema:
shipments (alias: shp)(value, amount, type, id)
staff(value, type, salary, amount)
Task: Retrieve name from shipments with salary above the MIN(salary) of staff rows sharing the same code.
SQL: | SELECT name FROM shipments AS shp
WHERE salary > (
SELECT MIN(salary) FROM staff AS empl
WHERE empl.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_11696 | train | T2 |
v3 | Schema:
products (alias: prod)(code, amount, status, id)
warehouses(id, amount, status, value)
Task: Find id from products where value exceeds the average salary from warehouses for the same level.
SQL: | SELECT id FROM products AS prod
WHERE value > (
SELECT MIN(salary) FROM warehouses AS whs
WHERE whs.level = prod.level
); | {
"outer_table": "products",
"inner_table": "warehouses",
"outer_alias": "prod",
"inner_alias": "whs",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_11697 | train | T1 |
v1 | Schema:
items (alias: lne)(name, amount, salary, level)
sales(amount, name, status, type)
Task: Retrieve value from items whose status is found in sales rows where status matches the outer record.
SQL: | SELECT value FROM items AS lne
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.status = lne.status
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_11698 | train | T2 |
v1 | Schema:
items (alias: lne)(code, name, value, date)
regions(type, value, date, id)
Task: Select amount from items where id exists in regions for the same status.
SQL: | SELECT amount 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": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_11699 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.