variant stringclasses 3
values | prompt stringlengths 163 237 | sql stringlengths 103 143 | metadata unknown | id stringlengths 21 21 | split stringclasses 1
value | token_group stringclasses 2
values |
|---|---|---|---|---|---|---|
v2 | Schema:
warehouses (alias: whs)(salary, level, date, code)
managers(salary, value, name, type)
Task: Retrieve amount from warehouses that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT amount FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "managers",
"outer_alias": "whs",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_02800 | train | T2 |
v2 | Schema:
services (alias: srvc)(status, date, id, level)
regions(name, date, level, code)
Task: Retrieve code from services that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT code FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "regions",
"outer_alias": "srvc",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_02801 | train | T2 |
v3 | Schema:
orders (alias: ord)(salary, id, name, level)
schedules(type, amount, date, code)
Task: Find salary from orders where amount exceeds the average amount from schedules for the same id.
SQL: | SELECT salary FROM orders AS ord
WHERE amount > (
SELECT SUM(amount) FROM schedules AS schd
WHERE schd.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_02802 | train | T1 |
v3 | Schema:
products (alias: prod)(status, level, id, amount)
employees(name, code, id, salary)
Task: Retrieve amount from products with salary above the COUNT(value) of employees rows sharing the same level.
SQL: | SELECT amount FROM products AS prod
WHERE salary > (
SELECT COUNT(value) FROM employees AS emp
WHERE emp.level = prod.level
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_02803 | train | T1 |
v1 | Schema:
items (alias: lne)(code, name, amount, status)
transactions(date, value, code, level)
Task: Retrieve value from items whose code is found in transactions rows where status matches the outer record.
SQL: | SELECT value FROM items AS lne
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_02804 | train | T2 |
v3 | Schema:
services (alias: srvc)(value, status, date, code)
regions(salary, value, level, name)
Task: Find code from services where value exceeds the average salary from regions for the same status.
SQL: | SELECT code FROM services AS srvc
WHERE value > (
SELECT SUM(salary) FROM regions AS rgn
WHERE rgn.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "regions",
"outer_alias": "srvc",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_02805 | train | T2 |
v2 | Schema:
categories (alias: catg)(value, type, salary, date)
invoices(type, status, date, id)
Task: Retrieve code from categories that have at least one corresponding entry in invoices sharing the same id.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_02806 | train | T2 |
v1 | Schema:
staff (alias: empl)(salary, type, date, status)
budgets(salary, amount, type, date)
Task: Select value from staff where type exists in budgets for the same status.
SQL: | SELECT value FROM staff AS empl
WHERE type IN (
SELECT type FROM budgets AS budg
WHERE budg.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "budgets",
"outer_alias": "empl",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_02807 | train | T2 |
v3 | Schema:
budgets (alias: budg)(date, code, status, level)
schedules(name, value, level, id)
Task: Find value from budgets where salary exceeds the average value from schedules for the same type.
SQL: | SELECT value FROM budgets AS budg
WHERE salary > (
SELECT MIN(value) FROM schedules AS schd
WHERE schd.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "schedules",
"outer_alias": "budg",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_02808 | train | T2 |
v3 | Schema:
transactions (alias: txn)(date, id, value, salary)
shipments(salary, status, level, amount)
Task: Find id from transactions where amount exceeds the average amount from shipments for the same id.
SQL: | SELECT id FROM transactions AS txn
WHERE amount > (
SELECT AVG(amount) FROM shipments AS shp
WHERE shp.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_02809 | train | T1 |
v2 | Schema:
customers (alias: cust)(value, name, code, salary)
employees(salary, amount, type, level)
Task: Find code from customers where a matching record exists in employees with the same type.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_02810 | train | T1 |
v3 | Schema:
invoices (alias: inv)(name, salary, status, id)
items(value, status, salary, type)
Task: Retrieve salary from invoices with salary above the MIN(salary) of items rows sharing the same level.
SQL: | SELECT salary FROM invoices AS inv
WHERE salary > (
SELECT MIN(salary) FROM items AS lne
WHERE lne.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_02811 | train | T1 |
v3 | Schema:
customers (alias: cust)(amount, type, code, level)
accounts(name, id, level, status)
Task: Retrieve name from customers with value above the MAX(amount) of accounts rows sharing the same type.
SQL: | SELECT name FROM customers AS cust
WHERE value > (
SELECT MAX(amount) FROM accounts AS acct
WHERE acct.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_02812 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(type, status, salary, id)
schedules(id, date, code, name)
Task: Retrieve value from warehouses whose level is found in schedules rows where id matches the outer record.
SQL: | SELECT value FROM warehouses AS whs
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "schedules",
"outer_alias": "whs",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_02813 | train | T2 |
v3 | Schema:
categories (alias: catg)(name, type, status, level)
requests(salary, level, name, type)
Task: Find name from categories where value exceeds the average amount from requests for the same status.
SQL: | SELECT name FROM categories AS catg
WHERE value > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_02814 | train | T2 |
v3 | Schema:
accounts (alias: acct)(name, date, level, value)
items(code, salary, value, amount)
Task: Retrieve code from accounts with value above the MAX(value) of items rows sharing the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE value > (
SELECT MAX(value) FROM items AS lne
WHERE lne.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_02815 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(type, level, date, value)
departments(type, date, salary, code)
Task: Find id from warehouses where code appears in departments entries with matching code.
SQL: | SELECT id FROM warehouses AS whs
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "departments",
"outer_alias": "whs",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_02816 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(level, code, salary, amount)
requests(code, level, value, amount)
Task: Retrieve id from warehouses with amount above the AVG(amount) of requests rows sharing the same type.
SQL: | SELECT id FROM warehouses AS whs
WHERE amount > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "requests",
"outer_alias": "whs",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_02817 | train | T2 |
v2 | Schema:
employees (alias: emp)(code, value, salary, status)
invoices(level, code, type, status)
Task: Retrieve value from employees that have at least one corresponding entry in invoices sharing the same id.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_02818 | train | T1 |
v3 | Schema:
staff (alias: empl)(name, id, code, type)
categories(date, value, amount, salary)
Task: Retrieve amount from staff with amount above the SUM(value) of categories rows sharing the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE amount > (
SELECT SUM(value) FROM categories AS catg
WHERE catg.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_02819 | train | T2 |
v1 | Schema:
regions (alias: rgn)(amount, id, date, status)
products(name, id, value, type)
Task: Retrieve salary from regions whose id is found in products rows where level matches the outer record.
SQL: | SELECT salary FROM regions AS rgn
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_02820 | train | T2 |
v1 | Schema:
customers (alias: cust)(type, code, name, level)
regions(date, status, salary, value)
Task: Retrieve value from customers whose status is found in regions rows where status matches the outer record.
SQL: | SELECT value FROM customers AS cust
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_02821 | train | T1 |
v3 | Schema:
shipments (alias: shp)(salary, value, id, code)
employees(value, level, status, date)
Task: Find salary from shipments where value exceeds the average value from employees for the same id.
SQL: | SELECT salary FROM shipments AS shp
WHERE value > (
SELECT MIN(value) FROM employees AS emp
WHERE emp.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_02822 | train | T2 |
v2 | Schema:
managers (alias: mgr)(id, code, date, level)
services(name, level, amount, date)
Task: Find amount from managers where a matching record exists in services with the same type.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "services",
"outer_alias": "mgr",
"inner_alias": "srvc",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_02823 | train | T1 |
v1 | Schema:
products (alias: prod)(amount, level, salary, id)
budgets(status, name, salary, value)
Task: Find name from products where status appears in budgets entries with matching level.
SQL: | SELECT name FROM products AS prod
WHERE status IN (
SELECT status FROM budgets AS budg
WHERE budg.level = prod.level
); | {
"outer_table": "products",
"inner_table": "budgets",
"outer_alias": "prod",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_02824 | train | T1 |
v2 | Schema:
budgets (alias: budg)(code, salary, type, date)
customers(name, level, type, id)
Task: Retrieve value from budgets that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT value FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "customers",
"outer_alias": "budg",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_02825 | train | T2 |
v2 | Schema:
budgets (alias: budg)(type, value, date, level)
invoices(date, salary, name, value)
Task: Retrieve id from budgets that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT id FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "invoices",
"outer_alias": "budg",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_02826 | train | T2 |
v2 | Schema:
managers (alias: mgr)(id, code, salary, status)
customers(code, value, amount, salary)
Task: Find id from managers where a matching record exists in customers with the same id.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_02827 | train | T1 |
v1 | Schema:
invoices (alias: inv)(level, type, date, status)
categories(status, name, amount, date)
Task: Retrieve salary from invoices whose level is found in categories rows where code matches the outer record.
SQL: | SELECT salary FROM invoices AS inv
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_02828 | train | T1 |
v2 | Schema:
shipments (alias: shp)(salary, name, id, level)
sales(name, type, code, amount)
Task: Find amount from shipments where a matching record exists in sales with the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_02829 | train | T2 |
v2 | Schema:
orders (alias: ord)(level, amount, salary, code)
employees(name, level, type, value)
Task: Find salary from orders where a matching record exists in employees with the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_02830 | train | T1 |
v2 | Schema:
invoices (alias: inv)(type, status, level, value)
transactions(amount, type, date, code)
Task: Find amount from invoices where a matching record exists in transactions with the same status.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_02831 | train | T1 |
v3 | Schema:
shipments (alias: shp)(status, type, id, value)
items(code, date, status, type)
Task: Find name from shipments where salary exceeds the average salary from items for the same code.
SQL: | SELECT name FROM shipments AS shp
WHERE salary > (
SELECT AVG(salary) FROM items AS lne
WHERE lne.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_02832 | train | T2 |
v3 | Schema:
shipments (alias: shp)(level, status, name, code)
departments(id, type, date, code)
Task: Retrieve name from shipments with value above the MAX(amount) of departments rows sharing the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE value > (
SELECT MAX(amount) FROM departments AS dept
WHERE dept.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_02833 | train | T2 |
v3 | Schema:
sales (alias: sale)(value, code, level, name)
budgets(code, name, status, value)
Task: Find salary from sales where salary exceeds the average value from budgets for the same level.
SQL: | SELECT salary FROM sales AS sale
WHERE salary > (
SELECT COUNT(value) FROM budgets AS budg
WHERE budg.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "budgets",
"outer_alias": "sale",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_02834 | train | T1 |
v2 | Schema:
categories (alias: catg)(code, type, salary, name)
shipments(id, salary, value, name)
Task: Retrieve code from categories that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_02835 | train | T2 |
v2 | Schema:
items (alias: lne)(type, name, id, amount)
requests(level, amount, id, type)
Task: Retrieve id from items that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = lne.status
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_02836 | train | T2 |
v2 | Schema:
categories (alias: catg)(level, type, status, id)
requests(date, code, amount, salary)
Task: Find salary from categories where a matching record exists in requests with the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_02837 | train | T2 |
v3 | Schema:
transactions (alias: txn)(level, salary, type, id)
invoices(status, amount, date, level)
Task: Retrieve value from transactions with salary above the SUM(salary) of invoices rows sharing the same status.
SQL: | SELECT value FROM transactions AS txn
WHERE salary > (
SELECT SUM(salary) FROM invoices AS inv
WHERE inv.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_02838 | train | T1 |
v2 | Schema:
shipments (alias: shp)(amount, type, name, code)
managers(type, status, level, date)
Task: Retrieve code from shipments that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_02839 | train | T2 |
v3 | Schema:
transactions (alias: txn)(name, level, code, date)
managers(date, amount, value, salary)
Task: Find amount from transactions where value exceeds the average value from managers for the same code.
SQL: | SELECT amount FROM transactions AS txn
WHERE value > (
SELECT SUM(value) FROM managers AS mgr
WHERE mgr.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_02840 | train | T1 |
v3 | Schema:
shipments (alias: shp)(type, name, id, salary)
schedules(status, type, level, code)
Task: Retrieve value from shipments with salary above the AVG(value) of schedules rows sharing the same type.
SQL: | SELECT value FROM shipments AS shp
WHERE salary > (
SELECT AVG(value) FROM schedules AS schd
WHERE schd.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_02841 | train | T2 |
v1 | Schema:
orders (alias: ord)(id, date, amount, code)
departments(name, code, type, id)
Task: Select name from orders where id exists in departments for the same status.
SQL: | SELECT name FROM orders AS ord
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_02842 | train | T1 |
v2 | Schema:
sales (alias: sale)(status, value, type, code)
shipments(id, name, value, level)
Task: Retrieve id from sales that have at least one corresponding entry in shipments sharing the same level.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_02843 | train | T1 |
v2 | Schema:
customers (alias: cust)(salary, value, status, type)
employees(amount, id, type, code)
Task: Find salary from customers where a matching record exists in employees with the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_02844 | train | T1 |
v2 | Schema:
customers (alias: cust)(date, name, level, code)
orders(amount, id, type, name)
Task: Retrieve code from customers that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_02845 | train | T1 |
v1 | Schema:
sales (alias: sale)(amount, level, salary, value)
requests(id, value, salary, type)
Task: Select salary from sales where type exists in requests for the same id.
SQL: | SELECT salary FROM sales AS sale
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_02846 | train | T1 |
v2 | Schema:
staff (alias: empl)(date, type, level, value)
shipments(salary, type, value, date)
Task: Find name from staff where a matching record exists in shipments with the same code.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_02847 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(status, salary, id, date)
services(salary, name, status, amount)
Task: Retrieve code from warehouses that have at least one corresponding entry in services sharing the same code.
SQL: | SELECT code FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "services",
"outer_alias": "whs",
"inner_alias": "srvc",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_02848 | train | T2 |
v2 | Schema:
budgets (alias: budg)(amount, type, salary, date)
schedules(id, name, salary, level)
Task: Retrieve amount from budgets that have at least one corresponding entry in schedules sharing the same type.
SQL: | SELECT amount FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "schedules",
"outer_alias": "budg",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_02849 | train | T2 |
v1 | Schema:
managers (alias: mgr)(status, amount, name, date)
requests(amount, value, date, type)
Task: Select name from managers where status exists in requests for the same code.
SQL: | SELECT name FROM managers AS mgr
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_02850 | train | T1 |
v2 | Schema:
accounts (alias: acct)(code, value, name, id)
employees(status, id, code, value)
Task: Retrieve name from accounts that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_02851 | train | T1 |
v2 | Schema:
regions (alias: rgn)(level, type, status, salary)
sales(value, level, name, status)
Task: Find name from regions where a matching record exists in sales with the same status.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_02852 | train | T2 |
v1 | Schema:
accounts (alias: acct)(level, value, salary, amount)
orders(value, amount, status, name)
Task: Find salary from accounts where code appears in orders entries with matching id.
SQL: | SELECT salary FROM accounts AS acct
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_02853 | train | T1 |
v2 | Schema:
departments (alias: dept)(level, salary, value, type)
accounts(id, amount, value, name)
Task: Find salary from departments where a matching record exists in accounts with the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_02854 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(id, status, code, amount)
employees(type, date, code, amount)
Task: Select value from warehouses where id exists in employees for the same level.
SQL: | SELECT value FROM warehouses AS whs
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "employees",
"outer_alias": "whs",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_02855 | train | T2 |
v2 | Schema:
requests (alias: ordr)(status, name, date, id)
invoices(level, type, code, salary)
Task: Retrieve name from requests that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT name 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": "name",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_02856 | train | T2 |
v2 | Schema:
employees (alias: emp)(code, name, amount, value)
orders(name, id, date, level)
Task: Retrieve id from employees that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_02857 | train | T1 |
v2 | Schema:
departments (alias: dept)(salary, amount, level, date)
regions(level, date, amount, name)
Task: Find name from departments where a matching record exists in regions with the same code.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_02858 | train | T1 |
v2 | Schema:
transactions (alias: txn)(name, value, code, amount)
services(type, name, date, id)
Task: Retrieve salary from transactions that have at least one corresponding entry in services sharing the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "services",
"outer_alias": "txn",
"inner_alias": "srvc",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_02859 | train | T1 |
v3 | Schema:
departments (alias: dept)(type, salary, amount, level)
accounts(salary, status, amount, value)
Task: Find id from departments where salary exceeds the average amount from accounts for the same type.
SQL: | SELECT id FROM departments AS dept
WHERE salary > (
SELECT COUNT(amount) FROM accounts AS acct
WHERE acct.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_02860 | train | T1 |
v1 | Schema:
budgets (alias: budg)(code, name, level, type)
categories(status, id, name, salary)
Task: Select amount from budgets where status exists in categories for the same id.
SQL: | SELECT amount FROM budgets AS budg
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "categories",
"outer_alias": "budg",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_02861 | train | T2 |
v1 | Schema:
schedules (alias: schd)(salary, type, status, name)
sales(type, date, value, status)
Task: Retrieve value from schedules whose id is found in sales rows where id matches the outer record.
SQL: | SELECT value FROM schedules AS schd
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_02862 | train | T2 |
v1 | Schema:
transactions (alias: txn)(amount, code, id, level)
shipments(amount, id, date, level)
Task: Find name from transactions where id appears in shipments entries with matching code.
SQL: | SELECT name FROM transactions AS txn
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_02863 | train | T1 |
v3 | Schema:
sales (alias: sale)(id, type, value, date)
requests(date, level, value, name)
Task: Find name from sales where amount exceeds the average salary from requests for the same code.
SQL: | SELECT name FROM sales AS sale
WHERE amount > (
SELECT COUNT(salary) FROM requests AS ordr
WHERE ordr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_02864 | train | T1 |
v2 | Schema:
managers (alias: mgr)(name, status, date, code)
warehouses(id, value, status, date)
Task: Find id from managers where a matching record exists in warehouses with the same id.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "warehouses",
"outer_alias": "mgr",
"inner_alias": "whs",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_02865 | train | T1 |
v1 | Schema:
budgets (alias: budg)(id, code, value, amount)
invoices(status, id, salary, value)
Task: Retrieve code from budgets whose id is found in invoices rows where status matches the outer record.
SQL: | SELECT code FROM budgets AS budg
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "invoices",
"outer_alias": "budg",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_02866 | train | T2 |
v3 | Schema:
employees (alias: emp)(id, type, salary, code)
staff(salary, id, level, code)
Task: Retrieve value from employees with value above the MIN(value) of staff rows sharing the same code.
SQL: | SELECT value FROM employees AS emp
WHERE value > (
SELECT MIN(value) FROM staff AS empl
WHERE empl.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_02867 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(id, salary, level, code)
schedules(date, name, value, salary)
Task: Retrieve id from warehouses whose id is found in schedules rows where type matches the outer record.
SQL: | SELECT id FROM warehouses AS whs
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "schedules",
"outer_alias": "whs",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_02868 | train | T2 |
v2 | Schema:
orders (alias: ord)(amount, code, name, id)
regions(name, status, level, amount)
Task: Retrieve name from orders that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_02869 | train | T1 |
v1 | Schema:
requests (alias: ordr)(level, name, amount, code)
managers(name, status, type, salary)
Task: Retrieve code from requests whose type is found in managers rows where type matches the outer record.
SQL: | SELECT code FROM requests AS ordr
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_02870 | train | T2 |
v3 | Schema:
invoices (alias: inv)(value, id, type, level)
orders(code, value, amount, id)
Task: Retrieve amount from invoices with value above the SUM(amount) of orders rows sharing the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE value > (
SELECT SUM(amount) FROM orders AS ord
WHERE ord.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_02871 | train | T1 |
v2 | Schema:
accounts (alias: acct)(level, code, salary, date)
invoices(value, salary, name, type)
Task: Find code from accounts where a matching record exists in invoices with the same status.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_02872 | train | T1 |
v2 | Schema:
departments (alias: dept)(id, amount, type, level)
managers(date, salary, name, value)
Task: Find name from departments where a matching record exists in managers with the same id.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_02873 | train | T1 |
v2 | Schema:
shipments (alias: shp)(value, status, name, amount)
customers(date, level, salary, name)
Task: Find value from shipments where a matching record exists in customers with the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_02874 | train | T2 |
v2 | Schema:
sales (alias: sale)(status, id, salary, type)
employees(id, date, value, name)
Task: Find salary from sales where a matching record exists in employees with the same type.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_02875 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(amount, date, status, level)
categories(code, salary, name, date)
Task: Retrieve name from warehouses with amount above the MAX(amount) of categories rows sharing the same type.
SQL: | SELECT name FROM warehouses AS whs
WHERE amount > (
SELECT MAX(amount) FROM categories AS catg
WHERE catg.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "categories",
"outer_alias": "whs",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_02876 | train | T2 |
v2 | Schema:
employees (alias: emp)(name, date, value, type)
categories(status, salary, name, amount)
Task: Retrieve amount from employees that have at least one corresponding entry in categories sharing the same level.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_02877 | train | T1 |
v1 | Schema:
sales (alias: sale)(salary, level, name, amount)
warehouses(amount, salary, date, status)
Task: Select id from sales where type exists in warehouses for the same type.
SQL: | SELECT id FROM sales AS sale
WHERE type IN (
SELECT type FROM warehouses AS whs
WHERE whs.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "warehouses",
"outer_alias": "sale",
"inner_alias": "whs",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_02878 | train | T1 |
v2 | Schema:
invoices (alias: inv)(code, name, id, type)
items(type, date, status, id)
Task: Find salary from invoices where a matching record exists in items with the same type.
SQL: | SELECT salary 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": "salary",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_02879 | train | T1 |
v3 | Schema:
regions (alias: rgn)(status, salary, value, level)
sales(amount, level, id, type)
Task: Retrieve value from regions with amount above the MAX(value) of sales rows sharing the same status.
SQL: | SELECT value FROM regions AS rgn
WHERE amount > (
SELECT MAX(value) FROM sales AS sale
WHERE sale.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_02880 | train | T2 |
v3 | Schema:
invoices (alias: inv)(name, level, date, id)
sales(type, value, status, code)
Task: Find code from invoices where amount exceeds the average salary from sales for the same level.
SQL: | SELECT code FROM invoices AS inv
WHERE amount > (
SELECT COUNT(salary) FROM sales AS sale
WHERE sale.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_02881 | train | T1 |
v3 | Schema:
regions (alias: rgn)(code, value, salary, id)
budgets(name, status, amount, salary)
Task: Retrieve name from regions with salary above the SUM(salary) of budgets rows sharing the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE salary > (
SELECT SUM(salary) FROM budgets AS budg
WHERE budg.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "budgets",
"outer_alias": "rgn",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_02882 | train | T2 |
v2 | Schema:
categories (alias: catg)(level, salary, code, type)
warehouses(amount, value, date, code)
Task: Find salary from categories where a matching record exists in warehouses with the same status.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "warehouses",
"outer_alias": "catg",
"inner_alias": "whs",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_02883 | train | T2 |
v2 | Schema:
requests (alias: ordr)(level, type, name, code)
customers(salary, status, amount, name)
Task: Retrieve value from requests that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_02884 | train | T2 |
v1 | Schema:
categories (alias: catg)(name, status, value, code)
warehouses(id, salary, status, type)
Task: Find amount from categories where id appears in warehouses entries with matching type.
SQL: | SELECT amount FROM categories AS catg
WHERE id IN (
SELECT id FROM warehouses AS whs
WHERE whs.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "warehouses",
"outer_alias": "catg",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_02885 | train | T2 |
v1 | Schema:
accounts (alias: acct)(date, level, name, id)
items(status, level, id, amount)
Task: Select code from accounts where code exists in items for the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_02886 | train | T1 |
v2 | Schema:
regions (alias: rgn)(salary, level, date, amount)
departments(status, id, type, amount)
Task: Find amount from regions where a matching record exists in departments with the same type.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_02887 | train | T2 |
v2 | Schema:
employees (alias: emp)(date, id, type, level)
transactions(name, type, code, value)
Task: Find name from employees where a matching record exists in transactions with the same type.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_02888 | train | T1 |
v2 | Schema:
budgets (alias: budg)(salary, date, name, level)
schedules(level, status, code, amount)
Task: Retrieve amount from budgets that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT amount FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "schedules",
"outer_alias": "budg",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_02889 | train | T2 |
v2 | Schema:
budgets (alias: budg)(name, code, salary, level)
orders(name, level, amount, date)
Task: Retrieve value from budgets that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT value FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "orders",
"outer_alias": "budg",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_02890 | train | T2 |
v1 | Schema:
regions (alias: rgn)(level, code, amount, type)
accounts(date, name, salary, level)
Task: Find id from regions where status appears in accounts entries with matching code.
SQL: | SELECT id FROM regions AS rgn
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_02891 | train | T2 |
v2 | Schema:
regions (alias: rgn)(level, amount, salary, value)
sales(status, code, value, salary)
Task: Retrieve id from regions that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_02892 | train | T2 |
v2 | Schema:
invoices (alias: inv)(name, code, date, level)
customers(date, name, status, amount)
Task: Retrieve amount from invoices that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_02893 | train | T1 |
v3 | Schema:
employees (alias: emp)(name, type, amount, level)
items(status, name, salary, type)
Task: Find amount from employees where value exceeds the average amount from items for the same id.
SQL: | SELECT amount FROM employees AS emp
WHERE value > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_02894 | train | T1 |
v1 | Schema:
budgets (alias: budg)(amount, salary, code, level)
requests(date, amount, value, level)
Task: Retrieve code from budgets whose code is found in requests rows where code matches the outer record.
SQL: | SELECT code FROM budgets AS budg
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "requests",
"outer_alias": "budg",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_02895 | train | T2 |
v2 | Schema:
categories (alias: catg)(amount, salary, code, name)
items(name, salary, amount, code)
Task: Retrieve name from categories that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_02896 | train | T2 |
v1 | Schema:
managers (alias: mgr)(date, salary, code, status)
regions(amount, name, level, date)
Task: Retrieve salary from managers whose id is found in regions rows where level matches the outer record.
SQL: | SELECT salary FROM managers AS mgr
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_02897 | train | T1 |
v1 | Schema:
services (alias: srvc)(name, value, type, id)
staff(id, name, code, status)
Task: Select code from services where type exists in staff for the same status.
SQL: | SELECT code FROM services AS srvc
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "staff",
"outer_alias": "srvc",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_02898 | train | T2 |
v2 | Schema:
orders (alias: ord)(amount, id, value, status)
departments(level, status, date, amount)
Task: Find code from orders where a matching record exists in departments with the same id.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_02899 | train | T1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.