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:
warehouses (alias: whs)(status, id, code, amount)
products(level, code, salary, id)
Task: Retrieve amount from warehouses with value above the MAX(amount) of products rows sharing the same code.
SQL: | SELECT amount FROM warehouses AS whs
WHERE value > (
SELECT MAX(amount) FROM products AS prod
WHERE prod.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "products",
"outer_alias": "whs",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_06700 | train | T2 |
v1 | Schema:
transactions (alias: txn)(name, id, salary, code)
employees(name, value, level, code)
Task: Select name from transactions where id exists in employees for the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_06701 | train | T1 |
v3 | Schema:
transactions (alias: txn)(type, level, status, value)
requests(value, amount, status, date)
Task: Retrieve code from transactions with amount above the SUM(amount) of requests rows sharing the same id.
SQL: | SELECT code FROM transactions AS txn
WHERE amount > (
SELECT SUM(amount) FROM requests AS ordr
WHERE ordr.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_06702 | train | T1 |
v3 | Schema:
managers (alias: mgr)(id, date, level, amount)
departments(amount, status, type, name)
Task: Retrieve id from managers with salary above the MIN(value) of departments rows sharing the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE salary > (
SELECT MIN(value) FROM departments AS dept
WHERE dept.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_06703 | train | T1 |
v3 | Schema:
accounts (alias: acct)(status, id, type, amount)
regions(amount, id, name, salary)
Task: Find code from accounts where salary exceeds the average value from regions for the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE salary > (
SELECT SUM(value) FROM regions AS rgn
WHERE rgn.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_06704 | train | T1 |
v3 | Schema:
requests (alias: ordr)(amount, level, name, code)
invoices(status, id, code, level)
Task: Retrieve value from requests with value above the AVG(salary) of invoices rows sharing the same id.
SQL: | SELECT value FROM requests AS ordr
WHERE value > (
SELECT AVG(salary) FROM invoices AS inv
WHERE inv.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_06705 | train | T2 |
v1 | Schema:
invoices (alias: inv)(type, value, date, amount)
sales(type, salary, date, name)
Task: Retrieve name from invoices whose code is found in sales rows where status matches the outer record.
SQL: | SELECT name FROM invoices AS inv
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_06706 | train | T1 |
v1 | Schema:
managers (alias: mgr)(id, level, type, value)
accounts(name, date, salary, amount)
Task: Select id from managers where status exists in accounts for the same type.
SQL: | SELECT id FROM managers AS mgr
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_06707 | train | T1 |
v1 | Schema:
transactions (alias: txn)(code, status, level, type)
managers(code, name, amount, type)
Task: Retrieve salary from transactions whose type is found in managers rows where type matches the outer record.
SQL: | SELECT salary FROM transactions AS txn
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_06708 | train | T1 |
v1 | Schema:
customers (alias: cust)(amount, level, id, type)
employees(status, code, value, name)
Task: Retrieve name from customers whose level is found in employees rows where status matches the outer record.
SQL: | SELECT name FROM customers AS cust
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_06709 | train | T1 |
v3 | Schema:
invoices (alias: inv)(level, id, code, amount)
budgets(salary, amount, date, name)
Task: Find amount from invoices where value exceeds the average amount from budgets for the same status.
SQL: | SELECT amount FROM invoices AS inv
WHERE value > (
SELECT SUM(amount) FROM budgets AS budg
WHERE budg.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "budgets",
"outer_alias": "inv",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_06710 | train | T1 |
v3 | Schema:
customers (alias: cust)(amount, date, status, name)
warehouses(level, type, code, value)
Task: Retrieve value from customers with amount above the AVG(amount) of warehouses rows sharing the same code.
SQL: | SELECT value FROM customers AS cust
WHERE amount > (
SELECT AVG(amount) FROM warehouses AS whs
WHERE whs.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "warehouses",
"outer_alias": "cust",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_06711 | train | T1 |
v1 | Schema:
employees (alias: emp)(date, name, level, salary)
accounts(amount, salary, name, date)
Task: Select amount from employees where status exists in accounts for the same code.
SQL: | SELECT amount FROM employees AS emp
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_06712 | train | T1 |
v2 | Schema:
budgets (alias: budg)(salary, type, status, level)
shipments(id, date, code, type)
Task: Find code from budgets where a matching record exists in shipments with the same level.
SQL: | SELECT code FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "shipments",
"outer_alias": "budg",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_06713 | train | T2 |
v2 | Schema:
staff (alias: empl)(type, date, name, value)
transactions(salary, type, value, date)
Task: Retrieve name from staff that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_06714 | train | T2 |
v2 | Schema:
staff (alias: empl)(type, code, value, name)
employees(value, date, salary, level)
Task: Find amount from staff where a matching record exists in employees with the same status.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_06715 | train | T2 |
v2 | Schema:
customers (alias: cust)(level, date, code, name)
invoices(code, status, name, level)
Task: Retrieve salary from customers that have at least one corresponding entry in invoices sharing the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_06716 | train | T1 |
v3 | Schema:
schedules (alias: schd)(type, level, value, id)
invoices(level, type, value, amount)
Task: Retrieve amount from schedules with salary above the SUM(value) of invoices rows sharing the same level.
SQL: | SELECT amount FROM schedules AS schd
WHERE salary > (
SELECT SUM(value) FROM invoices AS inv
WHERE inv.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_06717 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(name, amount, type, date)
requests(value, name, date, status)
Task: Find salary from warehouses where type appears in requests entries with matching status.
SQL: | SELECT salary FROM warehouses AS whs
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "requests",
"outer_alias": "whs",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_06718 | train | T2 |
v3 | Schema:
orders (alias: ord)(name, date, level, value)
services(amount, value, code, status)
Task: Find salary from orders where value exceeds the average value from services for the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE value > (
SELECT AVG(value) FROM services AS srvc
WHERE srvc.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "services",
"outer_alias": "ord",
"inner_alias": "srvc",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_06719 | train | T1 |
v2 | Schema:
products (alias: prod)(salary, code, value, status)
accounts(value, id, level, type)
Task: Find amount from products where a matching record exists in accounts with the same level.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = prod.level
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_06720 | train | T1 |
v1 | Schema:
departments (alias: dept)(type, level, salary, code)
warehouses(salary, id, amount, date)
Task: Select value from departments where type exists in warehouses for the same type.
SQL: | SELECT value FROM departments AS dept
WHERE type IN (
SELECT type FROM warehouses AS whs
WHERE whs.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "warehouses",
"outer_alias": "dept",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_06721 | train | T1 |
v1 | Schema:
managers (alias: mgr)(code, name, value, amount)
orders(code, salary, value, name)
Task: Find amount from managers where id appears in orders entries with matching level.
SQL: | SELECT amount FROM managers AS mgr
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_06722 | train | T1 |
v3 | Schema:
categories (alias: catg)(code, value, status, name)
schedules(salary, level, type, id)
Task: Retrieve amount from categories with amount above the COUNT(value) of schedules rows sharing the same status.
SQL: | SELECT amount FROM categories AS catg
WHERE amount > (
SELECT COUNT(value) FROM schedules AS schd
WHERE schd.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_06723 | train | T2 |
v2 | Schema:
services (alias: srvc)(level, value, salary, status)
schedules(status, name, date, value)
Task: Retrieve code from services that have at least one corresponding entry in schedules sharing the same id.
SQL: | SELECT code FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "schedules",
"outer_alias": "srvc",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_06724 | train | T2 |
v2 | Schema:
schedules (alias: schd)(salary, level, code, date)
invoices(type, id, value, status)
Task: Find id from schedules where a matching record exists in invoices with the same type.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_06725 | train | T2 |
v1 | Schema:
categories (alias: catg)(level, name, date, amount)
items(value, type, level, name)
Task: Select name from categories where id exists in items for the same level.
SQL: | SELECT name FROM categories AS catg
WHERE id IN (
SELECT id 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": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_06726 | train | T2 |
v3 | Schema:
requests (alias: ordr)(value, type, code, level)
transactions(level, type, name, date)
Task: Find name from requests where value exceeds the average value from transactions for the same code.
SQL: | SELECT name FROM requests AS ordr
WHERE value > (
SELECT SUM(value) FROM transactions AS txn
WHERE txn.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_06727 | train | T2 |
v1 | Schema:
accounts (alias: acct)(value, status, salary, code)
orders(date, salary, name, level)
Task: Find code from accounts where level appears in orders entries with matching level.
SQL: | SELECT code FROM accounts AS acct
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_06728 | train | T1 |
v3 | Schema:
orders (alias: ord)(name, id, salary, date)
departments(code, type, salary, name)
Task: Retrieve amount from orders with salary above the MIN(amount) of departments rows sharing the same id.
SQL: | SELECT amount FROM orders AS ord
WHERE salary > (
SELECT MIN(amount) FROM departments AS dept
WHERE dept.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_06729 | train | T1 |
v1 | Schema:
products (alias: prod)(level, id, type, status)
shipments(code, id, status, salary)
Task: Find amount from products where code appears in shipments entries with matching code.
SQL: | SELECT amount FROM products AS prod
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.code = prod.code
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_06730 | train | T1 |
v1 | Schema:
categories (alias: catg)(salary, value, level, date)
shipments(salary, type, code, status)
Task: Find value from categories where code appears in shipments entries with matching id.
SQL: | SELECT value FROM categories AS catg
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_06731 | train | T2 |
v1 | Schema:
products (alias: prod)(type, date, value, name)
managers(type, code, amount, salary)
Task: Select value from products where type exists in managers for the same type.
SQL: | SELECT value FROM products AS prod
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.type = prod.type
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_06732 | train | T1 |
v3 | Schema:
services (alias: srvc)(type, level, id, value)
accounts(status, value, amount, type)
Task: Retrieve id from services with value above the MIN(value) of accounts rows sharing the same status.
SQL: | SELECT id FROM services AS srvc
WHERE value > (
SELECT MIN(value) FROM accounts AS acct
WHERE acct.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "accounts",
"outer_alias": "srvc",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_06733 | train | T2 |
v3 | Schema:
categories (alias: catg)(type, code, amount, status)
warehouses(amount, level, date, salary)
Task: Find code from categories where amount exceeds the average value from warehouses for the same status.
SQL: | SELECT code FROM categories AS catg
WHERE amount > (
SELECT AVG(value) 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": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_06734 | train | T2 |
v2 | Schema:
departments (alias: dept)(id, code, value, status)
regions(status, code, type, salary)
Task: Find id from departments where a matching record exists in regions with the same id.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_06735 | train | T1 |
v3 | Schema:
staff (alias: empl)(amount, code, date, salary)
accounts(status, level, name, type)
Task: Retrieve name from staff with value above the MAX(salary) of accounts rows sharing the same type.
SQL: | SELECT name FROM staff AS empl
WHERE value > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_06736 | train | T2 |
v2 | Schema:
managers (alias: mgr)(code, date, value, name)
employees(level, code, amount, salary)
Task: Retrieve value from managers that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT value 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": "value",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_06737 | train | T1 |
v2 | Schema:
categories (alias: catg)(code, date, salary, level)
regions(code, type, id, date)
Task: Retrieve id from categories that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT id 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": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_06738 | train | T2 |
v1 | Schema:
items (alias: lne)(code, name, amount, value)
warehouses(name, date, salary, value)
Task: Find salary from items where id appears in warehouses entries with matching type.
SQL: | SELECT salary FROM items AS lne
WHERE id IN (
SELECT id FROM warehouses AS whs
WHERE whs.type = lne.type
); | {
"outer_table": "items",
"inner_table": "warehouses",
"outer_alias": "lne",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_06739 | train | T2 |
v3 | Schema:
items (alias: lne)(name, value, code, type)
warehouses(code, name, type, value)
Task: Retrieve value from items with amount above the MIN(salary) of warehouses rows sharing the same level.
SQL: | SELECT value FROM items AS lne
WHERE amount > (
SELECT MIN(salary) FROM warehouses AS whs
WHERE whs.level = lne.level
); | {
"outer_table": "items",
"inner_table": "warehouses",
"outer_alias": "lne",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_06740 | train | T2 |
v1 | Schema:
departments (alias: dept)(name, value, status, type)
customers(name, salary, amount, level)
Task: Find amount from departments where type appears in customers entries with matching level.
SQL: | SELECT amount FROM departments AS dept
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_06741 | train | T1 |
v2 | Schema:
sales (alias: sale)(status, id, level, date)
warehouses(status, level, date, code)
Task: Retrieve code from sales that have at least one corresponding entry in warehouses sharing the same status.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "warehouses",
"outer_alias": "sale",
"inner_alias": "whs",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_06742 | train | T1 |
v1 | Schema:
schedules (alias: schd)(name, status, date, amount)
budgets(status, code, id, amount)
Task: Select amount from schedules where status exists in budgets for the same code.
SQL: | SELECT amount FROM schedules AS schd
WHERE status IN (
SELECT status FROM budgets AS budg
WHERE budg.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "budgets",
"outer_alias": "schd",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_06743 | train | T2 |
v2 | Schema:
orders (alias: ord)(type, amount, name, value)
categories(code, name, level, salary)
Task: Retrieve salary from orders that have at least one corresponding entry in categories sharing the same level.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_06744 | train | T1 |
v3 | Schema:
accounts (alias: acct)(date, name, amount, code)
items(code, salary, value, level)
Task: Retrieve value from accounts with amount above the COUNT(salary) of items rows sharing the same code.
SQL: | SELECT value FROM accounts AS acct
WHERE amount > (
SELECT COUNT(salary) FROM items AS lne
WHERE lne.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_06745 | train | T1 |
v1 | Schema:
requests (alias: ordr)(level, value, code, amount)
categories(date, id, type, salary)
Task: Select code from requests where type exists in categories for the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_06746 | train | T2 |
v3 | Schema:
items (alias: lne)(value, date, id, status)
budgets(status, code, amount, id)
Task: Find value from items where value exceeds the average value from budgets for the same type.
SQL: | SELECT value FROM items AS lne
WHERE value > (
SELECT AVG(value) FROM budgets AS budg
WHERE budg.type = lne.type
); | {
"outer_table": "items",
"inner_table": "budgets",
"outer_alias": "lne",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_06747 | train | T2 |
v1 | Schema:
customers (alias: cust)(level, id, name, type)
managers(amount, status, type, date)
Task: Retrieve id from customers whose status is found in managers rows where id matches the outer record.
SQL: | SELECT id FROM customers AS cust
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_06748 | train | T1 |
v2 | Schema:
customers (alias: cust)(date, status, level, code)
categories(id, name, salary, code)
Task: Find value from customers where a matching record exists in categories with the same id.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_06749 | train | T1 |
v1 | Schema:
products (alias: prod)(type, name, salary, id)
invoices(name, type, level, date)
Task: Retrieve name from products whose code is found in invoices rows where level matches the outer record.
SQL: | SELECT name FROM products AS prod
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.level = prod.level
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_06750 | train | T1 |
v3 | Schema:
orders (alias: ord)(value, status, salary, id)
services(code, value, id, status)
Task: Retrieve id from orders with salary above the COUNT(value) of services rows sharing the same level.
SQL: | SELECT id FROM orders AS ord
WHERE salary > (
SELECT COUNT(value) FROM services AS srvc
WHERE srvc.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "services",
"outer_alias": "ord",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_06751 | train | T1 |
v2 | Schema:
items (alias: lne)(amount, date, type, code)
requests(level, type, code, date)
Task: Retrieve code from items that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = lne.level
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_06752 | train | T2 |
v1 | Schema:
departments (alias: dept)(date, type, salary, name)
orders(code, amount, status, id)
Task: Select salary from departments where id exists in orders for the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_06753 | train | T1 |
v2 | Schema:
items (alias: lne)(type, id, name, date)
customers(id, date, value, type)
Task: Retrieve id from items that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = lne.code
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_06754 | train | T2 |
v1 | Schema:
sales (alias: sale)(name, code, status, amount)
orders(value, code, id, type)
Task: Retrieve value from sales whose level is found in orders rows where status matches the outer record.
SQL: | SELECT value FROM sales AS sale
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_06755 | train | T1 |
v2 | Schema:
employees (alias: emp)(code, value, name, type)
managers(code, date, id, salary)
Task: Retrieve name from employees that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_06756 | train | T1 |
v1 | Schema:
managers (alias: mgr)(amount, id, level, status)
orders(type, id, code, salary)
Task: Find value from managers where code appears in orders entries with matching type.
SQL: | SELECT value FROM managers AS mgr
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_06757 | train | T1 |
v1 | Schema:
products (alias: prod)(type, code, value, name)
transactions(type, level, date, code)
Task: Select code from products where type exists in transactions for the same status.
SQL: | SELECT code FROM products AS prod
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.status = prod.status
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_06758 | train | T1 |
v2 | Schema:
staff (alias: empl)(date, level, code, type)
invoices(id, salary, status, type)
Task: Retrieve value from staff that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_06759 | train | T2 |
v2 | Schema:
services (alias: srvc)(code, amount, id, level)
shipments(level, code, date, type)
Task: Retrieve amount from services that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT amount FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "shipments",
"outer_alias": "srvc",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_06760 | train | T2 |
v1 | Schema:
managers (alias: mgr)(id, code, status, type)
orders(type, salary, status, id)
Task: Find amount from managers where type appears in orders entries with matching level.
SQL: | SELECT amount FROM managers AS mgr
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_06761 | train | T1 |
v1 | Schema:
items (alias: lne)(name, salary, type, id)
accounts(id, code, status, amount)
Task: Select code from items where level exists in accounts for the same level.
SQL: | SELECT code FROM items AS lne
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.level = lne.level
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_06762 | train | T2 |
v1 | Schema:
requests (alias: ordr)(salary, type, amount, value)
employees(id, level, value, status)
Task: Find amount from requests where code appears in employees entries with matching type.
SQL: | SELECT amount FROM requests AS ordr
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_06763 | train | T2 |
v3 | Schema:
transactions (alias: txn)(status, name, level, value)
managers(value, status, type, date)
Task: Find value from transactions where value exceeds the average amount from managers for the same status.
SQL: | SELECT value FROM transactions AS txn
WHERE value > (
SELECT SUM(amount) FROM managers AS mgr
WHERE mgr.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_06764 | train | T1 |
v2 | Schema:
employees (alias: emp)(status, name, level, type)
schedules(salary, amount, date, level)
Task: Find code from employees where a matching record exists in schedules with the same id.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_06765 | train | T1 |
v2 | Schema:
schedules (alias: schd)(level, id, code, date)
orders(date, value, salary, id)
Task: Find code from schedules where a matching record exists in orders with the same status.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_06766 | train | T2 |
v2 | Schema:
categories (alias: catg)(status, value, date, name)
employees(value, level, amount, type)
Task: Find salary from categories where a matching record exists in employees with the same id.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_06767 | train | T2 |
v3 | Schema:
sales (alias: sale)(salary, date, id, amount)
transactions(value, salary, status, level)
Task: Find salary from sales where value exceeds the average value from transactions for the same level.
SQL: | SELECT salary FROM sales AS sale
WHERE value > (
SELECT AVG(value) FROM transactions AS txn
WHERE txn.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_06768 | train | T1 |
v1 | Schema:
shipments (alias: shp)(type, name, level, date)
managers(level, salary, code, name)
Task: Select amount from shipments where id exists in managers for the same type.
SQL: | SELECT amount FROM shipments AS shp
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_06769 | train | T2 |
v3 | Schema:
invoices (alias: inv)(date, name, level, status)
services(type, amount, salary, id)
Task: Retrieve amount from invoices with salary above the SUM(salary) of services rows sharing the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE salary > (
SELECT SUM(salary) FROM services AS srvc
WHERE srvc.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "services",
"outer_alias": "inv",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_06770 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(code, salary, level, status)
staff(id, type, amount, salary)
Task: Retrieve id from warehouses that have at least one corresponding entry in staff sharing the same level.
SQL: | SELECT id FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "staff",
"outer_alias": "whs",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_06771 | train | T2 |
v3 | Schema:
departments (alias: dept)(code, date, id, level)
sales(name, date, type, amount)
Task: Find amount from departments where salary exceeds the average salary from sales for the same id.
SQL: | SELECT amount FROM departments AS dept
WHERE salary > (
SELECT AVG(salary) FROM sales AS sale
WHERE sale.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_06772 | train | T1 |
v3 | Schema:
departments (alias: dept)(date, amount, type, name)
categories(value, level, salary, id)
Task: Retrieve salary from departments with salary above the SUM(amount) of categories rows sharing the same code.
SQL: | SELECT salary FROM departments AS dept
WHERE salary > (
SELECT SUM(amount) FROM categories AS catg
WHERE catg.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_06773 | train | T1 |
v2 | Schema:
transactions (alias: txn)(salary, value, level, code)
employees(date, amount, value, level)
Task: Retrieve code from transactions that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_06774 | train | T1 |
v1 | Schema:
transactions (alias: txn)(name, type, status, value)
employees(value, salary, id, code)
Task: Select code from transactions where type exists in employees for the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_06775 | train | T1 |
v1 | Schema:
customers (alias: cust)(type, salary, status, name)
schedules(code, value, name, salary)
Task: Find salary from customers where status appears in schedules entries with matching id.
SQL: | SELECT salary FROM customers AS cust
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_06776 | train | T1 |
v3 | Schema:
invoices (alias: inv)(salary, code, status, value)
budgets(salary, id, name, level)
Task: Find id from invoices where amount exceeds the average value from budgets for the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE amount > (
SELECT AVG(value) FROM budgets AS budg
WHERE budg.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "budgets",
"outer_alias": "inv",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_06777 | train | T1 |
v1 | Schema:
departments (alias: dept)(id, salary, date, amount)
items(level, type, name, amount)
Task: Retrieve salary from departments whose code is found in items rows where type matches the outer record.
SQL: | SELECT salary FROM departments AS dept
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_06778 | train | T1 |
v2 | Schema:
shipments (alias: shp)(date, type, value, status)
transactions(id, salary, name, value)
Task: Retrieve amount from shipments that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_06779 | train | T2 |
v1 | Schema:
transactions (alias: txn)(name, type, value, code)
items(type, name, date, status)
Task: Find value from transactions where status appears in items entries with matching type.
SQL: | SELECT value FROM transactions AS txn
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_06780 | train | T1 |
v2 | Schema:
sales (alias: sale)(status, name, type, level)
warehouses(date, amount, name, id)
Task: Retrieve value from sales that have at least one corresponding entry in warehouses sharing the same code.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "warehouses",
"outer_alias": "sale",
"inner_alias": "whs",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_06781 | train | T1 |
v2 | Schema:
accounts (alias: acct)(status, value, level, code)
products(name, salary, level, value)
Task: Retrieve id from accounts that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_06782 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(amount, salary, type, value)
sales(type, status, level, value)
Task: Select salary from warehouses where type exists in sales for the same code.
SQL: | SELECT salary FROM warehouses AS whs
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "sales",
"outer_alias": "whs",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_06783 | train | T2 |
v2 | Schema:
staff (alias: empl)(code, id, name, date)
services(salary, level, status, name)
Task: Retrieve salary from staff that have at least one corresponding entry in services sharing the same type.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "services",
"outer_alias": "empl",
"inner_alias": "srvc",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_06784 | train | T2 |
v1 | Schema:
sales (alias: sale)(status, salary, code, id)
warehouses(value, status, id, salary)
Task: Select id from sales where status exists in warehouses for the same level.
SQL: | SELECT id FROM sales AS sale
WHERE status IN (
SELECT status FROM warehouses AS whs
WHERE whs.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "warehouses",
"outer_alias": "sale",
"inner_alias": "whs",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_06785 | train | T1 |
v3 | Schema:
services (alias: srvc)(name, id, salary, amount)
budgets(date, name, salary, status)
Task: Retrieve code from services with amount above the MIN(value) of budgets rows sharing the same id.
SQL: | SELECT code FROM services AS srvc
WHERE amount > (
SELECT MIN(value) FROM budgets AS budg
WHERE budg.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "budgets",
"outer_alias": "srvc",
"inner_alias": "budg",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_06786 | train | T2 |
v3 | Schema:
customers (alias: cust)(type, value, date, status)
categories(value, salary, level, status)
Task: Retrieve amount from customers with salary above the MAX(value) of categories rows sharing the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE salary > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_06787 | train | T1 |
v3 | Schema:
orders (alias: ord)(id, date, code, salary)
sales(name, salary, value, status)
Task: Find value from orders where salary exceeds the average value from sales for the same status.
SQL: | SELECT value FROM orders AS ord
WHERE salary > (
SELECT AVG(value) FROM sales AS sale
WHERE sale.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_06788 | train | T1 |
v2 | Schema:
products (alias: prod)(name, salary, level, date)
accounts(name, date, amount, salary)
Task: Find amount from products where a matching record exists in accounts with the same level.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = prod.level
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_06789 | train | T1 |
v1 | Schema:
categories (alias: catg)(amount, code, type, date)
invoices(amount, value, level, code)
Task: Select id from categories where id exists in invoices for the same level.
SQL: | SELECT id FROM categories AS catg
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_06790 | train | T2 |
v3 | Schema:
customers (alias: cust)(amount, type, salary, id)
managers(level, id, salary, status)
Task: Retrieve id from customers with amount above the MIN(salary) of managers rows sharing the same type.
SQL: | SELECT id FROM customers AS cust
WHERE amount > (
SELECT MIN(salary) FROM managers AS mgr
WHERE mgr.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_06791 | train | T1 |
v3 | Schema:
schedules (alias: schd)(code, type, salary, level)
shipments(name, id, code, amount)
Task: Retrieve amount from schedules with value above the MIN(value) of shipments rows sharing the same id.
SQL: | SELECT amount FROM schedules AS schd
WHERE value > (
SELECT MIN(value) FROM shipments AS shp
WHERE shp.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_06792 | train | T2 |
v2 | Schema:
customers (alias: cust)(code, name, level, type)
items(date, id, level, salary)
Task: Find name from customers where a matching record exists in items with the same id.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_06793 | train | T1 |
v3 | Schema:
regions (alias: rgn)(date, type, code, value)
employees(code, name, date, id)
Task: Find amount from regions where amount exceeds the average salary from employees for the same status.
SQL: | SELECT amount FROM regions AS rgn
WHERE amount > (
SELECT MIN(salary) FROM employees AS emp
WHERE emp.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_06794 | train | T2 |
v3 | Schema:
managers (alias: mgr)(id, salary, name, level)
employees(level, salary, type, code)
Task: Find value from managers where amount exceeds the average salary from employees for the same code.
SQL: | SELECT value FROM managers AS mgr
WHERE amount > (
SELECT COUNT(salary) FROM employees AS emp
WHERE emp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_06795 | train | T1 |
v1 | Schema:
shipments (alias: shp)(date, amount, status, value)
warehouses(code, date, amount, status)
Task: Find name from shipments where code appears in warehouses entries with matching id.
SQL: | SELECT name FROM shipments AS shp
WHERE code IN (
SELECT code FROM warehouses AS whs
WHERE whs.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "warehouses",
"outer_alias": "shp",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_06796 | train | T2 |
v3 | Schema:
regions (alias: rgn)(salary, name, type, id)
employees(name, code, level, salary)
Task: Find id from regions where value exceeds the average value from employees for the same status.
SQL: | SELECT id FROM regions AS rgn
WHERE value > (
SELECT AVG(value) FROM employees AS emp
WHERE emp.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_06797 | train | T2 |
v1 | Schema:
regions (alias: rgn)(value, status, code, salary)
schedules(level, type, salary, code)
Task: Retrieve code from regions whose status is found in schedules rows where id matches the outer record.
SQL: | SELECT code FROM regions AS rgn
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_06798 | train | T2 |
v1 | Schema:
items (alias: lne)(level, salary, amount, name)
sales(date, salary, name, type)
Task: Retrieve value from items whose code is found in sales rows where status matches the outer record.
SQL: | SELECT value FROM items AS lne
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.status = lne.status
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_06799 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.