variant stringclasses 3
values | prompt stringlengths 163 237 | sql stringlengths 103 143 | metadata unknown | id stringlengths 21 21 | split stringclasses 1
value | token_group stringclasses 2
values |
|---|---|---|---|---|---|---|
v3 | Schema:
items (alias: lne)(level, code, type, salary)
orders(status, code, value, id)
Task: Find amount from items where salary exceeds the average amount from orders for the same level.
SQL: | SELECT amount FROM items AS lne
WHERE salary > (
SELECT COUNT(amount) FROM orders AS ord
WHERE ord.level = lne.level
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_09800 | train | T2 |
v3 | Schema:
shipments (alias: shp)(type, id, status, amount)
departments(date, id, level, salary)
Task: Find code from shipments where salary exceeds the average amount from departments for the same level.
SQL: | SELECT code FROM shipments AS shp
WHERE salary > (
SELECT SUM(amount) FROM departments AS dept
WHERE dept.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_09801 | train | T2 |
v2 | Schema:
transactions (alias: txn)(salary, value, amount, status)
items(date, type, code, status)
Task: Find code from transactions where a matching record exists in items with the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_09802 | train | T1 |
v2 | Schema:
employees (alias: emp)(id, status, type, level)
accounts(level, status, value, date)
Task: Retrieve id from employees that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_09803 | train | T1 |
v2 | Schema:
items (alias: lne)(type, salary, status, code)
budgets(type, salary, amount, date)
Task: Retrieve name from items that have at least one corresponding entry in budgets sharing the same level.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.level = lne.level
); | {
"outer_table": "items",
"inner_table": "budgets",
"outer_alias": "lne",
"inner_alias": "budg",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_09804 | train | T2 |
v2 | Schema:
accounts (alias: acct)(id, name, code, status)
departments(status, date, id, name)
Task: Find value from accounts where a matching record exists in departments with the same code.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_09805 | train | T1 |
v2 | Schema:
items (alias: lne)(code, value, status, date)
categories(value, id, date, amount)
Task: Find value from items where a matching record exists in categories with the same id.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = lne.id
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_09806 | train | T2 |
v3 | Schema:
regions (alias: rgn)(name, date, amount, status)
employees(code, date, id, status)
Task: Find salary from regions where amount exceeds the average value from employees for the same type.
SQL: | SELECT salary FROM regions AS rgn
WHERE amount > (
SELECT MAX(value) FROM employees AS emp
WHERE emp.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_09807 | train | T2 |
v1 | Schema:
staff (alias: empl)(amount, salary, date, code)
invoices(level, id, value, date)
Task: Retrieve amount from staff whose code is found in invoices rows where id matches the outer record.
SQL: | SELECT amount FROM staff AS empl
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_09808 | train | T2 |
v2 | Schema:
items (alias: lne)(name, status, value, salary)
accounts(type, date, amount, name)
Task: Retrieve amount from items that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = lne.level
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_09809 | train | T2 |
v2 | Schema:
orders (alias: ord)(date, value, type, level)
regions(amount, type, code, id)
Task: Find salary from orders where a matching record exists in regions with the same level.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_09810 | train | T1 |
v1 | Schema:
products (alias: prod)(salary, level, type, code)
services(value, id, code, date)
Task: Find code from products where status appears in services entries with matching status.
SQL: | SELECT code FROM products AS prod
WHERE status IN (
SELECT status FROM services AS srvc
WHERE srvc.status = prod.status
); | {
"outer_table": "products",
"inner_table": "services",
"outer_alias": "prod",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_09811 | train | T1 |
v2 | Schema:
accounts (alias: acct)(value, code, id, amount)
employees(status, value, amount, name)
Task: Find amount from accounts where a matching record exists in employees with the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_09812 | train | T1 |
v3 | Schema:
requests (alias: ordr)(name, amount, code, status)
schedules(id, level, salary, code)
Task: Retrieve id from requests with amount above the AVG(value) of schedules rows sharing the same id.
SQL: | SELECT id FROM requests AS ordr
WHERE amount > (
SELECT AVG(value) FROM schedules AS schd
WHERE schd.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_09813 | train | T2 |
v3 | Schema:
accounts (alias: acct)(level, amount, type, value)
regions(value, salary, type, id)
Task: Retrieve name from accounts with value above the SUM(salary) of regions rows sharing the same status.
SQL: | SELECT name FROM accounts AS acct
WHERE value > (
SELECT SUM(salary) FROM regions AS rgn
WHERE rgn.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_09814 | train | T1 |
v2 | Schema:
orders (alias: ord)(type, amount, value, level)
sales(code, value, status, name)
Task: Retrieve value from orders that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_09815 | train | T1 |
v3 | Schema:
customers (alias: cust)(value, level, amount, code)
transactions(status, type, id, amount)
Task: Find name from customers where amount exceeds the average salary from transactions for the same type.
SQL: | SELECT name FROM customers AS cust
WHERE amount > (
SELECT AVG(salary) FROM transactions AS txn
WHERE txn.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_09816 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(value, level, type, id)
departments(name, id, code, date)
Task: Find name from warehouses where a matching record exists in departments with the same id.
SQL: | SELECT name FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "departments",
"outer_alias": "whs",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_09817 | train | T2 |
v2 | Schema:
shipments (alias: shp)(code, level, value, amount)
managers(id, level, value, status)
Task: Find salary from shipments where a matching record exists in managers with the same status.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_09818 | train | T2 |
v3 | Schema:
departments (alias: dept)(date, salary, type, amount)
orders(name, id, salary, level)
Task: Retrieve name from departments with value above the MIN(value) of orders rows sharing the same type.
SQL: | SELECT name FROM departments AS dept
WHERE value > (
SELECT MIN(value) FROM orders AS ord
WHERE ord.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_09819 | train | T1 |
v2 | Schema:
invoices (alias: inv)(type, amount, date, id)
orders(type, status, code, amount)
Task: Find id from invoices where a matching record exists in orders with the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_09820 | train | T1 |
v2 | Schema:
transactions (alias: txn)(date, value, salary, level)
sales(type, status, level, salary)
Task: Find value from transactions where a matching record exists in sales with the same code.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_09821 | train | T1 |
v3 | Schema:
managers (alias: mgr)(value, id, code, name)
staff(name, value, date, code)
Task: Find id from managers where salary exceeds the average amount from staff for the same id.
SQL: | SELECT id FROM managers AS mgr
WHERE salary > (
SELECT AVG(amount) FROM staff AS empl
WHERE empl.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_09822 | train | T1 |
v2 | Schema:
services (alias: srvc)(status, salary, level, code)
customers(type, value, amount, level)
Task: Find salary from services where a matching record exists in customers with the same status.
SQL: | SELECT salary FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "customers",
"outer_alias": "srvc",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_09823 | train | T2 |
v1 | Schema:
regions (alias: rgn)(code, date, amount, level)
categories(status, id, date, value)
Task: Select code from regions where level exists in categories for the same id.
SQL: | SELECT code FROM regions AS rgn
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_09824 | train | T2 |
v1 | Schema:
departments (alias: dept)(date, name, level, code)
items(salary, type, level, date)
Task: Select code from departments where id exists in items for the same status.
SQL: | SELECT code FROM departments AS dept
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_09825 | train | T1 |
v2 | Schema:
managers (alias: mgr)(amount, value, type, code)
items(name, code, status, amount)
Task: Find id from managers where a matching record exists in items with the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_09826 | train | T1 |
v3 | Schema:
regions (alias: rgn)(type, salary, amount, status)
customers(name, level, code, value)
Task: Find value from regions where value exceeds the average amount from customers for the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE value > (
SELECT MAX(amount) FROM customers AS cust
WHERE cust.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_09827 | train | T2 |
v2 | Schema:
customers (alias: cust)(salary, date, level, value)
items(status, name, level, code)
Task: Find value from customers where a matching record exists in items with the same level.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_09828 | train | T1 |
v3 | Schema:
accounts (alias: acct)(amount, salary, code, name)
products(name, status, id, salary)
Task: Retrieve name from accounts with value above the SUM(amount) of products rows sharing the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE value > (
SELECT SUM(amount) FROM products AS prod
WHERE prod.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_09829 | train | T1 |
v3 | Schema:
transactions (alias: txn)(level, type, date, id)
categories(id, level, salary, type)
Task: Find amount from transactions where value exceeds the average amount from categories for the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE value > (
SELECT MIN(amount) FROM categories AS catg
WHERE catg.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_09830 | train | T1 |
v2 | Schema:
categories (alias: catg)(type, code, salary, level)
managers(status, code, amount, date)
Task: Retrieve salary from categories that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_09831 | train | T2 |
v1 | Schema:
staff (alias: empl)(status, date, amount, level)
sales(date, value, name, type)
Task: Find amount from staff where id appears in sales entries with matching code.
SQL: | SELECT amount FROM staff AS empl
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_09832 | train | T2 |
v3 | Schema:
budgets (alias: budg)(name, code, amount, status)
customers(name, amount, date, value)
Task: Find code from budgets where value exceeds the average salary from customers for the same code.
SQL: | SELECT code FROM budgets AS budg
WHERE value > (
SELECT SUM(salary) FROM customers AS cust
WHERE cust.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "customers",
"outer_alias": "budg",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_09833 | train | T2 |
v2 | Schema:
managers (alias: mgr)(salary, status, id, code)
sales(date, status, id, value)
Task: Retrieve value from managers that have at least one corresponding entry in sales sharing the same status.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_09834 | train | T1 |
v2 | Schema:
budgets (alias: budg)(salary, status, type, name)
requests(salary, type, value, id)
Task: Retrieve salary from budgets that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT salary FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "requests",
"outer_alias": "budg",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_09835 | train | T2 |
v2 | Schema:
sales (alias: sale)(id, code, value, name)
budgets(value, type, level, status)
Task: Retrieve code from sales that have at least one corresponding entry in budgets sharing the same id.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "budgets",
"outer_alias": "sale",
"inner_alias": "budg",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_09836 | train | T1 |
v3 | Schema:
accounts (alias: acct)(type, name, level, value)
shipments(value, date, level, code)
Task: Find amount from accounts where amount exceeds the average amount from shipments for the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE amount > (
SELECT AVG(amount) FROM shipments AS shp
WHERE shp.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_09837 | train | T1 |
v2 | Schema:
accounts (alias: acct)(salary, name, code, type)
warehouses(date, code, value, level)
Task: Find name from accounts where a matching record exists in warehouses with the same id.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "warehouses",
"outer_alias": "acct",
"inner_alias": "whs",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_09838 | train | T1 |
v3 | Schema:
managers (alias: mgr)(level, status, id, code)
warehouses(amount, date, level, value)
Task: Retrieve name from managers with amount above the MIN(value) of warehouses rows sharing the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE amount > (
SELECT MIN(value) FROM warehouses AS whs
WHERE whs.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "warehouses",
"outer_alias": "mgr",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_09839 | train | T1 |
v3 | Schema:
services (alias: srvc)(id, salary, code, status)
sales(id, amount, type, level)
Task: Retrieve value from services with value above the AVG(salary) of sales rows sharing the same level.
SQL: | SELECT value FROM services AS srvc
WHERE value > (
SELECT AVG(salary) FROM sales AS sale
WHERE sale.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "sales",
"outer_alias": "srvc",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_09840 | train | T2 |
v2 | Schema:
products (alias: prod)(type, date, salary, id)
shipments(value, amount, type, name)
Task: Find code from products where a matching record exists in shipments with the same type.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = prod.type
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_09841 | train | T1 |
v3 | Schema:
regions (alias: rgn)(id, type, code, name)
schedules(salary, name, status, date)
Task: Retrieve salary from regions with value above the SUM(amount) of schedules rows sharing the same code.
SQL: | SELECT salary FROM regions AS rgn
WHERE value > (
SELECT SUM(amount) FROM schedules AS schd
WHERE schd.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_09842 | train | T2 |
v2 | Schema:
schedules (alias: schd)(level, code, status, type)
departments(value, code, amount, name)
Task: Find value from schedules where a matching record exists in departments with the same status.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_09843 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(level, type, name, amount)
schedules(amount, type, level, salary)
Task: Find amount from warehouses where a matching record exists in schedules with the same type.
SQL: | SELECT amount FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "schedules",
"outer_alias": "whs",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_09844 | train | T2 |
v1 | Schema:
regions (alias: rgn)(type, value, code, status)
transactions(date, id, name, code)
Task: Retrieve salary from regions whose status is found in transactions rows where type matches the outer record.
SQL: | SELECT salary FROM regions AS rgn
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_09845 | train | T2 |
v1 | Schema:
orders (alias: ord)(value, date, code, id)
warehouses(value, amount, code, name)
Task: Find value from orders where code appears in warehouses entries with matching status.
SQL: | SELECT value FROM orders AS ord
WHERE code IN (
SELECT code FROM warehouses AS whs
WHERE whs.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "warehouses",
"outer_alias": "ord",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_09846 | train | T1 |
v2 | Schema:
invoices (alias: inv)(name, salary, code, level)
managers(name, code, level, id)
Task: Find value from invoices where a matching record exists in managers with the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_09847 | train | T1 |
v3 | Schema:
invoices (alias: inv)(level, code, status, id)
customers(code, salary, type, amount)
Task: Retrieve id from invoices with value above the COUNT(value) of customers rows sharing the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE value > (
SELECT COUNT(value) FROM customers AS cust
WHERE cust.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_09848 | train | T1 |
v2 | Schema:
budgets (alias: budg)(salary, date, type, level)
products(id, amount, value, status)
Task: Find salary from budgets where a matching record exists in products with the same id.
SQL: | SELECT salary FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "products",
"outer_alias": "budg",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_09849 | train | T2 |
v1 | Schema:
accounts (alias: acct)(level, date, amount, value)
shipments(name, status, value, level)
Task: Find name from accounts where status appears in shipments entries with matching code.
SQL: | SELECT name FROM accounts AS acct
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_09850 | train | T1 |
v1 | Schema:
services (alias: srvc)(id, type, salary, level)
orders(salary, date, name, type)
Task: Select code from services where type exists in orders for the same status.
SQL: | SELECT code FROM services AS srvc
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "orders",
"outer_alias": "srvc",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_09851 | train | T2 |
v3 | Schema:
services (alias: srvc)(status, name, code, amount)
regions(code, salary, value, level)
Task: Retrieve name from services with amount above the COUNT(value) of regions rows sharing the same status.
SQL: | SELECT name FROM services AS srvc
WHERE amount > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "regions",
"outer_alias": "srvc",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_09852 | train | T2 |
v1 | Schema:
items (alias: lne)(value, status, type, salary)
schedules(type, name, date, level)
Task: Find code from items where code appears in schedules entries with matching code.
SQL: | SELECT code FROM items AS lne
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.code = lne.code
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_09853 | train | T2 |
v3 | Schema:
budgets (alias: budg)(id, name, status, type)
customers(type, code, level, amount)
Task: Find amount from budgets where salary exceeds the average salary from customers for the same level.
SQL: | SELECT amount FROM budgets AS budg
WHERE salary > (
SELECT AVG(salary) FROM customers AS cust
WHERE cust.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "customers",
"outer_alias": "budg",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_09854 | train | T2 |
v3 | Schema:
departments (alias: dept)(id, date, name, value)
budgets(value, type, status, code)
Task: Find id from departments where value exceeds the average amount from budgets for the same status.
SQL: | SELECT id FROM departments AS dept
WHERE value > (
SELECT SUM(amount) FROM budgets AS budg
WHERE budg.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "budgets",
"outer_alias": "dept",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_09855 | train | T1 |
v1 | Schema:
services (alias: srvc)(status, amount, date, level)
products(code, amount, name, id)
Task: Retrieve name from services whose id is found in products rows where id matches the outer record.
SQL: | SELECT name FROM services AS srvc
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "products",
"outer_alias": "srvc",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_09856 | train | T2 |
v2 | Schema:
items (alias: lne)(id, type, code, name)
departments(amount, type, id, date)
Task: Retrieve code from items that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = lne.level
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_09857 | train | T2 |
v3 | Schema:
employees (alias: emp)(level, status, value, salary)
items(date, salary, type, name)
Task: Retrieve id from employees with amount above the MIN(value) of items rows sharing the same type.
SQL: | SELECT id FROM employees AS emp
WHERE amount > (
SELECT MIN(value) FROM items AS lne
WHERE lne.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_09858 | train | T1 |
v3 | Schema:
categories (alias: catg)(type, value, name, level)
employees(amount, code, date, id)
Task: Retrieve amount from categories with amount above the COUNT(value) of employees rows sharing the same type.
SQL: | SELECT amount FROM categories AS catg
WHERE amount > (
SELECT COUNT(value) FROM employees AS emp
WHERE emp.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_09859 | train | T2 |
v2 | Schema:
requests (alias: ordr)(level, value, salary, id)
regions(date, salary, type, id)
Task: Find amount from requests where a matching record exists in regions with the same status.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_09860 | train | T2 |
v3 | Schema:
products (alias: prod)(date, type, code, status)
schedules(type, id, status, level)
Task: Retrieve salary from products with value above the MIN(amount) of schedules rows sharing the same status.
SQL: | SELECT salary FROM products AS prod
WHERE value > (
SELECT MIN(amount) FROM schedules AS schd
WHERE schd.status = prod.status
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_09861 | train | T1 |
v1 | Schema:
departments (alias: dept)(amount, date, name, id)
services(value, amount, name, code)
Task: Retrieve salary from departments whose type is found in services rows where status matches the outer record.
SQL: | SELECT salary FROM departments AS dept
WHERE type IN (
SELECT type FROM services AS srvc
WHERE srvc.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "services",
"outer_alias": "dept",
"inner_alias": "srvc",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_09862 | train | T1 |
v3 | Schema:
requests (alias: ordr)(code, name, amount, date)
customers(date, name, salary, status)
Task: Find name from requests where value exceeds the average value from customers for the same type.
SQL: | SELECT name FROM requests AS ordr
WHERE value > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_09863 | train | T2 |
v2 | Schema:
budgets (alias: budg)(status, name, amount, level)
managers(name, amount, level, type)
Task: Find amount from budgets where a matching record exists in managers with the same type.
SQL: | SELECT amount FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "managers",
"outer_alias": "budg",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_09864 | train | T2 |
v2 | Schema:
schedules (alias: schd)(amount, value, name, date)
requests(status, salary, id, name)
Task: Find code from schedules where a matching record exists in requests with the same code.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_09865 | train | T2 |
v3 | Schema:
employees (alias: emp)(salary, name, level, date)
invoices(level, code, salary, name)
Task: Find value from employees where amount exceeds the average salary from invoices for the same level.
SQL: | SELECT value FROM employees AS emp
WHERE amount > (
SELECT MAX(salary) FROM invoices AS inv
WHERE inv.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_09866 | train | T1 |
v1 | Schema:
invoices (alias: inv)(code, level, amount, salary)
products(salary, date, name, type)
Task: Find amount from invoices where id appears in products entries with matching code.
SQL: | SELECT amount FROM invoices AS inv
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_09867 | train | T1 |
v2 | Schema:
requests (alias: ordr)(level, status, salary, value)
regions(type, level, date, salary)
Task: Find id from requests where a matching record exists in regions with the same code.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_09868 | train | T2 |
v1 | Schema:
sales (alias: sale)(type, name, code, level)
customers(value, salary, type, date)
Task: Find code from sales where level appears in customers entries with matching id.
SQL: | SELECT code FROM sales AS sale
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_09869 | train | T1 |
v3 | Schema:
orders (alias: ord)(amount, level, type, date)
warehouses(code, status, id, value)
Task: Find name from orders where salary exceeds the average salary from warehouses for the same id.
SQL: | SELECT name FROM orders AS ord
WHERE salary > (
SELECT MIN(salary) FROM warehouses AS whs
WHERE whs.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "warehouses",
"outer_alias": "ord",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_09870 | train | T1 |
v1 | Schema:
orders (alias: ord)(level, amount, status, code)
items(id, salary, value, type)
Task: Select amount from orders where status exists in items for the same status.
SQL: | SELECT amount FROM orders AS ord
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_09871 | train | T1 |
v3 | Schema:
requests (alias: ordr)(salary, status, code, amount)
managers(value, date, status, id)
Task: Retrieve value from requests with value above the MIN(value) of managers rows sharing the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE value > (
SELECT MIN(value) FROM managers AS mgr
WHERE mgr.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_09872 | train | T2 |
v1 | Schema:
categories (alias: catg)(level, code, name, type)
orders(name, type, status, code)
Task: Retrieve name from categories whose status is found in orders rows where level matches the outer record.
SQL: | SELECT name FROM categories AS catg
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_09873 | train | T2 |
v2 | Schema:
orders (alias: ord)(id, date, name, amount)
employees(level, name, id, date)
Task: Retrieve code from orders that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_09874 | train | T1 |
v3 | Schema:
items (alias: lne)(name, date, code, amount)
staff(date, type, status, code)
Task: Find code from items where amount exceeds the average amount from staff for the same id.
SQL: | SELECT code FROM items AS lne
WHERE amount > (
SELECT SUM(amount) FROM staff AS empl
WHERE empl.id = lne.id
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_09875 | train | T2 |
v2 | Schema:
services (alias: srvc)(status, amount, name, type)
employees(id, salary, level, status)
Task: Retrieve code from services that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT code FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "employees",
"outer_alias": "srvc",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_09876 | train | T2 |
v2 | Schema:
staff (alias: empl)(amount, value, level, type)
orders(salary, code, type, value)
Task: Retrieve amount from staff that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_09877 | train | T2 |
v1 | Schema:
budgets (alias: budg)(amount, id, salary, code)
employees(status, type, date, name)
Task: Retrieve id from budgets whose type is found in employees rows where type matches the outer record.
SQL: | SELECT id FROM budgets AS budg
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "employees",
"outer_alias": "budg",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_09878 | train | T2 |
v2 | Schema:
managers (alias: mgr)(id, date, value, status)
warehouses(code, id, status, amount)
Task: Find id from managers where a matching record exists in warehouses with the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "warehouses",
"outer_alias": "mgr",
"inner_alias": "whs",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_09879 | train | T1 |
v2 | Schema:
departments (alias: dept)(salary, type, amount, name)
orders(date, value, name, amount)
Task: Find value from departments where a matching record exists in orders with the same level.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_09880 | train | T1 |
v1 | Schema:
schedules (alias: schd)(id, value, name, level)
customers(amount, type, code, level)
Task: Retrieve value from schedules whose status is found in customers rows where id matches the outer record.
SQL: | SELECT value FROM schedules AS schd
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_09881 | train | T2 |
v2 | Schema:
products (alias: prod)(name, date, salary, id)
transactions(date, status, level, type)
Task: Retrieve code from products that have at least one corresponding entry in transactions sharing the same type.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = prod.type
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_09882 | train | T1 |
v3 | Schema:
customers (alias: cust)(id, amount, status, level)
orders(type, level, name, value)
Task: Find code from customers where salary exceeds the average value from orders for the same type.
SQL: | SELECT code FROM customers AS cust
WHERE salary > (
SELECT COUNT(value) FROM orders AS ord
WHERE ord.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_09883 | train | T1 |
v1 | Schema:
transactions (alias: txn)(status, type, name, value)
shipments(status, salary, value, level)
Task: Find value from transactions where status appears in shipments entries with matching level.
SQL: | SELECT value FROM transactions AS txn
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_09884 | train | T1 |
v3 | Schema:
departments (alias: dept)(code, id, status, date)
products(name, id, status, value)
Task: Retrieve salary from departments with salary above the MIN(value) of products rows sharing the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE salary > (
SELECT MIN(value) FROM products AS prod
WHERE prod.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_09885 | train | T1 |
v1 | Schema:
staff (alias: empl)(status, amount, code, type)
categories(salary, date, code, status)
Task: Find id from staff where type appears in categories entries with matching code.
SQL: | SELECT id FROM staff AS empl
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_09886 | train | T2 |
v2 | Schema:
sales (alias: sale)(level, id, value, code)
items(salary, level, date, value)
Task: Retrieve value from sales that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_09887 | train | T1 |
v1 | Schema:
customers (alias: cust)(name, status, value, id)
schedules(date, level, status, amount)
Task: Retrieve code from customers whose type is found in schedules rows where type matches the outer record.
SQL: | SELECT code FROM customers AS cust
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_09888 | train | T1 |
v3 | Schema:
accounts (alias: acct)(amount, date, salary, level)
categories(name, status, salary, code)
Task: Find code from accounts where value exceeds the average amount from categories for the same status.
SQL: | SELECT code FROM accounts AS acct
WHERE value > (
SELECT AVG(amount) FROM categories AS catg
WHERE catg.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_09889 | train | T1 |
v2 | Schema:
orders (alias: ord)(code, amount, status, level)
shipments(code, status, name, level)
Task: Find salary from orders where a matching record exists in shipments with the same type.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_09890 | train | T1 |
v2 | Schema:
services (alias: srvc)(date, code, status, salary)
products(amount, value, date, type)
Task: Find value from services where a matching record exists in products with the same code.
SQL: | SELECT value FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "products",
"outer_alias": "srvc",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_09891 | train | T2 |
v2 | Schema:
schedules (alias: schd)(name, amount, id, level)
staff(value, status, code, date)
Task: Find salary from schedules where a matching record exists in staff with the same level.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_09892 | train | T2 |
v1 | Schema:
orders (alias: ord)(date, id, status, salary)
transactions(name, status, type, id)
Task: Retrieve code from orders whose level is found in transactions rows where level matches the outer record.
SQL: | SELECT code FROM orders AS ord
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_09893 | train | T1 |
v1 | Schema:
staff (alias: empl)(type, status, date, salary)
accounts(date, name, id, code)
Task: Find amount from staff where type appears in accounts entries with matching type.
SQL: | SELECT amount FROM staff AS empl
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_09894 | train | T2 |
v2 | Schema:
managers (alias: mgr)(level, type, value, salary)
transactions(status, date, id, value)
Task: Find name from managers where a matching record exists in transactions with the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_09895 | train | T1 |
v2 | Schema:
invoices (alias: inv)(name, id, level, type)
warehouses(date, code, id, name)
Task: Retrieve amount from invoices that have at least one corresponding entry in warehouses sharing the same status.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "warehouses",
"outer_alias": "inv",
"inner_alias": "whs",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_09896 | train | T1 |
v2 | Schema:
services (alias: srvc)(status, type, amount, id)
schedules(amount, salary, level, name)
Task: Retrieve value from services that have at least one corresponding entry in schedules sharing the same type.
SQL: | SELECT value FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "schedules",
"outer_alias": "srvc",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_09897 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(code, date, amount, name)
customers(level, status, type, id)
Task: Find value from warehouses where value exceeds the average amount from customers for the same level.
SQL: | SELECT value FROM warehouses AS whs
WHERE value > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "customers",
"outer_alias": "whs",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_09898 | train | T2 |
v2 | Schema:
managers (alias: mgr)(salary, name, id, date)
regions(type, id, status, salary)
Task: Retrieve code from managers that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_09899 | train | T1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.