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:
departments (alias: dept)(value, date, id, status)
transactions(status, code, type, value)
Task: Find id from departments where amount exceeds the average salary from transactions for the same id.
SQL: | SELECT id FROM departments AS dept
WHERE amount > (
SELECT MIN(salary) FROM transactions AS txn
WHERE txn.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_03400 | train | T1 |
v3 | Schema:
categories (alias: catg)(id, value, date, code)
customers(amount, level, salary, date)
Task: Find code from categories where amount exceeds the average amount from customers for the same id.
SQL: | SELECT code FROM categories AS catg
WHERE amount > (
SELECT SUM(amount) FROM customers AS cust
WHERE cust.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_03401 | train | T2 |
v1 | Schema:
categories (alias: catg)(date, level, code, value)
requests(date, code, level, value)
Task: Retrieve amount from categories whose id is found in requests rows where level matches the outer record.
SQL: | SELECT amount FROM categories AS catg
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_03402 | train | T2 |
v3 | Schema:
customers (alias: cust)(status, amount, date, salary)
sales(salary, status, amount, id)
Task: Retrieve salary from customers with salary above the AVG(amount) of sales rows sharing the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE salary > (
SELECT AVG(amount) FROM sales AS sale
WHERE sale.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_03403 | train | T1 |
v3 | Schema:
accounts (alias: acct)(date, status, code, name)
sales(status, id, code, amount)
Task: Retrieve id from accounts with value above the MAX(salary) of sales rows sharing the same id.
SQL: | SELECT id FROM accounts AS acct
WHERE value > (
SELECT MAX(salary) FROM sales AS sale
WHERE sale.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_03404 | train | T1 |
v1 | Schema:
budgets (alias: budg)(amount, id, name, level)
departments(value, status, id, salary)
Task: Select name from budgets where level exists in departments for the same level.
SQL: | SELECT name FROM budgets AS budg
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "departments",
"outer_alias": "budg",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_03405 | train | T2 |
v2 | Schema:
shipments (alias: shp)(salary, name, status, value)
warehouses(salary, code, status, date)
Task: Find id from shipments where a matching record exists in warehouses with the same status.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "warehouses",
"outer_alias": "shp",
"inner_alias": "whs",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_03406 | train | T2 |
v3 | Schema:
categories (alias: catg)(level, amount, salary, type)
items(value, amount, name, status)
Task: Retrieve id from categories with salary above the SUM(value) of items rows sharing the same level.
SQL: | SELECT id FROM categories AS catg
WHERE salary > (
SELECT SUM(value) FROM items AS lne
WHERE lne.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_03407 | train | T2 |
v1 | Schema:
services (alias: srvc)(name, value, date, code)
managers(amount, date, id, type)
Task: Select id from services where status exists in managers for the same type.
SQL: | SELECT id FROM services AS srvc
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "managers",
"outer_alias": "srvc",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_03408 | train | T2 |
v3 | Schema:
budgets (alias: budg)(type, name, code, id)
invoices(type, id, code, status)
Task: Find value from budgets where value exceeds the average amount from invoices for the same status.
SQL: | SELECT value FROM budgets AS budg
WHERE value > (
SELECT AVG(amount) FROM invoices AS inv
WHERE inv.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "invoices",
"outer_alias": "budg",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_03409 | train | T2 |
v2 | Schema:
departments (alias: dept)(status, date, salary, name)
transactions(status, salary, type, date)
Task: Find salary from departments where a matching record exists in transactions with the same code.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_03410 | train | T1 |
v3 | Schema:
products (alias: prod)(amount, status, level, value)
customers(code, amount, value, name)
Task: Find salary from products where salary exceeds the average value from customers for the same type.
SQL: | SELECT salary FROM products AS prod
WHERE salary > (
SELECT MIN(value) FROM customers AS cust
WHERE cust.type = prod.type
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_03411 | train | T1 |
v2 | Schema:
regions (alias: rgn)(date, status, value, name)
managers(id, code, salary, type)
Task: Find value from regions where a matching record exists in managers with the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_03412 | train | T2 |
v2 | Schema:
products (alias: prod)(code, status, level, name)
sales(type, id, code, value)
Task: Find id from products where a matching record exists in sales with the same level.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = prod.level
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_03413 | train | T1 |
v1 | Schema:
requests (alias: ordr)(value, name, amount, id)
accounts(salary, status, amount, date)
Task: Retrieve value from requests whose level is found in accounts rows where level matches the outer record.
SQL: | SELECT value FROM requests AS ordr
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_03414 | train | T2 |
v3 | Schema:
categories (alias: catg)(date, value, name, salary)
items(type, amount, code, id)
Task: Find code from categories where amount exceeds the average value from items for the same status.
SQL: | SELECT code FROM categories AS catg
WHERE amount > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_03415 | train | T2 |
v3 | Schema:
services (alias: srvc)(date, amount, salary, code)
products(type, code, amount, value)
Task: Retrieve amount from services with amount above the SUM(amount) of products rows sharing the same id.
SQL: | SELECT amount FROM services AS srvc
WHERE amount > (
SELECT SUM(amount) FROM products AS prod
WHERE prod.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "products",
"outer_alias": "srvc",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_03416 | train | T2 |
v1 | Schema:
regions (alias: rgn)(code, id, level, date)
staff(type, salary, status, value)
Task: Select value from regions where id exists in staff for the same level.
SQL: | SELECT value FROM regions AS rgn
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_03417 | train | T2 |
v2 | Schema:
customers (alias: cust)(name, salary, level, code)
warehouses(date, level, name, amount)
Task: Find id from customers where a matching record exists in warehouses with the same code.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "warehouses",
"outer_alias": "cust",
"inner_alias": "whs",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_03418 | train | T1 |
v3 | Schema:
transactions (alias: txn)(name, type, code, salary)
products(id, value, date, salary)
Task: Retrieve salary from transactions with amount above the SUM(salary) of products rows sharing the same level.
SQL: | SELECT salary FROM transactions AS txn
WHERE amount > (
SELECT SUM(salary) FROM products AS prod
WHERE prod.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_03419 | train | T1 |
v2 | Schema:
schedules (alias: schd)(name, amount, date, status)
customers(code, level, name, amount)
Task: Find salary from schedules where a matching record exists in customers with the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_03420 | train | T2 |
v2 | Schema:
managers (alias: mgr)(id, code, value, type)
products(amount, type, value, salary)
Task: Retrieve salary from managers that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_03421 | train | T1 |
v3 | Schema:
sales (alias: sale)(name, code, type, date)
requests(status, id, name, level)
Task: Find amount from sales where amount exceeds the average amount from requests for the same code.
SQL: | SELECT amount FROM sales AS sale
WHERE amount > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_03422 | train | T1 |
v3 | Schema:
departments (alias: dept)(amount, name, code, status)
employees(value, type, id, salary)
Task: Retrieve code from departments with value above the SUM(salary) of employees rows sharing the same status.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT SUM(salary) 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": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_03423 | train | T1 |
v2 | Schema:
sales (alias: sale)(date, status, name, value)
accounts(date, name, level, id)
Task: Find value from sales where a matching record exists in accounts with the same code.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_03424 | train | T1 |
v3 | Schema:
regions (alias: rgn)(type, salary, status, value)
customers(level, date, type, name)
Task: Find amount from regions where salary exceeds the average amount from customers for the same level.
SQL: | SELECT amount FROM regions AS rgn
WHERE salary > (
SELECT MAX(amount) FROM customers AS cust
WHERE cust.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_03425 | train | T2 |
v1 | Schema:
transactions (alias: txn)(date, salary, id, code)
warehouses(salary, level, amount, name)
Task: Find id from transactions where level appears in warehouses entries with matching id.
SQL: | SELECT id FROM transactions AS txn
WHERE level IN (
SELECT level FROM warehouses AS whs
WHERE whs.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "warehouses",
"outer_alias": "txn",
"inner_alias": "whs",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_03426 | train | T1 |
v1 | Schema:
orders (alias: ord)(value, date, name, status)
requests(level, date, salary, type)
Task: Retrieve value from orders whose id is found in requests rows where code matches the outer record.
SQL: | SELECT value FROM orders AS ord
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_03427 | train | T1 |
v2 | Schema:
employees (alias: emp)(id, value, name, level)
services(level, amount, id, type)
Task: Find name from employees where a matching record exists in services with the same type.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "services",
"outer_alias": "emp",
"inner_alias": "srvc",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_03428 | train | T1 |
v2 | Schema:
sales (alias: sale)(amount, level, date, salary)
orders(type, id, salary, level)
Task: Find salary from sales where a matching record exists in orders with the same level.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_03429 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(name, amount, value, type)
transactions(salary, value, amount, id)
Task: Find amount from warehouses where level appears in transactions entries with matching code.
SQL: | SELECT amount FROM warehouses AS whs
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "transactions",
"outer_alias": "whs",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_03430 | train | T2 |
v2 | Schema:
regions (alias: rgn)(level, code, type, status)
services(code, level, amount, salary)
Task: Find code from regions where a matching record exists in services with the same status.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "services",
"outer_alias": "rgn",
"inner_alias": "srvc",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_03431 | train | T2 |
v3 | Schema:
sales (alias: sale)(name, type, salary, status)
employees(name, status, level, id)
Task: Retrieve amount from sales with amount above the AVG(value) of employees rows sharing the same id.
SQL: | SELECT amount FROM sales AS sale
WHERE amount > (
SELECT AVG(value) FROM employees AS emp
WHERE emp.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_03432 | train | T1 |
v1 | Schema:
orders (alias: ord)(value, status, amount, id)
accounts(amount, level, code, type)
Task: Select salary from orders where id exists in accounts for the same code.
SQL: | SELECT salary FROM orders AS ord
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_03433 | train | T1 |
v3 | Schema:
categories (alias: catg)(status, code, type, id)
items(name, salary, status, level)
Task: Find name from categories where value exceeds the average value from items for the same level.
SQL: | SELECT name FROM categories AS catg
WHERE value > (
SELECT MAX(value) FROM items AS lne
WHERE lne.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_03434 | train | T2 |
v2 | Schema:
services (alias: srvc)(code, salary, level, type)
schedules(type, value, id, status)
Task: Retrieve code from services that have at least one corresponding entry in schedules sharing the same type.
SQL: | SELECT code 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": "code",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_03435 | train | T2 |
v2 | Schema:
staff (alias: empl)(amount, status, level, date)
orders(amount, code, name, type)
Task: Retrieve code from staff that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_03436 | train | T2 |
v2 | Schema:
services (alias: srvc)(status, value, id, level)
shipments(code, status, salary, id)
Task: Retrieve code from services that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT code FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "shipments",
"outer_alias": "srvc",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_03437 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(code, amount, status, date)
accounts(type, code, id, value)
Task: Find salary from warehouses where a matching record exists in accounts with the same id.
SQL: | SELECT salary FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "accounts",
"outer_alias": "whs",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_03438 | train | T2 |
v3 | Schema:
departments (alias: dept)(status, value, level, date)
invoices(value, amount, level, type)
Task: Retrieve code from departments with value above the AVG(salary) of invoices rows sharing the same level.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT AVG(salary) FROM invoices AS inv
WHERE inv.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "invoices",
"outer_alias": "dept",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_03439 | train | T1 |
v1 | Schema:
regions (alias: rgn)(date, name, salary, amount)
schedules(value, name, amount, status)
Task: Retrieve code from regions whose type is found in schedules rows where level matches the outer record.
SQL: | SELECT code FROM regions AS rgn
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_03440 | train | T2 |
v1 | Schema:
services (alias: srvc)(status, id, level, name)
regions(amount, status, type, name)
Task: Find value from services where status appears in regions entries with matching type.
SQL: | SELECT value FROM services AS srvc
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "regions",
"outer_alias": "srvc",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_03441 | train | T2 |
v2 | Schema:
sales (alias: sale)(amount, date, value, level)
budgets(level, value, salary, date)
Task: Find name from sales where a matching record exists in budgets with the same code.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "budgets",
"outer_alias": "sale",
"inner_alias": "budg",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_03442 | train | T1 |
v3 | Schema:
staff (alias: empl)(status, level, name, amount)
categories(salary, type, status, level)
Task: Find code from staff where salary exceeds the average value from categories for the same id.
SQL: | SELECT code FROM staff AS empl
WHERE salary > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_03443 | train | T2 |
v3 | Schema:
sales (alias: sale)(salary, status, value, type)
invoices(id, name, code, date)
Task: Find amount from sales where amount exceeds the average salary from invoices for the same code.
SQL: | SELECT amount FROM sales AS sale
WHERE amount > (
SELECT AVG(salary) FROM invoices AS inv
WHERE inv.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_03444 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(name, salary, code, value)
departments(level, type, status, value)
Task: Retrieve amount from warehouses with value above the COUNT(value) of departments rows sharing the same id.
SQL: | SELECT amount FROM warehouses AS whs
WHERE value > (
SELECT COUNT(value) FROM departments AS dept
WHERE dept.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "departments",
"outer_alias": "whs",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_03445 | train | T2 |
v2 | Schema:
products (alias: prod)(salary, type, date, status)
employees(name, level, id, type)
Task: Retrieve id from products that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = prod.status
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_03446 | train | T1 |
v2 | Schema:
orders (alias: ord)(amount, name, level, code)
managers(type, salary, date, amount)
Task: Retrieve id from orders that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_03447 | train | T1 |
v3 | Schema:
services (alias: srvc)(name, value, id, date)
items(level, name, type, value)
Task: Find code from services where salary exceeds the average amount from items for the same status.
SQL: | SELECT code FROM services AS srvc
WHERE salary > (
SELECT COUNT(amount) FROM items AS lne
WHERE lne.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "items",
"outer_alias": "srvc",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_03448 | train | T2 |
v2 | Schema:
invoices (alias: inv)(id, value, type, status)
employees(value, name, level, salary)
Task: Find amount from invoices where a matching record exists in employees with the same status.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_03449 | train | T1 |
v1 | Schema:
departments (alias: dept)(date, level, id, value)
products(salary, value, type, level)
Task: Find value from departments where id appears in products entries with matching id.
SQL: | SELECT value FROM departments AS dept
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_03450 | train | T1 |
v2 | Schema:
transactions (alias: txn)(level, code, id, type)
orders(value, id, amount, date)
Task: Find salary from transactions where a matching record exists in orders with the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_03451 | train | T1 |
v1 | Schema:
staff (alias: empl)(id, status, salary, type)
warehouses(value, status, id, type)
Task: Select id from staff where level exists in warehouses for the same id.
SQL: | SELECT id FROM staff AS empl
WHERE level IN (
SELECT level FROM warehouses AS whs
WHERE whs.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "warehouses",
"outer_alias": "empl",
"inner_alias": "whs",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_03452 | train | T2 |
v1 | Schema:
orders (alias: ord)(salary, id, code, type)
products(date, amount, status, value)
Task: Retrieve name from orders whose level is found in products rows where type matches the outer record.
SQL: | SELECT name FROM orders AS ord
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_03453 | train | T1 |
v1 | Schema:
invoices (alias: inv)(name, salary, status, value)
warehouses(status, value, date, level)
Task: Retrieve salary from invoices whose status is found in warehouses rows where level matches the outer record.
SQL: | SELECT salary FROM invoices AS inv
WHERE status IN (
SELECT status FROM warehouses AS whs
WHERE whs.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "warehouses",
"outer_alias": "inv",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_03454 | train | T1 |
v1 | Schema:
transactions (alias: txn)(level, date, type, code)
schedules(status, amount, level, id)
Task: Select value from transactions where status exists in schedules for the same code.
SQL: | SELECT value FROM transactions AS txn
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_03455 | train | T1 |
v3 | Schema:
staff (alias: empl)(amount, status, type, date)
sales(id, name, amount, date)
Task: Find amount from staff where amount exceeds the average value from sales for the same level.
SQL: | SELECT amount FROM staff AS empl
WHERE amount > (
SELECT MIN(value) FROM sales AS sale
WHERE sale.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_03456 | train | T2 |
v3 | Schema:
services (alias: srvc)(type, status, level, salary)
schedules(value, amount, type, id)
Task: Find name from services where value exceeds the average salary from schedules for the same id.
SQL: | SELECT name FROM services AS srvc
WHERE value > (
SELECT COUNT(salary) FROM schedules AS schd
WHERE schd.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "schedules",
"outer_alias": "srvc",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_03457 | train | T2 |
v1 | Schema:
accounts (alias: acct)(date, value, salary, amount)
departments(value, amount, status, salary)
Task: Retrieve name from accounts whose status is found in departments rows where type matches the outer record.
SQL: | SELECT name FROM accounts AS acct
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_03458 | train | T1 |
v3 | Schema:
accounts (alias: acct)(amount, type, salary, value)
schedules(value, level, status, amount)
Task: Retrieve amount from accounts with value above the COUNT(amount) of schedules rows sharing the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE value > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_03459 | train | T1 |
v2 | Schema:
categories (alias: catg)(status, id, amount, salary)
regions(amount, type, value, id)
Task: Find id from categories where a matching record exists in regions with the same code.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_03460 | train | T2 |
v3 | Schema:
shipments (alias: shp)(amount, date, code, id)
sales(type, code, salary, status)
Task: Retrieve salary from shipments with value above the COUNT(amount) of sales rows sharing the same status.
SQL: | SELECT salary FROM shipments AS shp
WHERE value > (
SELECT COUNT(amount) FROM sales AS sale
WHERE sale.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_03461 | train | T2 |
v1 | Schema:
accounts (alias: acct)(id, value, salary, name)
transactions(amount, name, value, level)
Task: Retrieve value from accounts whose status is found in transactions rows where code matches the outer record.
SQL: | SELECT value FROM accounts AS acct
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_03462 | train | T1 |
v2 | Schema:
orders (alias: ord)(date, code, value, type)
items(salary, type, status, code)
Task: Find value from orders where a matching record exists in items with the same level.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_03463 | train | T1 |
v2 | Schema:
sales (alias: sale)(code, type, name, id)
orders(status, date, value, id)
Task: Find value from sales where a matching record exists in orders with the same type.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_03464 | train | T1 |
v2 | Schema:
departments (alias: dept)(level, name, code, id)
requests(type, status, salary, value)
Task: Find salary from departments where a matching record exists in requests with the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_03465 | train | T1 |
v2 | Schema:
managers (alias: mgr)(status, date, salary, value)
employees(salary, status, id, level)
Task: Retrieve id from managers that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_03466 | train | T1 |
v1 | Schema:
items (alias: lne)(id, level, type, salary)
services(status, amount, type, date)
Task: Retrieve id from items whose type is found in services rows where code matches the outer record.
SQL: | SELECT id FROM items AS lne
WHERE type IN (
SELECT type FROM services AS srvc
WHERE srvc.code = lne.code
); | {
"outer_table": "items",
"inner_table": "services",
"outer_alias": "lne",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_03467 | train | T2 |
v3 | Schema:
accounts (alias: acct)(code, date, id, name)
orders(amount, date, type, code)
Task: Retrieve name from accounts with salary above the AVG(value) of orders rows sharing the same id.
SQL: | SELECT name FROM accounts AS acct
WHERE salary > (
SELECT AVG(value) FROM orders AS ord
WHERE ord.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_03468 | train | T1 |
v3 | Schema:
managers (alias: mgr)(code, amount, status, salary)
requests(salary, level, value, status)
Task: Find id from managers where salary exceeds the average salary from requests for the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE salary > (
SELECT SUM(salary) FROM requests AS ordr
WHERE ordr.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_03469 | train | T1 |
v3 | Schema:
requests (alias: ordr)(id, type, code, amount)
schedules(value, code, type, name)
Task: Retrieve value from requests with value above the MIN(salary) of schedules rows sharing the same status.
SQL: | SELECT value FROM requests AS ordr
WHERE value > (
SELECT MIN(salary) FROM schedules AS schd
WHERE schd.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_03470 | train | T2 |
v3 | Schema:
customers (alias: cust)(id, value, date, salary)
orders(status, date, type, amount)
Task: Find value from customers where salary exceeds the average value from orders for the same level.
SQL: | SELECT value FROM customers AS cust
WHERE salary > (
SELECT COUNT(value) FROM orders AS ord
WHERE ord.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_03471 | train | T1 |
v2 | Schema:
schedules (alias: schd)(status, id, type, level)
invoices(amount, level, salary, value)
Task: Retrieve salary from schedules that have at least one corresponding entry in invoices sharing the same id.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_03472 | train | T2 |
v3 | Schema:
shipments (alias: shp)(value, id, status, date)
categories(amount, code, type, level)
Task: Retrieve id from shipments with salary above the MIN(salary) of categories rows sharing the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE salary > (
SELECT MIN(salary) FROM categories AS catg
WHERE catg.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_03473 | train | T2 |
v1 | Schema:
transactions (alias: txn)(id, value, name, amount)
invoices(type, code, id, status)
Task: Find id from transactions where type appears in invoices entries with matching level.
SQL: | SELECT id FROM transactions AS txn
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_03474 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(salary, level, value, status)
accounts(date, type, id, code)
Task: Find amount from warehouses where a matching record exists in accounts with the same id.
SQL: | SELECT amount FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "accounts",
"outer_alias": "whs",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_03475 | train | T2 |
v1 | Schema:
categories (alias: catg)(status, level, date, value)
products(amount, name, code, value)
Task: Retrieve value from categories whose type is found in products rows where status matches the outer record.
SQL: | SELECT value FROM categories AS catg
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_03476 | train | T2 |
v1 | Schema:
regions (alias: rgn)(id, amount, code, date)
staff(amount, name, level, code)
Task: Find code from regions where status appears in staff entries with matching type.
SQL: | SELECT code FROM regions AS rgn
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_03477 | train | T2 |
v2 | Schema:
sales (alias: sale)(type, value, salary, date)
departments(type, status, amount, salary)
Task: Retrieve id from sales that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_03478 | train | T1 |
v1 | Schema:
employees (alias: emp)(amount, type, value, date)
sales(amount, level, type, value)
Task: Retrieve code from employees whose id is found in sales rows where type matches the outer record.
SQL: | SELECT code FROM employees AS emp
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_03479 | train | T1 |
v1 | Schema:
items (alias: lne)(date, code, salary, status)
warehouses(amount, code, level, value)
Task: Select name from items where level exists in warehouses for the same type.
SQL: | SELECT name FROM items AS lne
WHERE level IN (
SELECT level FROM warehouses AS whs
WHERE whs.type = lne.type
); | {
"outer_table": "items",
"inner_table": "warehouses",
"outer_alias": "lne",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_03480 | train | T2 |
v1 | Schema:
shipments (alias: shp)(level, name, value, salary)
warehouses(code, salary, status, amount)
Task: Find amount from shipments where status appears in warehouses entries with matching level.
SQL: | SELECT amount FROM shipments AS shp
WHERE status IN (
SELECT status FROM warehouses AS whs
WHERE whs.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "warehouses",
"outer_alias": "shp",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_03481 | train | T2 |
v1 | Schema:
requests (alias: ordr)(code, name, value, type)
regions(id, name, code, status)
Task: Find id from requests where status appears in regions entries with matching code.
SQL: | SELECT id FROM requests AS ordr
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_03482 | train | T2 |
v1 | Schema:
staff (alias: empl)(status, date, type, amount)
products(status, id, code, date)
Task: Select code from staff where status exists in products for the same code.
SQL: | SELECT code FROM staff AS empl
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_03483 | train | T2 |
v3 | Schema:
categories (alias: catg)(date, salary, level, amount)
accounts(date, type, name, code)
Task: Retrieve name from categories with salary above the AVG(salary) of accounts rows sharing the same id.
SQL: | SELECT name FROM categories AS catg
WHERE salary > (
SELECT AVG(salary) FROM accounts AS acct
WHERE acct.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_03484 | train | T2 |
v2 | Schema:
orders (alias: ord)(status, level, amount, type)
sales(id, salary, date, name)
Task: Retrieve salary from orders that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_03485 | train | T1 |
v1 | Schema:
budgets (alias: budg)(code, salary, name, value)
staff(amount, code, id, name)
Task: Select amount from budgets where type exists in staff for the same code.
SQL: | SELECT amount FROM budgets AS budg
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "staff",
"outer_alias": "budg",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_03486 | train | T2 |
v2 | Schema:
schedules (alias: schd)(date, type, id, value)
budgets(status, amount, level, type)
Task: Find amount from schedules where a matching record exists in budgets with the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "budgets",
"outer_alias": "schd",
"inner_alias": "budg",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_03487 | train | T2 |
v1 | Schema:
budgets (alias: budg)(value, salary, level, date)
staff(type, id, name, salary)
Task: Retrieve code from budgets whose level is found in staff rows where type matches the outer record.
SQL: | SELECT code FROM budgets AS budg
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "staff",
"outer_alias": "budg",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_03488 | train | T2 |
v3 | Schema:
categories (alias: catg)(value, code, level, date)
departments(value, type, id, amount)
Task: Find name from categories where amount exceeds the average amount from departments for the same code.
SQL: | SELECT name FROM categories AS catg
WHERE amount > (
SELECT SUM(amount) FROM departments AS dept
WHERE dept.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_03489 | train | T2 |
v1 | Schema:
employees (alias: emp)(salary, name, value, status)
shipments(type, date, name, code)
Task: Retrieve id from employees whose code is found in shipments rows where code matches the outer record.
SQL: | SELECT id FROM employees AS emp
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_03490 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(id, level, date, type)
services(date, id, status, type)
Task: Find salary from warehouses where value exceeds the average amount from services for the same code.
SQL: | SELECT salary FROM warehouses AS whs
WHERE value > (
SELECT MIN(amount) FROM services AS srvc
WHERE srvc.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "services",
"outer_alias": "whs",
"inner_alias": "srvc",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_03491 | train | T2 |
v1 | Schema:
transactions (alias: txn)(status, salary, id, amount)
orders(name, level, code, amount)
Task: Find salary from transactions where code appears in orders entries with matching id.
SQL: | SELECT salary FROM transactions AS txn
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_03492 | train | T1 |
v3 | Schema:
employees (alias: emp)(code, level, salary, type)
sales(amount, code, value, level)
Task: Find amount from employees where amount exceeds the average salary from sales for the same id.
SQL: | SELECT amount FROM employees AS emp
WHERE amount > (
SELECT MAX(salary) FROM sales AS sale
WHERE sale.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_03493 | train | T1 |
v1 | Schema:
staff (alias: empl)(status, name, level, date)
requests(salary, amount, type, value)
Task: Retrieve id from staff whose id is found in requests rows where level matches the outer record.
SQL: | SELECT id FROM staff AS empl
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_03494 | train | T2 |
v2 | Schema:
employees (alias: emp)(code, level, value, salary)
items(status, id, amount, type)
Task: Find salary from employees where a matching record exists in items with the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_03495 | train | T1 |
v2 | Schema:
customers (alias: cust)(id, status, level, name)
categories(date, status, code, id)
Task: Find code from customers where a matching record exists in categories with the same level.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_03496 | train | T1 |
v2 | Schema:
staff (alias: empl)(type, code, level, value)
budgets(id, name, salary, level)
Task: Find amount from staff where a matching record exists in budgets with the same type.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "budgets",
"outer_alias": "empl",
"inner_alias": "budg",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_03497 | train | T2 |
v1 | Schema:
orders (alias: ord)(code, status, level, amount)
transactions(id, status, name, amount)
Task: Select salary from orders where level exists in transactions for the same id.
SQL: | SELECT salary FROM orders AS ord
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_03498 | train | T1 |
v3 | Schema:
customers (alias: cust)(id, status, code, salary)
sales(type, value, code, date)
Task: Find id from customers where amount exceeds the average amount from sales for the same status.
SQL: | SELECT id FROM customers AS cust
WHERE amount > (
SELECT AVG(amount) FROM sales AS sale
WHERE sale.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_03499 | train | T1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.