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 |
|---|---|---|---|---|---|---|
v1 | Schema:
categories (alias: catg)(status, type, salary, value)
products(date, value, level, salary)
Task: Select id from categories where code exists in products for the same id.
SQL: | SELECT id FROM categories AS catg
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_10300 | train | T2 |
v3 | Schema:
categories (alias: catg)(amount, date, value, name)
managers(code, name, status, salary)
Task: Retrieve salary from categories with amount above the SUM(amount) of managers rows sharing the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE amount > (
SELECT SUM(amount) FROM managers AS mgr
WHERE mgr.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_10301 | train | T2 |
v3 | Schema:
budgets (alias: budg)(amount, salary, name, status)
services(salary, amount, value, type)
Task: Find code from budgets where value exceeds the average amount from services for the same code.
SQL: | SELECT code FROM budgets AS budg
WHERE value > (
SELECT COUNT(amount) FROM services AS srvc
WHERE srvc.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "services",
"outer_alias": "budg",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_10302 | train | T2 |
v1 | Schema:
transactions (alias: txn)(id, name, type, salary)
customers(id, salary, value, type)
Task: Retrieve name from transactions whose level is found in customers rows where level matches the outer record.
SQL: | SELECT name FROM transactions AS txn
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_10303 | train | T1 |
v3 | Schema:
departments (alias: dept)(name, type, date, amount)
shipments(amount, salary, value, type)
Task: Find code from departments where value exceeds the average salary from shipments for the same code.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT MAX(salary) FROM shipments AS shp
WHERE shp.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_10304 | train | T1 |
v1 | Schema:
shipments (alias: shp)(value, code, salary, id)
warehouses(level, salary, code, type)
Task: Retrieve salary from shipments whose id is found in warehouses rows where id matches the outer record.
SQL: | SELECT salary FROM shipments AS shp
WHERE id IN (
SELECT id FROM warehouses AS whs
WHERE whs.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "warehouses",
"outer_alias": "shp",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_10305 | train | T2 |
v2 | Schema:
invoices (alias: inv)(value, amount, code, date)
warehouses(type, amount, date, name)
Task: Retrieve value from invoices that have at least one corresponding entry in warehouses sharing the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "warehouses",
"outer_alias": "inv",
"inner_alias": "whs",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_10306 | train | T1 |
v1 | Schema:
invoices (alias: inv)(salary, name, id, value)
warehouses(amount, type, level, name)
Task: Select amount from invoices where code exists in warehouses for the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE code IN (
SELECT code FROM warehouses AS whs
WHERE whs.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "warehouses",
"outer_alias": "inv",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_10307 | train | T1 |
v2 | Schema:
regions (alias: rgn)(type, date, status, id)
staff(status, level, salary, value)
Task: Find salary from regions where a matching record exists in staff with the same level.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_10308 | train | T2 |
v2 | Schema:
regions (alias: rgn)(type, level, date, code)
managers(amount, status, name, date)
Task: Retrieve value from regions that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_10309 | train | T2 |
v1 | Schema:
services (alias: srvc)(level, value, id, amount)
items(type, date, amount, salary)
Task: Find id from services where level appears in items entries with matching status.
SQL: | SELECT id FROM services AS srvc
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "items",
"outer_alias": "srvc",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_10310 | train | T2 |
v1 | Schema:
transactions (alias: txn)(amount, value, id, type)
employees(amount, code, value, date)
Task: Retrieve amount from transactions whose level is found in employees rows where code matches the outer record.
SQL: | SELECT amount FROM transactions AS txn
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_10311 | train | T1 |
v3 | Schema:
items (alias: lne)(status, amount, level, type)
invoices(salary, id, code, type)
Task: Retrieve salary from items with value above the AVG(salary) of invoices rows sharing the same code.
SQL: | SELECT salary FROM items AS lne
WHERE value > (
SELECT AVG(salary) FROM invoices AS inv
WHERE inv.code = lne.code
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_10312 | train | T2 |
v2 | Schema:
sales (alias: sale)(date, value, code, salary)
invoices(salary, code, name, date)
Task: Retrieve salary from sales that have at least one corresponding entry in invoices sharing the same level.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_10313 | train | T1 |
v2 | Schema:
invoices (alias: inv)(code, value, date, salary)
services(date, salary, code, name)
Task: Retrieve code from invoices that have at least one corresponding entry in services sharing the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "services",
"outer_alias": "inv",
"inner_alias": "srvc",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_10314 | train | T1 |
v1 | Schema:
categories (alias: catg)(salary, type, date, amount)
customers(id, status, salary, value)
Task: Select amount from categories where id exists in customers for the same status.
SQL: | SELECT amount FROM categories AS catg
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_10315 | train | T2 |
v2 | Schema:
departments (alias: dept)(level, value, code, id)
regions(code, salary, type, id)
Task: Find code from departments where a matching record exists in regions with the same level.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_10316 | train | T1 |
v1 | Schema:
accounts (alias: acct)(date, value, status, level)
warehouses(date, code, level, id)
Task: Retrieve salary from accounts whose code is found in warehouses rows where status matches the outer record.
SQL: | SELECT salary FROM accounts AS acct
WHERE code IN (
SELECT code FROM warehouses AS whs
WHERE whs.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "warehouses",
"outer_alias": "acct",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_10317 | train | T1 |
v1 | Schema:
schedules (alias: schd)(date, name, id, level)
products(amount, status, value, salary)
Task: Select code from schedules where code exists in products for the same level.
SQL: | SELECT code FROM schedules AS schd
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_10318 | train | T2 |
v3 | Schema:
regions (alias: rgn)(date, name, value, salary)
invoices(amount, name, type, code)
Task: Retrieve id from regions with amount above the COUNT(amount) of invoices rows sharing the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE amount > (
SELECT COUNT(amount) FROM invoices AS inv
WHERE inv.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_10319 | train | T2 |
v3 | Schema:
invoices (alias: inv)(name, id, code, level)
staff(value, salary, code, name)
Task: Find id from invoices where salary exceeds the average amount from staff for the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE salary > (
SELECT COUNT(amount) FROM staff AS empl
WHERE empl.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_10320 | train | T1 |
v1 | Schema:
regions (alias: rgn)(salary, date, level, status)
categories(value, name, salary, amount)
Task: Select value from regions where level exists in categories for the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_10321 | train | T2 |
v1 | Schema:
orders (alias: ord)(id, value, date, salary)
items(type, id, date, level)
Task: Find name from orders where code appears in items entries with matching code.
SQL: | SELECT name FROM orders AS ord
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_10322 | train | T1 |
v2 | Schema:
accounts (alias: acct)(level, amount, name, code)
employees(status, id, level, value)
Task: Retrieve value from accounts that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_10323 | train | T1 |
v3 | Schema:
schedules (alias: schd)(type, code, level, status)
accounts(status, level, amount, code)
Task: Find value from schedules where salary exceeds the average value from accounts for the same level.
SQL: | SELECT value FROM schedules AS schd
WHERE salary > (
SELECT SUM(value) FROM accounts AS acct
WHERE acct.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_10324 | train | T2 |
v3 | Schema:
accounts (alias: acct)(salary, date, code, level)
customers(name, type, date, value)
Task: Find value from accounts where salary exceeds the average amount from customers for the same code.
SQL: | SELECT value FROM accounts AS acct
WHERE salary > (
SELECT SUM(amount) FROM customers AS cust
WHERE cust.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_10325 | train | T1 |
v1 | Schema:
budgets (alias: budg)(name, value, status, level)
orders(level, amount, value, date)
Task: Select name from budgets where level exists in orders for the same level.
SQL: | SELECT name FROM budgets AS budg
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "orders",
"outer_alias": "budg",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_10326 | train | T2 |
v2 | Schema:
requests (alias: ordr)(amount, type, status, code)
customers(date, status, salary, amount)
Task: Retrieve amount from requests that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_10327 | train | T2 |
v1 | Schema:
regions (alias: rgn)(value, type, name, level)
budgets(id, type, salary, date)
Task: Select value from regions where id exists in budgets for the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE id IN (
SELECT id FROM budgets AS budg
WHERE budg.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "budgets",
"outer_alias": "rgn",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_10328 | train | T2 |
v3 | Schema:
requests (alias: ordr)(status, id, type, name)
accounts(amount, id, type, salary)
Task: Retrieve value from requests with amount above the COUNT(value) of accounts rows sharing the same status.
SQL: | SELECT value FROM requests AS ordr
WHERE amount > (
SELECT COUNT(value) FROM accounts AS acct
WHERE acct.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_10329 | train | T2 |
v2 | Schema:
requests (alias: ordr)(name, level, type, amount)
products(date, id, amount, type)
Task: Find amount from requests where a matching record exists in products with the same id.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_10330 | train | T2 |
v3 | Schema:
regions (alias: rgn)(id, code, type, date)
categories(code, date, value, salary)
Task: Retrieve name from regions with amount above the SUM(value) of categories rows sharing the same status.
SQL: | SELECT name FROM regions AS rgn
WHERE amount > (
SELECT SUM(value) FROM categories AS catg
WHERE catg.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_10331 | train | T2 |
v2 | Schema:
items (alias: lne)(type, amount, level, name)
managers(date, level, id, amount)
Task: Retrieve salary from items that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_10332 | train | T2 |
v1 | Schema:
budgets (alias: budg)(level, value, name, code)
shipments(level, name, value, id)
Task: Select salary from budgets where status exists in shipments for the same status.
SQL: | SELECT salary FROM budgets AS budg
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "shipments",
"outer_alias": "budg",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_10333 | train | T2 |
v3 | Schema:
orders (alias: ord)(id, level, code, salary)
departments(amount, code, name, date)
Task: Retrieve id from orders with value above the COUNT(value) of departments rows sharing the same level.
SQL: | SELECT id FROM orders AS ord
WHERE value > (
SELECT COUNT(value) FROM departments AS dept
WHERE dept.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_10334 | train | T1 |
v1 | Schema:
transactions (alias: txn)(level, name, type, value)
schedules(status, amount, name, date)
Task: Select amount from transactions where code exists in schedules for the same code.
SQL: | SELECT amount FROM transactions AS txn
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_10335 | train | T1 |
v3 | Schema:
services (alias: srvc)(value, date, salary, amount)
transactions(code, value, amount, salary)
Task: Retrieve salary from services with value above the COUNT(amount) of transactions rows sharing the same level.
SQL: | SELECT salary FROM services AS srvc
WHERE value > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "transactions",
"outer_alias": "srvc",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_10336 | train | T2 |
v2 | Schema:
categories (alias: catg)(amount, value, id, status)
invoices(type, status, name, code)
Task: Find code from categories where a matching record exists in invoices with the same level.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_10337 | train | T2 |
v3 | Schema:
orders (alias: ord)(type, date, salary, value)
transactions(date, level, code, amount)
Task: Find value from orders where salary exceeds the average amount from transactions for the same id.
SQL: | SELECT value FROM orders AS ord
WHERE salary > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_10338 | train | T1 |
v2 | Schema:
products (alias: prod)(type, date, code, amount)
invoices(code, date, salary, status)
Task: Find code from products where a matching record exists in invoices with the same type.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = prod.type
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_10339 | train | T1 |
v3 | Schema:
customers (alias: cust)(date, id, value, level)
services(status, name, id, level)
Task: Retrieve id from customers with value above the MIN(value) of services rows sharing the same id.
SQL: | SELECT id FROM customers AS cust
WHERE value > (
SELECT MIN(value) FROM services AS srvc
WHERE srvc.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "services",
"outer_alias": "cust",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_10340 | train | T1 |
v3 | Schema:
managers (alias: mgr)(level, value, salary, date)
transactions(date, name, code, amount)
Task: Retrieve code from managers with salary above the AVG(value) of transactions rows sharing the same code.
SQL: | SELECT code FROM managers AS mgr
WHERE salary > (
SELECT AVG(value) FROM transactions AS txn
WHERE txn.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_10341 | train | T1 |
v1 | Schema:
services (alias: srvc)(amount, value, status, date)
customers(status, date, name, type)
Task: Find name from services where id appears in customers entries with matching type.
SQL: | SELECT name FROM services AS srvc
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "customers",
"outer_alias": "srvc",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_10342 | train | T2 |
v2 | Schema:
customers (alias: cust)(id, salary, date, amount)
accounts(type, salary, value, name)
Task: Retrieve amount from customers that have at least one corresponding entry in accounts sharing the same type.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_10343 | train | T1 |
v1 | Schema:
orders (alias: ord)(name, amount, salary, status)
staff(code, level, name, status)
Task: Retrieve id from orders whose level is found in staff rows where type matches the outer record.
SQL: | SELECT id FROM orders AS ord
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_10344 | train | T1 |
v2 | Schema:
sales (alias: sale)(name, amount, code, status)
employees(date, code, amount, value)
Task: Find id from sales where a matching record exists in employees with the same status.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_10345 | train | T1 |
v2 | Schema:
sales (alias: sale)(name, amount, level, date)
services(salary, id, code, level)
Task: Retrieve amount from sales that have at least one corresponding entry in services sharing the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "services",
"outer_alias": "sale",
"inner_alias": "srvc",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_10346 | train | T1 |
v1 | Schema:
products (alias: prod)(amount, salary, status, date)
invoices(level, salary, date, type)
Task: Find id from products where status appears in invoices entries with matching code.
SQL: | SELECT id FROM products AS prod
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.code = prod.code
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_10347 | train | T1 |
v3 | Schema:
items (alias: lne)(value, level, type, name)
invoices(amount, id, name, level)
Task: Find code from items where amount exceeds the average salary from invoices for the same id.
SQL: | SELECT code FROM items AS lne
WHERE amount > (
SELECT AVG(salary) FROM invoices AS inv
WHERE inv.id = lne.id
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_10348 | train | T2 |
v2 | Schema:
staff (alias: empl)(status, id, code, level)
accounts(name, code, type, status)
Task: Retrieve salary from staff that have at least one corresponding entry in accounts sharing the same type.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_10349 | train | T2 |
v1 | Schema:
managers (alias: mgr)(name, salary, code, type)
requests(status, date, name, salary)
Task: Select amount from managers where level exists in requests for the same code.
SQL: | SELECT amount FROM managers AS mgr
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_10350 | train | T1 |
v3 | Schema:
items (alias: lne)(level, date, type, name)
services(status, salary, name, amount)
Task: Find code from items where salary exceeds the average salary from services for the same code.
SQL: | SELECT code FROM items AS lne
WHERE salary > (
SELECT COUNT(salary) FROM services AS srvc
WHERE srvc.code = lne.code
); | {
"outer_table": "items",
"inner_table": "services",
"outer_alias": "lne",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_10351 | train | T2 |
v1 | Schema:
transactions (alias: txn)(code, level, date, type)
managers(type, value, name, code)
Task: Select code from transactions where type exists in managers for the same code.
SQL: | SELECT code FROM transactions AS txn
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_10352 | train | T1 |
v2 | Schema:
orders (alias: ord)(name, date, type, code)
employees(value, date, name, type)
Task: Find code from orders where a matching record exists in employees with the same code.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_10353 | train | T1 |
v1 | Schema:
sales (alias: sale)(status, level, date, name)
items(salary, id, value, amount)
Task: Select id from sales where status exists in items for the same level.
SQL: | SELECT id FROM sales AS sale
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_10354 | train | T1 |
v2 | Schema:
schedules (alias: schd)(name, salary, type, amount)
services(salary, name, value, code)
Task: Retrieve name from schedules that have at least one corresponding entry in services sharing the same type.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "services",
"outer_alias": "schd",
"inner_alias": "srvc",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_10355 | train | T2 |
v1 | Schema:
sales (alias: sale)(type, name, date, code)
regions(status, value, type, level)
Task: Select amount from sales where type exists in regions for the same level.
SQL: | SELECT amount FROM sales AS sale
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_10356 | train | T1 |
v2 | Schema:
accounts (alias: acct)(date, level, code, id)
transactions(level, type, amount, code)
Task: Retrieve amount from accounts that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_10357 | train | T1 |
v3 | Schema:
budgets (alias: budg)(id, code, salary, name)
shipments(code, value, salary, date)
Task: Find code from budgets where value exceeds the average salary from shipments for the same level.
SQL: | SELECT code FROM budgets AS budg
WHERE value > (
SELECT COUNT(salary) FROM shipments AS shp
WHERE shp.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "shipments",
"outer_alias": "budg",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_10358 | train | T2 |
v1 | Schema:
transactions (alias: txn)(id, type, amount, name)
accounts(date, type, id, level)
Task: Select value from transactions where id exists in accounts for the same level.
SQL: | SELECT value FROM transactions AS txn
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_10359 | train | T1 |
v1 | Schema:
staff (alias: empl)(level, salary, id, amount)
services(salary, amount, name, value)
Task: Select salary from staff where level exists in services for the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE level IN (
SELECT level FROM services AS srvc
WHERE srvc.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "services",
"outer_alias": "empl",
"inner_alias": "srvc",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_10360 | train | T2 |
v3 | Schema:
shipments (alias: shp)(code, name, date, status)
invoices(type, value, id, code)
Task: Find id from shipments where salary exceeds the average amount from invoices for the same status.
SQL: | SELECT id FROM shipments AS shp
WHERE salary > (
SELECT COUNT(amount) FROM invoices AS inv
WHERE inv.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_10361 | train | T2 |
v1 | Schema:
categories (alias: catg)(name, id, value, date)
budgets(code, salary, amount, name)
Task: Retrieve code from categories whose level is found in budgets rows where code matches the outer record.
SQL: | SELECT code FROM categories AS catg
WHERE level IN (
SELECT level FROM budgets AS budg
WHERE budg.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "budgets",
"outer_alias": "catg",
"inner_alias": "budg",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_10362 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(code, id, name, value)
budgets(type, salary, status, date)
Task: Retrieve amount from warehouses with salary above the SUM(salary) of budgets rows sharing the same id.
SQL: | SELECT amount FROM warehouses AS whs
WHERE salary > (
SELECT SUM(salary) FROM budgets AS budg
WHERE budg.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "budgets",
"outer_alias": "whs",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_10363 | train | T2 |
v2 | Schema:
schedules (alias: schd)(level, salary, status, code)
managers(salary, date, value, name)
Task: Retrieve id from schedules that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_10364 | train | T2 |
v3 | Schema:
transactions (alias: txn)(code, amount, level, name)
managers(status, date, salary, value)
Task: Retrieve code from transactions with amount above the MAX(salary) of managers rows sharing the same type.
SQL: | SELECT code FROM transactions AS txn
WHERE amount > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_10365 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(code, level, id, status)
shipments(type, code, amount, salary)
Task: Retrieve code from warehouses with salary above the MIN(salary) of shipments rows sharing the same code.
SQL: | SELECT code FROM warehouses AS whs
WHERE salary > (
SELECT MIN(salary) FROM shipments AS shp
WHERE shp.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "shipments",
"outer_alias": "whs",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_10366 | train | T2 |
v2 | Schema:
transactions (alias: txn)(level, type, name, date)
requests(status, name, level, amount)
Task: Retrieve salary from transactions that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_10367 | train | T1 |
v3 | Schema:
sales (alias: sale)(code, amount, level, status)
invoices(type, date, level, status)
Task: Retrieve salary from sales with value above the MIN(salary) of invoices rows sharing the same level.
SQL: | SELECT salary FROM sales AS sale
WHERE value > (
SELECT MIN(salary) FROM invoices AS inv
WHERE inv.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_10368 | train | T1 |
v2 | Schema:
regions (alias: rgn)(value, type, date, id)
invoices(date, name, value, type)
Task: Retrieve code from regions that have at least one corresponding entry in invoices sharing the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_10369 | train | T2 |
v3 | Schema:
categories (alias: catg)(level, value, id, code)
sales(name, date, code, status)
Task: Find value from categories where value exceeds the average value from sales for the same code.
SQL: | SELECT value FROM categories AS catg
WHERE value > (
SELECT MAX(value) FROM sales AS sale
WHERE sale.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_10370 | train | T2 |
v3 | Schema:
orders (alias: ord)(date, salary, amount, value)
warehouses(id, amount, name, code)
Task: Find salary from orders where value exceeds the average salary from warehouses for the same id.
SQL: | SELECT salary FROM orders AS ord
WHERE value > (
SELECT MAX(salary) FROM warehouses AS whs
WHERE whs.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "warehouses",
"outer_alias": "ord",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_10371 | train | T1 |
v3 | Schema:
accounts (alias: acct)(date, code, type, amount)
services(level, date, salary, value)
Task: Retrieve amount from accounts with amount above the COUNT(value) of services rows sharing the same level.
SQL: | SELECT amount FROM accounts AS acct
WHERE amount > (
SELECT COUNT(value) FROM services AS srvc
WHERE srvc.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "services",
"outer_alias": "acct",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_10372 | train | T1 |
v2 | Schema:
employees (alias: emp)(code, status, value, type)
transactions(salary, date, status, level)
Task: Retrieve name from employees that have at least one corresponding entry in transactions sharing the same code.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_10373 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(name, date, code, value)
shipments(amount, value, id, salary)
Task: Select amount from warehouses where code exists in shipments for the same code.
SQL: | SELECT amount FROM warehouses AS whs
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "shipments",
"outer_alias": "whs",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_10374 | train | T2 |
v1 | Schema:
managers (alias: mgr)(status, type, date, code)
warehouses(name, status, code, date)
Task: Select salary from managers where level exists in warehouses for the same code.
SQL: | SELECT salary FROM managers AS mgr
WHERE level IN (
SELECT level FROM warehouses AS whs
WHERE whs.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "warehouses",
"outer_alias": "mgr",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_10375 | train | T1 |
v3 | Schema:
departments (alias: dept)(level, status, value, code)
warehouses(type, salary, code, amount)
Task: Retrieve salary from departments with value above the MAX(salary) of warehouses rows sharing the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE value > (
SELECT MAX(salary) FROM warehouses AS whs
WHERE whs.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "warehouses",
"outer_alias": "dept",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_10376 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(date, type, code, value)
accounts(id, type, code, status)
Task: Find id from warehouses where a matching record exists in accounts with the same level.
SQL: | SELECT id FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "accounts",
"outer_alias": "whs",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_10377 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(amount, value, code, level)
orders(salary, amount, date, name)
Task: Retrieve code from warehouses whose status is found in orders rows where id matches the outer record.
SQL: | SELECT code FROM warehouses AS whs
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "orders",
"outer_alias": "whs",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_10378 | train | T2 |
v2 | Schema:
requests (alias: ordr)(id, value, level, name)
schedules(date, level, status, value)
Task: Retrieve value from requests that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_10379 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(name, salary, amount, date)
regions(id, type, value, status)
Task: Find salary from warehouses where salary exceeds the average salary from regions for the same status.
SQL: | SELECT salary FROM warehouses AS whs
WHERE salary > (
SELECT AVG(salary) FROM regions AS rgn
WHERE rgn.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "regions",
"outer_alias": "whs",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_10380 | train | T2 |
v3 | Schema:
schedules (alias: schd)(date, level, type, code)
departments(date, id, level, name)
Task: Retrieve amount from schedules with salary above the MAX(value) of departments rows sharing the same type.
SQL: | SELECT amount FROM schedules AS schd
WHERE salary > (
SELECT MAX(value) FROM departments AS dept
WHERE dept.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_10381 | train | T2 |
v2 | Schema:
accounts (alias: acct)(value, amount, level, salary)
employees(level, code, name, date)
Task: Find salary from accounts where a matching record exists in employees with the same level.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_10382 | train | T1 |
v1 | Schema:
transactions (alias: txn)(id, name, status, salary)
invoices(name, date, status, level)
Task: Find value from transactions where status appears in invoices entries with matching status.
SQL: | SELECT value FROM transactions AS txn
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_10383 | train | T1 |
v3 | Schema:
schedules (alias: schd)(status, level, type, name)
accounts(type, date, value, name)
Task: Retrieve amount from schedules with amount above the COUNT(salary) of accounts rows sharing the same type.
SQL: | SELECT amount FROM schedules AS schd
WHERE amount > (
SELECT COUNT(salary) FROM accounts AS acct
WHERE acct.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_10384 | train | T2 |
v2 | Schema:
employees (alias: emp)(code, type, id, value)
warehouses(code, name, status, type)
Task: Retrieve code from employees that have at least one corresponding entry in warehouses sharing the same code.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "warehouses",
"outer_alias": "emp",
"inner_alias": "whs",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_10385 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(status, id, value, level)
orders(date, value, id, level)
Task: Find name from warehouses where salary exceeds the average amount from orders for the same status.
SQL: | SELECT name FROM warehouses AS whs
WHERE salary > (
SELECT COUNT(amount) FROM orders AS ord
WHERE ord.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "orders",
"outer_alias": "whs",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_10386 | train | T2 |
v1 | Schema:
invoices (alias: inv)(date, value, status, id)
warehouses(value, amount, name, date)
Task: Find value from invoices where level appears in warehouses entries with matching status.
SQL: | SELECT value FROM invoices AS inv
WHERE level IN (
SELECT level FROM warehouses AS whs
WHERE whs.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "warehouses",
"outer_alias": "inv",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_10387 | train | T1 |
v3 | Schema:
shipments (alias: shp)(type, id, salary, value)
staff(amount, salary, name, status)
Task: Retrieve value from shipments with value above the MAX(value) of staff rows sharing the same id.
SQL: | SELECT value FROM shipments AS shp
WHERE value > (
SELECT MAX(value) FROM staff AS empl
WHERE empl.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_10388 | train | T2 |
v3 | Schema:
invoices (alias: inv)(name, date, status, level)
orders(name, type, salary, date)
Task: Retrieve name from invoices with salary above the SUM(value) of orders rows sharing the same level.
SQL: | SELECT name FROM invoices AS inv
WHERE salary > (
SELECT SUM(value) FROM orders AS ord
WHERE ord.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_10389 | train | T1 |
v3 | Schema:
sales (alias: sale)(level, value, code, id)
accounts(status, code, date, amount)
Task: Find id from sales where amount exceeds the average amount from accounts for the same status.
SQL: | SELECT id FROM sales AS sale
WHERE amount > (
SELECT COUNT(amount) FROM accounts AS acct
WHERE acct.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_10390 | train | T1 |
v1 | Schema:
requests (alias: ordr)(name, id, level, code)
sales(id, status, level, value)
Task: Select id from requests where level exists in sales for the same status.
SQL: | SELECT id FROM requests AS ordr
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_10391 | train | T2 |
v2 | Schema:
items (alias: lne)(amount, value, level, date)
employees(value, date, status, name)
Task: Retrieve value from items that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = lne.status
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_10392 | train | T2 |
v3 | Schema:
budgets (alias: budg)(value, name, salary, date)
employees(level, code, date, status)
Task: Retrieve code from budgets with salary above the AVG(amount) of employees rows sharing the same type.
SQL: | SELECT code FROM budgets AS budg
WHERE salary > (
SELECT AVG(amount) FROM employees AS emp
WHERE emp.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "employees",
"outer_alias": "budg",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_10393 | train | T2 |
v2 | Schema:
staff (alias: empl)(id, level, name, salary)
transactions(salary, value, code, name)
Task: Retrieve code from staff that have at least one corresponding entry in transactions sharing the same code.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_10394 | train | T2 |
v2 | Schema:
shipments (alias: shp)(name, level, code, value)
sales(salary, level, amount, name)
Task: Find amount from shipments where a matching record exists in sales with the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_10395 | train | T2 |
v2 | Schema:
managers (alias: mgr)(type, amount, code, id)
employees(amount, salary, value, date)
Task: Retrieve id from managers that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_10396 | train | T1 |
v3 | Schema:
orders (alias: ord)(id, status, type, amount)
regions(date, id, level, type)
Task: Find name from orders where amount exceeds the average amount from regions for the same id.
SQL: | SELECT name FROM orders AS ord
WHERE amount > (
SELECT COUNT(amount) FROM regions AS rgn
WHERE rgn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_10397 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(code, name, amount, level)
customers(salary, id, status, code)
Task: Retrieve id from warehouses with value above the AVG(value) of customers rows sharing the same type.
SQL: | SELECT id FROM warehouses AS whs
WHERE value > (
SELECT AVG(value) FROM customers AS cust
WHERE cust.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "customers",
"outer_alias": "whs",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_10398 | train | T2 |
v2 | Schema:
items (alias: lne)(level, date, status, salary)
sales(value, salary, type, date)
Task: Retrieve id from items that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = lne.level
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_10399 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.