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:
invoices (alias: inv)(id, name, status, value)
sales(level, amount, date, value)
Task: Find salary from invoices where amount exceeds the average value from sales for the same status.
SQL: | SELECT salary FROM invoices AS inv
WHERE amount > (
SELECT SUM(value) FROM sales AS sale
WHERE sale.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_11800 | train | T1 |
v1 | Schema:
items (alias: lne)(date, amount, salary, status)
departments(date, value, id, salary)
Task: Retrieve name from items whose id is found in departments rows where code matches the outer record.
SQL: | SELECT name FROM items AS lne
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.code = lne.code
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_11801 | train | T2 |
v2 | Schema:
transactions (alias: txn)(id, value, type, salary)
accounts(amount, level, id, salary)
Task: Retrieve code from transactions that have at least one corresponding entry in accounts sharing the same type.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_11802 | train | T1 |
v1 | Schema:
transactions (alias: txn)(type, name, date, value)
sales(amount, type, salary, name)
Task: Retrieve salary from transactions whose level is found in sales rows where type matches the outer record.
SQL: | SELECT salary FROM transactions AS txn
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_11803 | train | T1 |
v2 | Schema:
requests (alias: ordr)(name, type, id, amount)
staff(name, amount, type, value)
Task: Retrieve amount from requests that have at least one corresponding entry in staff sharing the same type.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_11804 | train | T2 |
v2 | Schema:
customers (alias: cust)(date, status, amount, level)
transactions(amount, status, id, date)
Task: Find id from customers where a matching record exists in transactions with the same level.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_11805 | train | T1 |
v2 | Schema:
invoices (alias: inv)(id, status, type, level)
shipments(amount, code, name, date)
Task: Find name from invoices where a matching record exists in shipments with the same id.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_11806 | train | T1 |
v2 | Schema:
customers (alias: cust)(status, level, type, name)
items(id, salary, type, amount)
Task: Find value from customers where a matching record exists in items with the same type.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_11807 | train | T1 |
v2 | Schema:
accounts (alias: acct)(type, date, amount, status)
transactions(salary, date, value, level)
Task: Find salary from accounts where a matching record exists in transactions with the same type.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_11808 | train | T1 |
v3 | Schema:
sales (alias: sale)(status, type, name, date)
staff(salary, status, amount, id)
Task: Find name from sales where salary exceeds the average amount from staff for the same type.
SQL: | SELECT name FROM sales AS sale
WHERE salary > (
SELECT COUNT(amount) FROM staff AS empl
WHERE empl.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_11809 | train | T1 |
v1 | Schema:
managers (alias: mgr)(type, value, level, salary)
warehouses(salary, amount, status, date)
Task: Select value from managers where status exists in warehouses for the same type.
SQL: | SELECT value FROM managers AS mgr
WHERE status IN (
SELECT status FROM warehouses AS whs
WHERE whs.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "warehouses",
"outer_alias": "mgr",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_11810 | train | T1 |
v2 | Schema:
employees (alias: emp)(amount, value, date, id)
schedules(name, value, amount, date)
Task: Retrieve amount from employees that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_11811 | train | T1 |
v2 | Schema:
items (alias: lne)(date, code, type, name)
budgets(date, type, name, level)
Task: Find code from items where a matching record exists in budgets with the same id.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.id = lne.id
); | {
"outer_table": "items",
"inner_table": "budgets",
"outer_alias": "lne",
"inner_alias": "budg",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_11812 | train | T2 |
v3 | Schema:
accounts (alias: acct)(name, date, salary, type)
products(id, status, name, level)
Task: Retrieve code from accounts with salary above the SUM(amount) of products rows sharing the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE salary > (
SELECT SUM(amount) FROM products AS prod
WHERE prod.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_11813 | train | T1 |
v2 | Schema:
categories (alias: catg)(status, name, date, type)
employees(id, level, code, value)
Task: Retrieve name from categories that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_11814 | train | T2 |
v1 | Schema:
employees (alias: emp)(date, value, amount, code)
managers(date, status, amount, name)
Task: Find code from employees where code appears in managers entries with matching level.
SQL: | SELECT code FROM employees AS emp
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_11815 | train | T1 |
v2 | Schema:
staff (alias: empl)(status, id, amount, type)
managers(level, date, salary, status)
Task: Retrieve name from staff that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_11816 | train | T2 |
v3 | Schema:
staff (alias: empl)(code, level, value, status)
orders(amount, type, name, salary)
Task: Retrieve salary from staff with salary above the AVG(amount) of orders rows sharing the same type.
SQL: | SELECT salary FROM staff AS empl
WHERE salary > (
SELECT AVG(amount) FROM orders AS ord
WHERE ord.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_11817 | train | T2 |
v2 | Schema:
orders (alias: ord)(amount, salary, id, name)
invoices(status, date, type, level)
Task: Find id from orders where a matching record exists in invoices with the same code.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_11818 | train | T1 |
v1 | Schema:
shipments (alias: shp)(level, value, date, code)
staff(salary, id, value, date)
Task: Retrieve salary from shipments whose level is found in staff rows where code matches the outer record.
SQL: | SELECT salary FROM shipments AS shp
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_11819 | train | T2 |
v3 | Schema:
services (alias: srvc)(amount, level, code, salary)
customers(level, type, salary, amount)
Task: Retrieve id from services with amount above the SUM(value) of customers rows sharing the same type.
SQL: | SELECT id FROM services AS srvc
WHERE amount > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "customers",
"outer_alias": "srvc",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_11820 | train | T2 |
v2 | Schema:
products (alias: prod)(code, name, value, id)
regions(salary, type, amount, value)
Task: Find value from products where a matching record exists in regions with the same level.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = prod.level
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_11821 | train | T1 |
v2 | Schema:
categories (alias: catg)(amount, value, type, code)
regions(salary, name, type, status)
Task: Retrieve value from categories that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_11822 | train | T2 |
v3 | Schema:
services (alias: srvc)(name, status, date, type)
invoices(id, value, status, date)
Task: Retrieve id from services with value above the SUM(value) of invoices rows sharing the same status.
SQL: | SELECT id FROM services AS srvc
WHERE value > (
SELECT SUM(value) FROM invoices AS inv
WHERE inv.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "invoices",
"outer_alias": "srvc",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_11823 | train | T2 |
v2 | Schema:
budgets (alias: budg)(status, amount, id, code)
requests(salary, date, code, amount)
Task: Retrieve amount from budgets that have at least one corresponding entry in requests sharing the same id.
SQL: | SELECT amount FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "requests",
"outer_alias": "budg",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_11824 | train | T2 |
v1 | Schema:
accounts (alias: acct)(amount, date, type, salary)
managers(amount, value, name, status)
Task: Select id from accounts where level exists in managers for the same level.
SQL: | SELECT id FROM accounts AS acct
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_11825 | train | T1 |
v1 | Schema:
budgets (alias: budg)(amount, status, code, name)
regions(amount, name, salary, value)
Task: Select value from budgets where status exists in regions for the same code.
SQL: | SELECT value FROM budgets AS budg
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "regions",
"outer_alias": "budg",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_11826 | train | T2 |
v3 | Schema:
transactions (alias: txn)(amount, salary, name, type)
accounts(level, amount, code, id)
Task: Retrieve amount from transactions with salary above the MAX(value) of accounts rows sharing the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE salary > (
SELECT MAX(value) FROM accounts AS acct
WHERE acct.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_11827 | train | T1 |
v3 | Schema:
items (alias: lne)(id, status, level, type)
regions(type, name, code, amount)
Task: Retrieve value from items with amount above the AVG(value) of regions rows sharing the same status.
SQL: | SELECT value FROM items AS lne
WHERE amount > (
SELECT AVG(value) FROM regions AS rgn
WHERE rgn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_11828 | train | T2 |
v3 | Schema:
orders (alias: ord)(amount, level, salary, type)
shipments(value, level, status, code)
Task: Retrieve value from orders with salary above the SUM(salary) of shipments rows sharing the same level.
SQL: | SELECT value FROM orders AS ord
WHERE salary > (
SELECT SUM(salary) FROM shipments AS shp
WHERE shp.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_11829 | train | T1 |
v3 | Schema:
items (alias: lne)(code, level, name, date)
services(level, id, salary, code)
Task: Retrieve salary from items with salary above the AVG(amount) of services rows sharing the same code.
SQL: | SELECT salary FROM items AS lne
WHERE salary > (
SELECT AVG(amount) FROM services AS srvc
WHERE srvc.code = lne.code
); | {
"outer_table": "items",
"inner_table": "services",
"outer_alias": "lne",
"inner_alias": "srvc",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_11830 | train | T2 |
v1 | Schema:
departments (alias: dept)(name, amount, value, level)
categories(name, salary, level, id)
Task: Find salary from departments where type appears in categories entries with matching id.
SQL: | SELECT salary FROM departments AS dept
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_11831 | train | T1 |
v2 | Schema:
services (alias: srvc)(status, level, salary, name)
employees(type, level, value, status)
Task: Find name from services where a matching record exists in employees with the same level.
SQL: | SELECT name FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "employees",
"outer_alias": "srvc",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_11832 | train | T2 |
v3 | Schema:
services (alias: srvc)(date, amount, value, code)
transactions(name, level, id, type)
Task: Retrieve code from services with salary above the SUM(value) of transactions rows sharing the same id.
SQL: | SELECT code FROM services AS srvc
WHERE salary > (
SELECT SUM(value) FROM transactions AS txn
WHERE txn.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "transactions",
"outer_alias": "srvc",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_11833 | train | T2 |
v1 | Schema:
employees (alias: emp)(date, status, amount, type)
orders(amount, type, status, id)
Task: Retrieve salary from employees whose level is found in orders rows where status matches the outer record.
SQL: | SELECT salary FROM employees AS emp
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_11834 | train | T1 |
v2 | Schema:
regions (alias: rgn)(type, amount, code, name)
categories(type, salary, amount, date)
Task: Retrieve name from regions that have at least one corresponding entry in categories sharing the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_11835 | train | T2 |
v1 | Schema:
orders (alias: ord)(value, salary, code, status)
categories(status, level, date, name)
Task: Select code from orders where type exists in categories for the same level.
SQL: | SELECT code FROM orders AS ord
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_11836 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(name, value, amount, code)
orders(name, salary, value, id)
Task: Retrieve id from warehouses with value above the SUM(amount) of orders rows sharing the same level.
SQL: | SELECT id FROM warehouses AS whs
WHERE value > (
SELECT SUM(amount) FROM orders AS ord
WHERE ord.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "orders",
"outer_alias": "whs",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_11837 | train | T2 |
v1 | Schema:
accounts (alias: acct)(date, status, amount, level)
schedules(value, type, code, salary)
Task: Retrieve amount from accounts whose type is found in schedules rows where code matches the outer record.
SQL: | SELECT amount FROM accounts AS acct
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_11838 | train | T1 |
v1 | Schema:
managers (alias: mgr)(level, date, value, name)
requests(level, amount, name, id)
Task: Select amount from managers where id exists in requests for the same level.
SQL: | SELECT amount FROM managers AS mgr
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_11839 | train | T1 |
v1 | Schema:
sales (alias: sale)(amount, level, date, id)
products(date, type, code, amount)
Task: Retrieve amount from sales whose level is found in products rows where type matches the outer record.
SQL: | SELECT amount FROM sales AS sale
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_11840 | train | T1 |
v2 | Schema:
budgets (alias: budg)(level, date, status, type)
customers(type, level, salary, id)
Task: Retrieve id from budgets that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT id FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "customers",
"outer_alias": "budg",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_11841 | train | T2 |
v1 | Schema:
departments (alias: dept)(level, status, salary, date)
staff(amount, salary, status, code)
Task: Find amount from departments where level appears in staff entries with matching type.
SQL: | SELECT amount FROM departments AS dept
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_11842 | train | T1 |
v2 | Schema:
staff (alias: empl)(level, date, status, amount)
shipments(value, level, date, amount)
Task: Find salary from staff where a matching record exists in shipments with the same id.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_11843 | train | T2 |
v2 | Schema:
schedules (alias: schd)(date, salary, status, type)
services(date, level, status, salary)
Task: Retrieve salary from schedules that have at least one corresponding entry in services sharing the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "services",
"outer_alias": "schd",
"inner_alias": "srvc",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_11844 | train | T2 |
v1 | Schema:
managers (alias: mgr)(value, name, type, salary)
customers(code, salary, name, id)
Task: Select code from managers where id exists in customers for the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_11845 | train | T1 |
v3 | Schema:
services (alias: srvc)(status, amount, name, value)
accounts(id, amount, type, status)
Task: Retrieve name from services with value above the MIN(salary) of accounts rows sharing the same status.
SQL: | SELECT name FROM services AS srvc
WHERE value > (
SELECT MIN(salary) FROM accounts AS acct
WHERE acct.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "accounts",
"outer_alias": "srvc",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_11846 | train | T2 |
v2 | Schema:
schedules (alias: schd)(name, code, date, value)
items(name, code, level, amount)
Task: Find name from schedules where a matching record exists in items with the same id.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_11847 | train | T2 |
v1 | Schema:
employees (alias: emp)(value, status, code, type)
items(id, value, salary, name)
Task: Retrieve value from employees whose id is found in items rows where status matches the outer record.
SQL: | SELECT value FROM employees AS emp
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_11848 | train | T1 |
v1 | Schema:
requests (alias: ordr)(status, id, level, amount)
regions(id, date, name, value)
Task: Retrieve value from requests whose id is found in regions rows where id matches the outer record.
SQL: | SELECT value FROM requests AS ordr
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_11849 | train | T2 |
v3 | Schema:
customers (alias: cust)(value, amount, level, type)
regions(value, code, date, type)
Task: Retrieve salary from customers with amount above the SUM(amount) of regions rows sharing the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE amount > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_11850 | train | T1 |
v2 | Schema:
staff (alias: empl)(level, value, amount, status)
invoices(status, level, date, salary)
Task: Find value from staff where a matching record exists in invoices with the same id.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_11851 | train | T2 |
v3 | Schema:
regions (alias: rgn)(code, amount, date, value)
schedules(code, date, level, type)
Task: Find amount from regions where salary exceeds the average value from schedules for the same status.
SQL: | SELECT amount FROM regions AS rgn
WHERE salary > (
SELECT MAX(value) FROM schedules AS schd
WHERE schd.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_11852 | train | T2 |
v1 | Schema:
categories (alias: catg)(salary, type, level, id)
warehouses(id, value, level, name)
Task: Find code from categories where level appears in warehouses entries with matching status.
SQL: | SELECT code FROM categories AS catg
WHERE level IN (
SELECT level FROM warehouses AS whs
WHERE whs.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "warehouses",
"outer_alias": "catg",
"inner_alias": "whs",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_11853 | train | T2 |
v2 | Schema:
shipments (alias: shp)(value, type, salary, code)
invoices(level, status, name, date)
Task: Find code from shipments where a matching record exists in invoices with the same id.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_11854 | train | T2 |
v2 | Schema:
shipments (alias: shp)(status, level, date, type)
staff(code, status, type, name)
Task: Retrieve amount from shipments that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_11855 | train | T2 |
v3 | Schema:
invoices (alias: inv)(salary, level, amount, name)
categories(level, status, type, code)
Task: Retrieve value from invoices with value above the COUNT(amount) of categories rows sharing the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE value > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_11856 | train | T1 |
v1 | Schema:
categories (alias: catg)(date, value, status, type)
products(status, code, date, amount)
Task: Find name from categories where code appears in products entries with matching id.
SQL: | SELECT name FROM categories AS catg
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_11857 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(amount, date, id, value)
staff(date, amount, code, level)
Task: Retrieve salary from warehouses that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT salary FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "staff",
"outer_alias": "whs",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_11858 | train | T2 |
v2 | Schema:
schedules (alias: schd)(status, name, date, type)
accounts(status, name, level, salary)
Task: Find code from schedules where a matching record exists in accounts with the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_11859 | train | T2 |
v2 | Schema:
orders (alias: ord)(salary, name, status, value)
categories(value, id, name, amount)
Task: Retrieve name from orders that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_11860 | train | T1 |
v1 | Schema:
budgets (alias: budg)(code, status, type, amount)
items(type, code, name, value)
Task: Find code from budgets where id appears in items entries with matching level.
SQL: | SELECT code FROM budgets AS budg
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "items",
"outer_alias": "budg",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_11861 | train | T2 |
v1 | Schema:
orders (alias: ord)(type, value, salary, date)
schedules(date, salary, type, status)
Task: Retrieve id from orders whose status is found in schedules rows where type matches the outer record.
SQL: | SELECT id FROM orders AS ord
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_11862 | train | T1 |
v3 | Schema:
transactions (alias: txn)(salary, status, name, date)
invoices(id, status, value, type)
Task: Retrieve amount from transactions with amount above the SUM(value) of invoices rows sharing the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE amount > (
SELECT SUM(value) FROM invoices AS inv
WHERE inv.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_11863 | train | T1 |
v1 | Schema:
invoices (alias: inv)(amount, value, type, name)
regions(status, amount, type, code)
Task: Retrieve id from invoices whose type is found in regions rows where code matches the outer record.
SQL: | SELECT id FROM invoices AS inv
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_11864 | train | T1 |
v2 | Schema:
transactions (alias: txn)(value, code, date, status)
staff(type, value, code, level)
Task: Retrieve id from transactions that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_11865 | train | T1 |
v2 | Schema:
items (alias: lne)(amount, level, code, status)
regions(type, amount, level, salary)
Task: Retrieve code from items that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = lne.type
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_11866 | train | T2 |
v3 | Schema:
items (alias: lne)(id, amount, value, type)
sales(status, type, value, amount)
Task: Retrieve amount from items with amount above the MAX(salary) of sales rows sharing the same code.
SQL: | SELECT amount FROM items AS lne
WHERE amount > (
SELECT MAX(salary) FROM sales AS sale
WHERE sale.code = lne.code
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_11867 | train | T2 |
v3 | Schema:
managers (alias: mgr)(value, salary, name, code)
shipments(name, salary, amount, id)
Task: Find amount from managers where salary exceeds the average value from shipments for the same id.
SQL: | SELECT amount FROM managers AS mgr
WHERE salary > (
SELECT MIN(value) FROM shipments AS shp
WHERE shp.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_11868 | train | T1 |
v3 | Schema:
products (alias: prod)(code, name, amount, salary)
customers(date, name, type, amount)
Task: Find code from products where amount exceeds the average value from customers for the same level.
SQL: | SELECT code FROM products AS prod
WHERE amount > (
SELECT MIN(value) FROM customers AS cust
WHERE cust.level = prod.level
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_11869 | train | T1 |
v3 | Schema:
sales (alias: sale)(type, name, value, status)
staff(name, code, value, date)
Task: Retrieve value from sales with value above the SUM(amount) of staff rows sharing the same code.
SQL: | SELECT value FROM sales AS sale
WHERE value > (
SELECT SUM(amount) FROM staff AS empl
WHERE empl.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_11870 | train | T1 |
v3 | Schema:
shipments (alias: shp)(id, amount, name, salary)
services(id, level, name, salary)
Task: Retrieve name from shipments with amount above the AVG(salary) of services rows sharing the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE amount > (
SELECT AVG(salary) FROM services AS srvc
WHERE srvc.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "services",
"outer_alias": "shp",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_11871 | train | T2 |
v3 | Schema:
requests (alias: ordr)(name, code, value, id)
managers(name, status, level, amount)
Task: Retrieve salary from requests with value above the AVG(salary) of managers rows sharing the same code.
SQL: | SELECT salary FROM requests AS ordr
WHERE value > (
SELECT AVG(salary) FROM managers AS mgr
WHERE mgr.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_11872 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(code, name, date, type)
schedules(date, level, amount, id)
Task: Retrieve salary from warehouses with amount above the SUM(salary) of schedules rows sharing the same id.
SQL: | SELECT salary FROM warehouses AS whs
WHERE amount > (
SELECT SUM(salary) FROM schedules AS schd
WHERE schd.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "schedules",
"outer_alias": "whs",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_11873 | train | T2 |
v3 | Schema:
requests (alias: ordr)(value, amount, code, level)
products(amount, level, status, name)
Task: Find id from requests where amount exceeds the average amount from products for the same status.
SQL: | SELECT id FROM requests AS ordr
WHERE amount > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_11874 | train | T2 |
v1 | Schema:
departments (alias: dept)(level, code, amount, name)
employees(name, date, status, id)
Task: Find code from departments where id appears in employees entries with matching status.
SQL: | SELECT code FROM departments AS dept
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_11875 | train | T1 |
v3 | Schema:
staff (alias: empl)(level, status, type, name)
categories(date, name, level, id)
Task: Retrieve salary from staff with value above the AVG(value) of categories rows sharing the same status.
SQL: | SELECT salary FROM staff AS empl
WHERE value > (
SELECT AVG(value) FROM categories AS catg
WHERE catg.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_11876 | train | T2 |
v1 | Schema:
requests (alias: ordr)(amount, name, type, salary)
customers(type, value, code, salary)
Task: Find name from requests where type appears in customers entries with matching code.
SQL: | SELECT name FROM requests AS ordr
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_11877 | train | T2 |
v3 | Schema:
customers (alias: cust)(amount, status, value, type)
staff(type, value, id, level)
Task: Find salary from customers where amount exceeds the average amount from staff for the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE amount > (
SELECT SUM(amount) FROM staff AS empl
WHERE empl.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_11878 | train | T1 |
v3 | Schema:
managers (alias: mgr)(status, salary, level, name)
employees(type, id, status, name)
Task: Find name from managers where amount exceeds the average value from employees for the same type.
SQL: | SELECT name FROM managers AS mgr
WHERE amount > (
SELECT COUNT(value) FROM employees AS emp
WHERE emp.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_11879 | train | T1 |
v1 | Schema:
departments (alias: dept)(code, level, salary, name)
accounts(amount, date, salary, name)
Task: Select id from departments where type exists in accounts for the same id.
SQL: | SELECT id FROM departments AS dept
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_11880 | train | T1 |
v3 | Schema:
managers (alias: mgr)(code, date, level, amount)
orders(amount, salary, type, date)
Task: Retrieve code from managers with salary above the SUM(value) of orders rows sharing the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE salary > (
SELECT SUM(value) FROM orders AS ord
WHERE ord.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_11881 | train | T1 |
v2 | Schema:
regions (alias: rgn)(value, salary, type, status)
categories(salary, value, status, id)
Task: Retrieve amount from regions that have at least one corresponding entry in categories sharing the same level.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_11882 | train | T2 |
v2 | Schema:
budgets (alias: budg)(status, amount, value, id)
products(value, level, name, status)
Task: Find salary from budgets where a matching record exists in products with the same type.
SQL: | SELECT salary FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "products",
"outer_alias": "budg",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_11883 | train | T2 |
v3 | Schema:
shipments (alias: shp)(status, amount, level, type)
staff(id, code, salary, value)
Task: Retrieve code from shipments with amount above the SUM(salary) of staff rows sharing the same level.
SQL: | SELECT code FROM shipments AS shp
WHERE amount > (
SELECT SUM(salary) FROM staff AS empl
WHERE empl.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_11884 | train | T2 |
v2 | Schema:
items (alias: lne)(name, level, amount, salary)
sales(id, salary, code, date)
Task: Retrieve amount from items that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = lne.level
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_11885 | train | T2 |
v3 | Schema:
budgets (alias: budg)(level, amount, code, status)
regions(id, amount, status, type)
Task: Retrieve name from budgets with value above the SUM(salary) of regions rows sharing the same level.
SQL: | SELECT name FROM budgets AS budg
WHERE value > (
SELECT SUM(salary) FROM regions AS rgn
WHERE rgn.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "regions",
"outer_alias": "budg",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_11886 | train | T2 |
v3 | Schema:
products (alias: prod)(type, code, date, salary)
departments(salary, level, date, status)
Task: Find code from products where amount exceeds the average salary from departments for the same type.
SQL: | SELECT code FROM products AS prod
WHERE amount > (
SELECT SUM(salary) FROM departments AS dept
WHERE dept.type = prod.type
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_11887 | train | T1 |
v2 | Schema:
accounts (alias: acct)(salary, value, id, type)
transactions(name, date, status, salary)
Task: Find salary from accounts where a matching record exists in transactions with the same code.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_11888 | train | T1 |
v2 | Schema:
services (alias: srvc)(level, id, amount, value)
employees(salary, date, id, level)
Task: Retrieve name from services that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT name FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "employees",
"outer_alias": "srvc",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_11889 | train | T2 |
v2 | Schema:
requests (alias: ordr)(level, date, amount, status)
invoices(status, code, level, salary)
Task: Find name from requests where a matching record exists in invoices with the same type.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_11890 | train | T2 |
v3 | Schema:
products (alias: prod)(code, amount, date, name)
accounts(amount, level, salary, name)
Task: Retrieve value from products with value above the AVG(amount) of accounts rows sharing the same id.
SQL: | SELECT value FROM products AS prod
WHERE value > (
SELECT AVG(amount) FROM accounts AS acct
WHERE acct.id = prod.id
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_11891 | train | T1 |
v3 | Schema:
invoices (alias: inv)(code, value, salary, status)
requests(level, status, amount, id)
Task: Retrieve name from invoices with amount above the AVG(salary) of requests rows sharing the same code.
SQL: | SELECT name FROM invoices AS inv
WHERE amount > (
SELECT AVG(salary) FROM requests AS ordr
WHERE ordr.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_11892 | train | T1 |
v1 | Schema:
departments (alias: dept)(amount, status, name, type)
regions(salary, id, code, amount)
Task: Retrieve id from departments whose code is found in regions rows where id matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_11893 | train | T1 |
v3 | Schema:
shipments (alias: shp)(level, code, name, date)
warehouses(code, status, level, value)
Task: Retrieve name from shipments with salary above the AVG(salary) of warehouses rows sharing the same level.
SQL: | SELECT name FROM shipments AS shp
WHERE salary > (
SELECT AVG(salary) FROM warehouses AS whs
WHERE whs.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "warehouses",
"outer_alias": "shp",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_11894 | train | T2 |
v2 | Schema:
accounts (alias: acct)(code, amount, value, status)
sales(code, status, level, name)
Task: Retrieve id from accounts that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_11895 | train | T1 |
v3 | Schema:
employees (alias: emp)(type, value, id, code)
requests(type, date, amount, id)
Task: Find amount from employees where salary exceeds the average amount from requests for the same type.
SQL: | SELECT amount FROM employees AS emp
WHERE salary > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_11896 | train | T1 |
v1 | Schema:
customers (alias: cust)(name, date, status, amount)
budgets(name, amount, type, level)
Task: Find id from customers where type appears in budgets entries with matching code.
SQL: | SELECT id FROM customers AS cust
WHERE type IN (
SELECT type FROM budgets AS budg
WHERE budg.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "budgets",
"outer_alias": "cust",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_11897 | train | T1 |
v2 | Schema:
invoices (alias: inv)(value, name, date, status)
employees(name, date, level, value)
Task: Find code from invoices where a matching record exists in employees with the same level.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_11898 | train | T1 |
v3 | Schema:
accounts (alias: acct)(code, salary, name, amount)
warehouses(code, id, status, date)
Task: Find id from accounts where salary exceeds the average amount from warehouses for the same code.
SQL: | SELECT id FROM accounts AS acct
WHERE salary > (
SELECT COUNT(amount) FROM warehouses AS whs
WHERE whs.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "warehouses",
"outer_alias": "acct",
"inner_alias": "whs",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_11899 | train | T1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.