variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v1 | Schema:
customers (alias: cust)(type, salary, date, value)
schedules(type, salary, value, code)
Task: Retrieve amount from customers whose status is found in schedules rows where id matches the outer record.
SQL: | SELECT amount 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": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08400 | train |
v2 | Schema:
requests (alias: ordr)(id, date, salary, amount)
sales(type, status, amount, id)
Task: Find code from requests where a matching record exists in sales with the same type.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08401 | train |
v1 | Schema:
departments (alias: dept)(status, code, date, type)
shipments(value, name, id, salary)
Task: Select salary from departments where level exists in shipments for the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08402 | train |
v3 | Schema:
products (alias: prod)(value, amount, type, id)
managers(name, id, level, status)
Task: Find code from products where salary exceeds the average salary from managers for the same level.
SQL: | SELECT code FROM products AS prod
WHERE salary > (
SELECT AVG(salary) FROM managers AS mgr
WHERE mgr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08403 | train |
v1 | Schema:
accounts (alias: acct)(level, date, amount, value)
tasks(name, status, value, level)
Task: Find name from accounts where status appears in tasks entries with matching code.
SQL: | SELECT name FROM accounts AS acct
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08404 | train |
v3 | Schema:
sales (alias: sale)(value, level, name, code)
tasks(status, code, name, id)
Task: Find salary from sales where value exceeds the minimum amount from tasks for the same type.
SQL: | SELECT salary FROM sales AS sale
WHERE value > (
SELECT MIN(amount) FROM tasks AS tsk
WHERE tsk.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08405 | train |
v2 | Schema:
items (alias: lne)(name, type, status, date)
categories(value, date, id, status)
Task: Find value from items where a matching record exists in categories with the same type.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = lne.type
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08406 | train |
v2 | Schema:
customers (alias: cust)(amount, date, status, value)
managers(amount, id, salary, value)
Task: Find amount from customers where a matching record exists in managers with the same type.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08407 | train |
v1 | Schema:
branches (alias: brc)(salary, id, code, value)
requests(code, name, salary, status)
Task: Retrieve code from branches whose status is found in requests rows where id matches the outer record.
SQL: | SELECT code FROM branches AS brc
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08408 | train |
v1 | Schema:
tasks (alias: tsk)(date, name, id, value)
accounts(type, code, value, status)
Task: Select code from tasks where type exists in accounts for the same type.
SQL: | SELECT code FROM tasks AS tsk
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08409 | train |
v1 | Schema:
categories (alias: catg)(date, status, id, code)
customers(id, date, code, level)
Task: Retrieve name from categories whose id is found in customers rows where code matches the outer record.
SQL: | SELECT name FROM categories AS catg
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08410 | train |
v3 | Schema:
regions (alias: rgn)(status, date, amount, name)
schedules(code, value, level, date)
Task: Retrieve amount from regions with value above the COUNT(amount) of schedules rows sharing the same status.
SQL: | SELECT amount FROM regions AS rgn
WHERE value > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08411 | train |
v3 | Schema:
branches (alias: brc)(level, code, status, amount)
orders(salary, level, status, code)
Task: Retrieve name from branches with salary above the AVG(amount) of orders rows sharing the same type.
SQL: | SELECT name FROM branches AS brc
WHERE salary > (
SELECT AVG(amount) FROM orders AS ord
WHERE ord.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08412 | train |
v2 | Schema:
orders (alias: ord)(salary, value, level, status)
schedules(id, status, name, amount)
Task: Find salary from orders where a matching record exists in schedules with the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08413 | train |
v1 | Schema:
invoices (alias: inv)(type, status, name, amount)
accounts(level, amount, status, code)
Task: Find salary from invoices where id appears in accounts entries with matching status.
SQL: | SELECT salary FROM invoices AS inv
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08414 | train |
v1 | Schema:
employees (alias: emp)(code, date, id, status)
items(status, level, code, type)
Task: Find id from employees where id appears in items entries with matching code.
SQL: | SELECT id FROM employees AS emp
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08415 | train |
v3 | Schema:
invoices (alias: inv)(level, status, value, amount)
categories(code, status, amount, value)
Task: Find salary from invoices where value exceeds the count of amount from categories for the same type.
SQL: | SELECT salary FROM invoices AS inv
WHERE value > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08416 | train |
v2 | Schema:
categories (alias: catg)(date, name, type, code)
sales(status, type, date, salary)
Task: Retrieve id from categories that have at least one corresponding entry in sales sharing the same status.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08417 | train |
v1 | Schema:
accounts (alias: acct)(date, level, code, type)
transactions(status, code, name, salary)
Task: Select amount from accounts where code exists in transactions for the same level.
SQL: | SELECT amount FROM accounts AS acct
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08418 | train |
v1 | Schema:
categories (alias: catg)(salary, code, value, status)
managers(id, salary, code, status)
Task: Find id from categories where id appears in managers entries with matching level.
SQL: | SELECT id FROM categories AS catg
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08419 | train |
v2 | Schema:
sales (alias: sale)(amount, value, date, salary)
regions(date, id, level, type)
Task: Find value from sales where a matching record exists in regions with the same code.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08420 | train |
v3 | Schema:
products (alias: prod)(level, value, type, date)
branches(name, type, date, id)
Task: Find code from products where amount exceeds the maximum salary from branches for the same status.
SQL: | SELECT code FROM products AS prod
WHERE amount > (
SELECT MAX(salary) FROM branches AS brc
WHERE brc.status = prod.status
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08421 | train |
v1 | Schema:
invoices (alias: inv)(level, name, salary, status)
schedules(salary, status, level, date)
Task: Retrieve amount from invoices whose level is found in schedules rows where level matches the outer record.
SQL: | SELECT amount FROM invoices AS inv
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08422 | train |
v2 | Schema:
shipments (alias: shp)(id, salary, value, type)
invoices(name, id, status, date)
Task: Retrieve value from shipments that have at least one corresponding entry in invoices sharing the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08423 | train |
v1 | Schema:
transactions (alias: txn)(status, date, type, amount)
projects(type, level, value, status)
Task: Find code from transactions where level appears in projects entries with matching status.
SQL: | SELECT code FROM transactions AS txn
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08424 | train |
v3 | Schema:
tasks (alias: tsk)(amount, name, salary, id)
schedules(level, amount, status, code)
Task: Retrieve value from tasks with salary above the MIN(salary) of schedules rows sharing the same type.
SQL: | SELECT value FROM tasks AS tsk
WHERE salary > (
SELECT MIN(salary) FROM schedules AS schd
WHERE schd.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08425 | train |
v2 | Schema:
tasks (alias: tsk)(id, level, amount, type)
shipments(salary, id, type, status)
Task: Find name from tasks where a matching record exists in shipments with the same type.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08426 | train |
v1 | Schema:
products (alias: prod)(type, amount, name, id)
managers(type, value, id, amount)
Task: Retrieve name from products whose status is found in managers rows where id matches the outer record.
SQL: | SELECT name FROM products AS prod
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.id = prod.id
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08427 | train |
v2 | Schema:
shipments (alias: shp)(salary, code, id, amount)
employees(name, level, amount, id)
Task: Find amount from shipments where a matching record exists in employees with the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08428 | train |
v1 | Schema:
tasks (alias: tsk)(amount, id, status, salary)
transactions(date, name, value, salary)
Task: Retrieve amount from tasks whose status is found in transactions rows where id matches the outer record.
SQL: | SELECT amount FROM tasks AS tsk
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08429 | train |
v3 | Schema:
invoices (alias: inv)(value, level, salary, status)
accounts(date, code, value, level)
Task: Retrieve value from invoices with value above the MAX(salary) of accounts rows sharing the same status.
SQL: | SELECT value FROM invoices AS inv
WHERE value > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08430 | train |
v2 | Schema:
staff (alias: empl)(status, level, type, salary)
products(id, code, status, salary)
Task: Find value from staff where a matching record exists in products with the same code.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08431 | train |
v3 | Schema:
accounts (alias: acct)(value, amount, date, status)
transactions(code, id, value, amount)
Task: Retrieve name from accounts with amount above the MAX(value) of transactions rows sharing the same status.
SQL: | SELECT name FROM accounts AS acct
WHERE amount > (
SELECT MAX(value) FROM transactions AS txn
WHERE txn.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08432 | train |
v2 | Schema:
orders (alias: ord)(salary, level, id, amount)
items(status, level, salary, amount)
Task: Find value from orders where a matching record exists in items with the same status.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08433 | train |
v2 | Schema:
sales (alias: sale)(code, date, type, value)
managers(salary, name, amount, type)
Task: Retrieve value from sales that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08434 | train |
v1 | Schema:
managers (alias: mgr)(amount, code, status, name)
accounts(status, date, id, amount)
Task: Retrieve id from managers whose level is found in accounts rows where level matches the outer record.
SQL: | SELECT id FROM managers AS mgr
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08435 | train |
v1 | Schema:
invoices (alias: inv)(code, salary, date, type)
tasks(salary, amount, status, value)
Task: Find salary from invoices where level appears in tasks entries with matching code.
SQL: | SELECT salary FROM invoices AS inv
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08436 | train |
v3 | Schema:
shipments (alias: shp)(value, name, level, code)
managers(value, id, type, code)
Task: Retrieve amount from shipments with salary above the COUNT(salary) of managers rows sharing the same level.
SQL: | SELECT amount FROM shipments AS shp
WHERE salary > (
SELECT COUNT(salary) FROM managers AS mgr
WHERE mgr.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08437 | train |
v1 | Schema:
managers (alias: mgr)(code, value, status, type)
orders(id, value, status, type)
Task: Retrieve code from managers whose code is found in orders rows where status matches the outer record.
SQL: | SELECT code FROM managers AS mgr
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08438 | train |
v2 | Schema:
managers (alias: mgr)(code, id, level, salary)
orders(level, status, value, id)
Task: Find amount from managers where a matching record exists in orders with the same id.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08439 | train |
v1 | Schema:
shipments (alias: shp)(level, salary, status, type)
accounts(value, date, amount, code)
Task: Retrieve id from shipments whose level is found in accounts rows where status matches the outer record.
SQL: | SELECT id FROM shipments AS shp
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08440 | train |
v3 | Schema:
invoices (alias: inv)(amount, level, name, id)
shipments(id, code, name, amount)
Task: Retrieve code from invoices with value above the AVG(salary) of shipments rows sharing the same level.
SQL: | SELECT code FROM invoices AS inv
WHERE value > (
SELECT AVG(salary) FROM shipments AS shp
WHERE shp.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08441 | train |
v2 | Schema:
accounts (alias: acct)(salary, name, date, id)
departments(name, status, level, type)
Task: Find value from accounts where a matching record exists in departments with the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08442 | train |
v1 | Schema:
managers (alias: mgr)(date, salary, status, id)
customers(type, id, level, amount)
Task: Select code from managers where level exists in customers for the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08443 | train |
v3 | Schema:
branches (alias: brc)(code, date, amount, type)
orders(name, id, amount, date)
Task: Retrieve amount from branches with salary above the MAX(value) of orders rows sharing the same type.
SQL: | SELECT amount FROM branches AS brc
WHERE salary > (
SELECT MAX(value) FROM orders AS ord
WHERE ord.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08444 | train |
v3 | Schema:
shipments (alias: shp)(name, salary, type, date)
managers(type, date, name, amount)
Task: Find code from shipments where salary exceeds the minimum amount from managers for the same code.
SQL: | SELECT code FROM shipments AS shp
WHERE salary > (
SELECT MIN(amount) FROM managers AS mgr
WHERE mgr.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08445 | train |
v3 | Schema:
regions (alias: rgn)(amount, code, level, status)
branches(name, level, salary, type)
Task: Retrieve code from regions with salary above the AVG(salary) of branches rows sharing the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE salary > (
SELECT AVG(salary) FROM branches AS brc
WHERE brc.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08446 | train |
v2 | Schema:
tasks (alias: tsk)(level, code, amount, type)
customers(id, level, code, amount)
Task: Retrieve code from tasks that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "tsk",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08447 | train |
v3 | Schema:
tasks (alias: tsk)(type, name, date, salary)
invoices(status, salary, level, value)
Task: Find amount from tasks where value exceeds the maximum amount from invoices for the same type.
SQL: | SELECT amount FROM tasks AS tsk
WHERE value > (
SELECT MAX(amount) FROM invoices AS inv
WHERE inv.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08448 | train |
v3 | Schema:
accounts (alias: acct)(value, status, level, name)
items(name, salary, status, value)
Task: Find salary from accounts where amount exceeds the count of value from items for the same id.
SQL: | SELECT salary FROM accounts AS acct
WHERE amount > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08449 | train |
v3 | Schema:
items (alias: lne)(id, salary, name, type)
requests(status, amount, level, type)
Task: Find code from items where salary exceeds the count of salary from requests for the same id.
SQL: | SELECT code FROM items AS lne
WHERE salary > (
SELECT COUNT(salary) FROM requests AS ordr
WHERE ordr.id = lne.id
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08450 | train |
v2 | Schema:
departments (alias: dept)(date, type, name, status)
staff(status, value, type, date)
Task: Find salary from departments where a matching record exists in staff with the same code.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08451 | train |
v2 | Schema:
branches (alias: brc)(date, name, id, level)
staff(level, type, name, salary)
Task: Retrieve amount from branches that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08452 | train |
v1 | Schema:
regions (alias: rgn)(name, status, value, level)
shipments(value, name, amount, id)
Task: Select salary from regions where level exists in shipments for the same code.
SQL: | SELECT salary FROM regions AS rgn
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08453 | train |
v1 | Schema:
departments (alias: dept)(type, date, amount, salary)
accounts(code, amount, salary, date)
Task: Select salary from departments where status exists in accounts for the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08454 | train |
v1 | Schema:
invoices (alias: inv)(amount, type, salary, level)
regions(value, salary, date, name)
Task: Retrieve salary from invoices whose status is found in regions rows where type matches the outer record.
SQL: | SELECT salary FROM invoices AS inv
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08455 | train |
v2 | Schema:
invoices (alias: inv)(salary, type, code, value)
shipments(salary, status, amount, date)
Task: Retrieve code from invoices that have at least one corresponding entry in shipments sharing the same level.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08456 | train |
v3 | Schema:
regions (alias: rgn)(id, code, salary, type)
items(name, status, code, date)
Task: Find id from regions where salary exceeds the maximum amount from items for the same type.
SQL: | SELECT id FROM regions AS rgn
WHERE salary > (
SELECT MAX(amount) FROM items AS lne
WHERE lne.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08457 | train |
v2 | Schema:
schedules (alias: schd)(code, status, value, id)
items(type, id, salary, value)
Task: Find name from schedules where a matching record exists in items with the same level.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08458 | train |
v2 | Schema:
projects (alias: prj)(amount, id, code, date)
managers(value, code, salary, status)
Task: Retrieve salary from projects that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08459 | train |
v1 | Schema:
employees (alias: emp)(value, code, date, id)
projects(type, id, level, date)
Task: Select amount from employees where code exists in projects for the same code.
SQL: | SELECT amount FROM employees AS emp
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "projects",
"outer_alias": "emp",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08460 | train |
v1 | Schema:
projects (alias: prj)(date, code, salary, level)
items(value, type, name, id)
Task: Select name from projects where type exists in items for the same level.
SQL: | SELECT name FROM projects AS prj
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08461 | train |
v1 | Schema:
categories (alias: catg)(salary, status, value, code)
accounts(salary, status, name, code)
Task: Retrieve name from categories whose level is found in accounts rows where code matches the outer record.
SQL: | SELECT name FROM categories AS catg
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08462 | train |
v2 | Schema:
managers (alias: mgr)(date, level, code, amount)
products(level, code, name, value)
Task: Find amount from managers where a matching record exists in products with the same id.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08463 | train |
v2 | Schema:
orders (alias: ord)(id, name, value, date)
categories(value, level, date, status)
Task: Find id from orders where a matching record exists in categories with the same code.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08464 | train |
v2 | Schema:
projects (alias: prj)(type, amount, status, value)
managers(name, id, type, level)
Task: Retrieve value from projects that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08465 | train |
v3 | Schema:
products (alias: prod)(status, code, id, salary)
managers(type, salary, name, code)
Task: Retrieve code from products with amount above the COUNT(value) of managers rows sharing the same code.
SQL: | SELECT code FROM products AS prod
WHERE amount > (
SELECT COUNT(value) FROM managers AS mgr
WHERE mgr.code = prod.code
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08466 | train |
v3 | Schema:
regions (alias: rgn)(code, salary, name, id)
tasks(date, type, salary, code)
Task: Find value from regions where amount exceeds the total salary from tasks for the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE amount > (
SELECT SUM(salary) FROM tasks AS tsk
WHERE tsk.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08467 | train |
v2 | Schema:
invoices (alias: inv)(amount, value, status, salary)
accounts(type, name, code, level)
Task: Find id from invoices where a matching record exists in accounts with the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08468 | train |
v1 | Schema:
categories (alias: catg)(name, amount, id, value)
requests(amount, code, salary, value)
Task: Retrieve value from categories whose code is found in requests rows where level matches the outer record.
SQL: | SELECT value FROM categories AS catg
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08469 | train |
v1 | Schema:
shipments (alias: shp)(date, level, type, salary)
transactions(id, status, type, value)
Task: Retrieve name from shipments whose status is found in transactions rows where code matches the outer record.
SQL: | SELECT name FROM shipments AS shp
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08470 | train |
v3 | Schema:
projects (alias: prj)(status, code, name, date)
regions(date, amount, value, status)
Task: Retrieve amount from projects with salary above the AVG(salary) of regions rows sharing the same level.
SQL: | SELECT amount FROM projects AS prj
WHERE salary > (
SELECT AVG(salary) FROM regions AS rgn
WHERE rgn.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08471 | train |
v1 | Schema:
branches (alias: brc)(date, amount, salary, level)
regions(date, value, type, id)
Task: Find code from branches where level appears in regions entries with matching code.
SQL: | SELECT code FROM branches AS brc
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08472 | train |
v1 | Schema:
products (alias: prod)(id, name, salary, code)
regions(type, amount, code, name)
Task: Retrieve id from products whose code is found in regions rows where code matches the outer record.
SQL: | SELECT id FROM products AS prod
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.code = prod.code
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08473 | train |
v1 | Schema:
regions (alias: rgn)(code, salary, name, level)
shipments(status, code, level, date)
Task: Retrieve code from regions whose type is found in shipments rows where status matches the outer record.
SQL: | SELECT code FROM regions AS rgn
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08474 | train |
v1 | Schema:
categories (alias: catg)(level, date, id, value)
invoices(code, id, status, type)
Task: Select name from categories where code exists in invoices for the same type.
SQL: | SELECT name FROM categories AS catg
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08475 | train |
v3 | Schema:
transactions (alias: txn)(code, level, salary, amount)
sales(level, salary, type, value)
Task: Retrieve amount from transactions with salary above the MIN(value) of sales rows sharing the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE salary > (
SELECT MIN(value) FROM sales AS sale
WHERE sale.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08476 | train |
v2 | Schema:
branches (alias: brc)(salary, type, date, value)
schedules(salary, date, level, code)
Task: Find name from branches where a matching record exists in schedules with the same status.
SQL: | SELECT name FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "schedules",
"outer_alias": "brc",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08477 | train |
v1 | Schema:
branches (alias: brc)(code, amount, level, id)
tasks(value, salary, code, name)
Task: Find name from branches where type appears in tasks entries with matching status.
SQL: | SELECT name FROM branches AS brc
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08478 | train |
v2 | Schema:
invoices (alias: inv)(name, value, date, amount)
products(status, date, name, type)
Task: Retrieve name from invoices that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08479 | train |
v3 | Schema:
shipments (alias: shp)(name, level, status, type)
sales(status, amount, code, name)
Task: Find id from shipments where value exceeds the maximum amount from sales for the same level.
SQL: | SELECT id FROM shipments AS shp
WHERE value > (
SELECT MAX(amount) FROM sales AS sale
WHERE sale.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08480 | train |
v2 | Schema:
customers (alias: cust)(salary, status, value, amount)
regions(value, amount, level, type)
Task: Retrieve salary from customers that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08481 | train |
v2 | Schema:
invoices (alias: inv)(value, level, amount, type)
accounts(salary, value, name, level)
Task: Retrieve name from invoices that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08482 | train |
v3 | Schema:
invoices (alias: inv)(id, level, status, amount)
products(salary, name, id, amount)
Task: Find amount from invoices where amount exceeds the average amount from products for the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE amount > (
SELECT AVG(amount) FROM products AS prod
WHERE prod.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08483 | train |
v2 | Schema:
staff (alias: empl)(salary, amount, code, id)
employees(date, salary, amount, value)
Task: Find name from staff where a matching record exists in employees with the same status.
SQL: | SELECT name 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": "name",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08484 | train |
v3 | Schema:
sales (alias: sale)(id, amount, date, name)
tasks(name, type, status, date)
Task: Find amount from sales where value exceeds the maximum amount from tasks for the same status.
SQL: | SELECT amount FROM sales AS sale
WHERE value > (
SELECT MAX(amount) FROM tasks AS tsk
WHERE tsk.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08485 | train |
v1 | Schema:
categories (alias: catg)(id, code, value, amount)
invoices(status, id, salary, value)
Task: Retrieve code from categories whose id is found in invoices rows where status matches the outer record.
SQL: | SELECT code FROM categories AS catg
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08486 | train |
v2 | Schema:
branches (alias: brc)(code, amount, salary, status)
invoices(date, amount, type, code)
Task: Retrieve id from branches that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08487 | train |
v2 | Schema:
staff (alias: empl)(value, level, id, name)
tasks(id, status, type, salary)
Task: Retrieve name from staff that have at least one corresponding entry in tasks sharing the same code.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08488 | train |
v3 | Schema:
departments (alias: dept)(type, salary, value, code)
projects(amount, salary, id, type)
Task: Find salary from departments where salary exceeds the average salary from projects for the same level.
SQL: | SELECT salary FROM departments AS dept
WHERE salary > (
SELECT AVG(salary) FROM projects AS prj
WHERE prj.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08489 | train |
v1 | Schema:
projects (alias: prj)(code, name, amount, salary)
requests(code, amount, value, status)
Task: Retrieve salary from projects whose type is found in requests rows where code matches the outer record.
SQL: | SELECT salary FROM projects AS prj
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08490 | train |
v1 | Schema:
requests (alias: ordr)(date, level, type, id)
categories(amount, type, date, value)
Task: Select value from requests where level exists in categories for the same id.
SQL: | SELECT value FROM requests AS ordr
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08491 | train |
v2 | Schema:
requests (alias: ordr)(code, name, value, date)
categories(date, amount, salary, value)
Task: Retrieve name from requests that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08492 | train |
v1 | Schema:
customers (alias: cust)(name, code, amount, status)
staff(amount, name, value, date)
Task: Select code from customers where status exists in staff for the same type.
SQL: | SELECT code FROM customers AS cust
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08493 | train |
v1 | Schema:
shipments (alias: shp)(id, type, status, code)
accounts(status, name, code, amount)
Task: Find code from shipments where id appears in accounts entries with matching id.
SQL: | SELECT code FROM shipments AS shp
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08494 | train |
v1 | Schema:
accounts (alias: acct)(date, type, value, level)
managers(amount, id, type, name)
Task: Retrieve id from accounts whose id is found in managers rows where type matches the outer record.
SQL: | SELECT id FROM accounts AS acct
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08495 | train |
v2 | Schema:
requests (alias: ordr)(code, date, type, salary)
branches(id, code, date, salary)
Task: Find salary from requests where a matching record exists in branches with the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08496 | train |
v3 | Schema:
items (alias: lne)(amount, level, date, name)
invoices(amount, code, salary, value)
Task: Retrieve amount from items with amount above the MIN(salary) of invoices rows sharing the same status.
SQL: | SELECT amount FROM items AS lne
WHERE amount > (
SELECT MIN(salary) FROM invoices AS inv
WHERE inv.status = lne.status
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08497 | train |
v3 | Schema:
requests (alias: ordr)(name, amount, type, level)
products(value, id, date, status)
Task: Find code from requests where salary exceeds the minimum value from products for the same type.
SQL: | SELECT code FROM requests AS ordr
WHERE salary > (
SELECT MIN(value) FROM products AS prod
WHERE prod.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08498 | train |
v1 | Schema:
requests (alias: ordr)(amount, type, status, level)
sales(type, salary, status, level)
Task: Retrieve id from requests whose level is found in sales rows where code matches the outer record.
SQL: | SELECT id FROM requests AS ordr
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08499 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.