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 |
|---|---|---|---|---|---|---|
v3 | Schema:
orders (alias: ord)(amount, date, status, level)
tasks(id, salary, status, value)
Task: Retrieve id from orders with value above the SUM(amount) of tasks rows sharing the same code.
SQL: | SELECT id FROM orders AS ord
WHERE value > (
SELECT SUM(amount) FROM tasks AS tsk
WHERE tsk.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16500 | train |
v3 | Schema:
requests (alias: ordr)(status, value, code, amount)
regions(code, level, id, amount)
Task: Retrieve value from requests with value above the MAX(amount) of regions rows sharing the same level.
SQL: | SELECT value FROM requests AS ordr
WHERE value > (
SELECT MAX(amount) FROM regions AS rgn
WHERE rgn.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16501 | train |
v2 | Schema:
items (alias: lne)(value, amount, date, level)
projects(status, amount, salary, date)
Task: Find name from items where a matching record exists in projects with the same code.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = lne.code
); | {
"outer_table": "items",
"inner_table": "projects",
"outer_alias": "lne",
"inner_alias": "prj",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16502 | train |
v1 | Schema:
categories (alias: catg)(code, name, date, type)
tasks(id, amount, salary, value)
Task: Select name from categories where level exists in tasks for the same id.
SQL: | SELECT name FROM categories AS catg
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16503 | train |
v3 | Schema:
schedules (alias: schd)(name, status, id, value)
regions(value, name, level, date)
Task: Find code from schedules where salary exceeds the minimum value from regions for the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE salary > (
SELECT MIN(value) FROM regions AS rgn
WHERE rgn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16504 | train |
v3 | Schema:
orders (alias: ord)(status, level, type, date)
categories(id, date, salary, code)
Task: Find amount from orders where salary exceeds the average salary from categories for the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE salary > (
SELECT AVG(salary) FROM categories AS catg
WHERE catg.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16505 | train |
v2 | Schema:
accounts (alias: acct)(value, id, level, status)
staff(type, name, code, salary)
Task: Find name from accounts where a matching record exists in staff with the same status.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16506 | train |
v2 | Schema:
orders (alias: ord)(status, type, salary, amount)
accounts(value, date, code, name)
Task: Retrieve code from orders that have at least one corresponding entry in accounts sharing the same type.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16507 | train |
v1 | Schema:
orders (alias: ord)(date, value, code, level)
managers(name, amount, value, id)
Task: Find name from orders where code appears in managers entries with matching type.
SQL: | SELECT name FROM orders AS ord
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16508 | train |
v2 | Schema:
sales (alias: sale)(level, type, salary, amount)
requests(salary, level, type, code)
Task: Retrieve salary from sales that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16509 | train |
v1 | Schema:
transactions (alias: txn)(amount, level, date, type)
items(type, status, value, salary)
Task: Select code from transactions where status exists in items for the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16510 | train |
v1 | Schema:
projects (alias: prj)(date, level, status, name)
tasks(value, salary, type, level)
Task: Retrieve value from projects whose id is found in tasks rows where id matches the outer record.
SQL: | SELECT value FROM projects AS prj
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "prj",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16511 | train |
v2 | Schema:
orders (alias: ord)(name, date, id, status)
shipments(amount, value, type, status)
Task: Find amount from orders where a matching record exists in shipments with the same id.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16512 | train |
v1 | Schema:
managers (alias: mgr)(code, type, salary, level)
accounts(salary, code, value, date)
Task: Select name from managers where type exists in accounts for the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16513 | train |
v1 | Schema:
sales (alias: sale)(value, salary, amount, date)
shipments(status, amount, id, salary)
Task: Retrieve code from sales whose status is found in shipments rows where code matches the outer record.
SQL: | SELECT code FROM sales AS sale
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16514 | train |
v3 | Schema:
sales (alias: sale)(level, code, salary, value)
transactions(status, salary, type, amount)
Task: Find id from sales where salary exceeds the count of amount from transactions for the same id.
SQL: | SELECT id FROM sales AS sale
WHERE salary > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16515 | train |
v3 | Schema:
sales (alias: sale)(id, code, type, salary)
products(type, value, level, name)
Task: Find id from sales where amount exceeds the count of amount from products for the same id.
SQL: | SELECT id FROM sales AS sale
WHERE amount > (
SELECT COUNT(amount) FROM products AS prod
WHERE prod.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16516 | train |
v1 | Schema:
branches (alias: brc)(code, date, value, level)
managers(level, type, name, code)
Task: Find name from branches where status appears in managers entries with matching id.
SQL: | SELECT name FROM branches AS brc
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "managers",
"outer_alias": "brc",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16517 | train |
v3 | Schema:
products (alias: prod)(id, type, level, amount)
managers(salary, value, amount, code)
Task: Find amount from products where value exceeds the average value from managers for the same type.
SQL: | SELECT amount FROM products AS prod
WHERE value > (
SELECT AVG(value) FROM managers AS mgr
WHERE mgr.type = prod.type
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16518 | train |
v2 | Schema:
sales (alias: sale)(code, date, name, value)
accounts(salary, value, date, name)
Task: Retrieve name from sales that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16519 | train |
v3 | Schema:
branches (alias: brc)(type, id, status, amount)
customers(id, name, level, date)
Task: Retrieve name from branches with value above the SUM(value) of customers rows sharing the same level.
SQL: | SELECT name FROM branches AS brc
WHERE value > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16520 | train |
v1 | Schema:
transactions (alias: txn)(name, amount, id, salary)
products(code, value, amount, status)
Task: Find id from transactions where level appears in products entries with matching status.
SQL: | SELECT id FROM transactions AS txn
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16521 | train |
v1 | Schema:
departments (alias: dept)(amount, id, type, date)
staff(amount, value, date, salary)
Task: Find value from departments where id appears in staff entries with matching code.
SQL: | SELECT value FROM departments AS dept
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16522 | train |
v1 | Schema:
departments (alias: dept)(id, type, level, salary)
managers(type, status, value, name)
Task: Retrieve code from departments whose status is found in managers rows where code matches the outer record.
SQL: | SELECT code FROM departments AS dept
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16523 | train |
v3 | Schema:
orders (alias: ord)(value, id, status, name)
accounts(amount, name, status, level)
Task: Find code from orders where amount exceeds the minimum amount from accounts for the same status.
SQL: | SELECT code FROM orders AS ord
WHERE amount > (
SELECT MIN(amount) FROM accounts AS acct
WHERE acct.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16524 | train |
v2 | Schema:
products (alias: prod)(salary, level, name, amount)
requests(value, name, id, salary)
Task: Find code from products where a matching record exists in requests with the same status.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = prod.status
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16525 | train |
v2 | Schema:
projects (alias: prj)(salary, level, id, status)
accounts(id, value, status, code)
Task: Find salary from projects where a matching record exists in accounts with the same id.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16526 | train |
v3 | Schema:
branches (alias: brc)(type, value, code, amount)
projects(amount, salary, name, code)
Task: Retrieve id from branches with salary above the AVG(value) of projects rows sharing the same type.
SQL: | SELECT id FROM branches AS brc
WHERE salary > (
SELECT AVG(value) FROM projects AS prj
WHERE prj.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16527 | train |
v1 | Schema:
departments (alias: dept)(value, id, date, amount)
staff(value, id, level, salary)
Task: Retrieve value from departments whose code is found in staff rows where type matches the outer record.
SQL: | SELECT value FROM departments AS dept
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16528 | train |
v1 | Schema:
accounts (alias: acct)(name, type, date, amount)
schedules(type, value, salary, code)
Task: Select id from accounts where level exists in schedules for the same type.
SQL: | SELECT id FROM accounts AS acct
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16529 | train |
v1 | Schema:
orders (alias: ord)(date, amount, status, id)
employees(amount, id, name, code)
Task: Select id from orders where level exists in employees for the same type.
SQL: | SELECT id FROM orders AS ord
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16530 | train |
v3 | Schema:
projects (alias: prj)(level, code, status, amount)
managers(amount, salary, code, value)
Task: Retrieve name from projects with value above the MIN(salary) of managers rows sharing the same status.
SQL: | SELECT name FROM projects AS prj
WHERE value > (
SELECT MIN(salary) FROM managers AS mgr
WHERE mgr.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16531 | train |
v3 | Schema:
transactions (alias: txn)(type, name, status, amount)
branches(status, type, value, level)
Task: Retrieve salary from transactions with amount above the MIN(salary) of branches rows sharing the same level.
SQL: | SELECT salary FROM transactions AS txn
WHERE amount > (
SELECT MIN(salary) FROM branches AS brc
WHERE brc.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16532 | train |
v3 | Schema:
branches (alias: brc)(value, date, level, name)
regions(id, type, level, name)
Task: Find name from branches where salary exceeds the maximum salary from regions for the same type.
SQL: | SELECT name FROM branches AS brc
WHERE salary > (
SELECT MAX(salary) FROM regions AS rgn
WHERE rgn.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16533 | train |
v3 | Schema:
accounts (alias: acct)(status, value, amount, name)
transactions(date, id, type, level)
Task: Find name from accounts where salary exceeds the count of salary from transactions for the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE salary > (
SELECT COUNT(salary) FROM transactions AS txn
WHERE txn.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16534 | train |
v2 | Schema:
schedules (alias: schd)(id, code, amount, status)
orders(amount, status, date, level)
Task: Find salary from schedules where a matching record exists in orders with the same status.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16535 | train |
v1 | Schema:
invoices (alias: inv)(status, date, id, type)
branches(value, type, salary, amount)
Task: Select code from invoices where status exists in branches for the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16536 | train |
v1 | Schema:
tasks (alias: tsk)(name, value, status, date)
orders(level, status, date, type)
Task: Select amount from tasks where type exists in orders for the same level.
SQL: | SELECT amount FROM tasks AS tsk
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16537 | train |
v2 | Schema:
accounts (alias: acct)(status, id, value, code)
transactions(name, value, date, type)
Task: Find code from accounts where a matching record exists in transactions with the same level.
SQL: | SELECT code 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": "code",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16538 | train |
v2 | Schema:
managers (alias: mgr)(salary, date, status, id)
projects(date, value, level, code)
Task: Find salary from managers where a matching record exists in projects with the same level.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16539 | train |
v2 | Schema:
shipments (alias: shp)(value, name, code, id)
staff(id, value, level, salary)
Task: Retrieve id from shipments that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16540 | train |
v2 | Schema:
departments (alias: dept)(type, date, code, amount)
items(value, date, level, status)
Task: Retrieve name from departments that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16541 | train |
v1 | Schema:
staff (alias: empl)(value, id, level, status)
accounts(level, amount, status, id)
Task: Retrieve code from staff whose type is found in accounts rows where code matches the outer record.
SQL: | SELECT code FROM staff AS empl
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16542 | train |
v2 | Schema:
invoices (alias: inv)(value, salary, date, id)
requests(amount, type, status, value)
Task: Find salary from invoices where a matching record exists in requests with the same level.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16543 | train |
v2 | Schema:
regions (alias: rgn)(type, name, amount, code)
transactions(type, amount, name, code)
Task: Retrieve id from regions that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16544 | train |
v1 | Schema:
sales (alias: sale)(type, level, name, code)
schedules(code, status, type, salary)
Task: Retrieve value from sales whose type is found in schedules rows where id matches the outer record.
SQL: | SELECT value FROM sales AS sale
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16545 | train |
v3 | Schema:
managers (alias: mgr)(date, status, value, level)
tasks(date, amount, level, salary)
Task: Retrieve code from managers with amount above the MAX(value) of tasks rows sharing the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE amount > (
SELECT MAX(value) FROM tasks AS tsk
WHERE tsk.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16546 | train |
v3 | Schema:
managers (alias: mgr)(status, level, name, id)
branches(name, value, salary, amount)
Task: Retrieve code from managers with amount above the MAX(salary) of branches rows sharing the same code.
SQL: | SELECT code FROM managers AS mgr
WHERE amount > (
SELECT MAX(salary) FROM branches AS brc
WHERE brc.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16547 | train |
v1 | Schema:
shipments (alias: shp)(code, amount, date, id)
regions(salary, type, value, date)
Task: Retrieve value from shipments whose type is found in regions rows where status matches the outer record.
SQL: | SELECT value FROM shipments AS shp
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16548 | train |
v2 | Schema:
staff (alias: empl)(type, amount, level, value)
sales(code, value, name, salary)
Task: Find name from staff where a matching record exists in sales with the same status.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16549 | train |
v3 | Schema:
products (alias: prod)(level, date, salary, amount)
transactions(date, level, salary, name)
Task: Retrieve id from products with amount above the AVG(salary) of transactions rows sharing the same id.
SQL: | SELECT id FROM products AS prod
WHERE amount > (
SELECT AVG(salary) FROM transactions AS txn
WHERE txn.id = prod.id
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16550 | train |
v3 | Schema:
sales (alias: sale)(code, status, value, id)
requests(salary, code, type, date)
Task: Find name from sales where salary exceeds the minimum salary from requests for the same code.
SQL: | SELECT name FROM sales AS sale
WHERE salary > (
SELECT MIN(salary) FROM requests AS ordr
WHERE ordr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16551 | train |
v3 | Schema:
departments (alias: dept)(value, salary, name, level)
shipments(type, value, name, amount)
Task: Retrieve id from departments with value above the MIN(amount) of shipments rows sharing the same id.
SQL: | SELECT id FROM departments AS dept
WHERE value > (
SELECT MIN(amount) FROM shipments AS shp
WHERE shp.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16552 | train |
v2 | Schema:
sales (alias: sale)(salary, id, date, status)
transactions(id, value, salary, status)
Task: Retrieve code from sales that have at least one corresponding entry in transactions sharing the same type.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16553 | train |
v1 | Schema:
invoices (alias: inv)(type, id, status, code)
requests(status, level, amount, id)
Task: Select amount from invoices where code exists in requests for the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16554 | train |
v3 | Schema:
sales (alias: sale)(type, amount, value, level)
requests(code, date, type, value)
Task: Find salary from sales where amount exceeds the total salary from requests for the same status.
SQL: | SELECT salary FROM sales AS sale
WHERE amount > (
SELECT SUM(salary) FROM requests AS ordr
WHERE ordr.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16555 | train |
v2 | Schema:
shipments (alias: shp)(amount, name, id, date)
categories(amount, type, date, level)
Task: Find value from shipments where a matching record exists in categories with the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16556 | train |
v1 | Schema:
invoices (alias: inv)(name, salary, level, type)
sales(id, name, status, code)
Task: Find name from invoices where level appears in sales entries with matching id.
SQL: | SELECT name FROM invoices AS inv
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16557 | train |
v3 | Schema:
transactions (alias: txn)(name, salary, status, type)
staff(salary, type, value, id)
Task: Retrieve amount from transactions with value above the COUNT(value) of staff rows sharing the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE value > (
SELECT COUNT(value) FROM staff AS empl
WHERE empl.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16558 | train |
v3 | Schema:
products (alias: prod)(name, status, level, amount)
tasks(name, value, type, level)
Task: Find value from products where salary exceeds the count of value from tasks for the same type.
SQL: | SELECT value FROM products AS prod
WHERE salary > (
SELECT COUNT(value) FROM tasks AS tsk
WHERE tsk.type = prod.type
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16559 | train |
v3 | Schema:
requests (alias: ordr)(name, id, type, date)
schedules(amount, code, date, id)
Task: Find amount from requests where salary exceeds the average value from schedules for the same id.
SQL: | SELECT amount FROM requests AS ordr
WHERE salary > (
SELECT AVG(value) FROM schedules AS schd
WHERE schd.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16560 | train |
v1 | Schema:
staff (alias: empl)(date, type, salary, amount)
projects(type, date, code, status)
Task: Retrieve amount from staff whose type is found in projects rows where status matches the outer record.
SQL: | SELECT amount FROM staff AS empl
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16561 | train |
v1 | Schema:
schedules (alias: schd)(id, amount, level, date)
items(value, level, code, type)
Task: Retrieve code from schedules whose code is found in items rows where status matches the outer record.
SQL: | SELECT code FROM schedules AS schd
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16562 | train |
v1 | Schema:
shipments (alias: shp)(salary, value, name, amount)
invoices(type, id, value, salary)
Task: Select amount from shipments where status exists in invoices for the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16563 | train |
v2 | Schema:
categories (alias: catg)(type, salary, date, name)
accounts(value, amount, code, status)
Task: Retrieve id from categories that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16564 | train |
v3 | Schema:
requests (alias: ordr)(code, type, id, value)
regions(value, salary, name, date)
Task: Find code from requests where salary exceeds the total amount from regions for the same level.
SQL: | SELECT code FROM requests AS ordr
WHERE salary > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16565 | train |
v1 | Schema:
schedules (alias: schd)(id, salary, amount, level)
employees(name, salary, value, type)
Task: Select name from schedules where type exists in employees for the same id.
SQL: | SELECT name FROM schedules AS schd
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16566 | train |
v1 | Schema:
items (alias: lne)(level, amount, date, value)
orders(code, status, salary, type)
Task: Retrieve salary from items whose status is found in orders rows where level matches the outer record.
SQL: | SELECT salary FROM items AS lne
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.level = lne.level
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16567 | train |
v2 | Schema:
customers (alias: cust)(type, id, level, salary)
invoices(value, amount, level, type)
Task: Find value from customers where a matching record exists in invoices with the same status.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16568 | train |
v1 | Schema:
shipments (alias: shp)(amount, salary, name, level)
departments(code, id, name, date)
Task: Find code from shipments where level appears in departments entries with matching status.
SQL: | SELECT code FROM shipments AS shp
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16569 | train |
v2 | Schema:
shipments (alias: shp)(level, type, value, status)
projects(code, status, date, id)
Task: Retrieve code from shipments that have at least one corresponding entry in projects sharing the same id.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16570 | train |
v1 | Schema:
employees (alias: emp)(salary, date, code, value)
customers(level, value, amount, type)
Task: Retrieve id from employees whose status is found in customers rows where status matches the outer record.
SQL: | SELECT id FROM employees AS emp
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16571 | train |
v1 | Schema:
regions (alias: rgn)(salary, value, code, date)
tasks(level, salary, name, code)
Task: Select code from regions where id exists in tasks for the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16572 | train |
v1 | Schema:
shipments (alias: shp)(amount, id, date, code)
departments(date, code, value, level)
Task: Select id from shipments where type exists in departments for the same level.
SQL: | SELECT id FROM shipments AS shp
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16573 | train |
v2 | Schema:
staff (alias: empl)(amount, code, date, type)
items(date, code, name, type)
Task: Retrieve amount from staff that have at least one corresponding entry in items sharing the same code.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16574 | train |
v3 | Schema:
tasks (alias: tsk)(date, type, status, level)
accounts(level, name, status, date)
Task: Find salary from tasks where value exceeds the total amount from accounts for the same id.
SQL: | SELECT salary FROM tasks AS tsk
WHERE value > (
SELECT SUM(amount) FROM accounts AS acct
WHERE acct.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16575 | train |
v2 | Schema:
customers (alias: cust)(level, code, salary, type)
regions(salary, date, level, code)
Task: Retrieve amount from customers that have at least one corresponding entry in regions sharing the same level.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16576 | train |
v3 | Schema:
orders (alias: ord)(amount, level, name, date)
customers(salary, value, type, level)
Task: Retrieve salary from orders with value above the MIN(value) of customers rows sharing the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE value > (
SELECT MIN(value) FROM customers AS cust
WHERE cust.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16577 | train |
v3 | Schema:
sales (alias: sale)(status, id, value, name)
customers(status, name, amount, level)
Task: Find code from sales where salary exceeds the maximum salary from customers for the same type.
SQL: | SELECT code FROM sales AS sale
WHERE salary > (
SELECT MAX(salary) FROM customers AS cust
WHERE cust.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16578 | train |
v1 | Schema:
shipments (alias: shp)(status, id, level, name)
regions(amount, status, type, name)
Task: Find value from shipments where status appears in regions entries with matching type.
SQL: | SELECT value FROM shipments AS shp
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16579 | train |
v3 | Schema:
products (alias: prod)(value, date, amount, status)
managers(value, id, amount, status)
Task: Find id from products where amount exceeds the maximum amount from managers for the same type.
SQL: | SELECT id FROM products AS prod
WHERE amount > (
SELECT MAX(amount) FROM managers AS mgr
WHERE mgr.type = prod.type
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16580 | train |
v3 | Schema:
products (alias: prod)(salary, name, type, value)
orders(id, salary, amount, date)
Task: Find name from products where salary exceeds the count of value from orders for the same id.
SQL: | SELECT name FROM products AS prod
WHERE salary > (
SELECT COUNT(value) FROM orders AS ord
WHERE ord.id = prod.id
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16581 | train |
v3 | Schema:
shipments (alias: shp)(date, level, salary, status)
invoices(type, salary, name, status)
Task: Retrieve id from shipments with amount above the COUNT(value) of invoices rows sharing the same id.
SQL: | SELECT id FROM shipments AS shp
WHERE amount > (
SELECT COUNT(value) FROM invoices AS inv
WHERE inv.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16582 | train |
v2 | Schema:
categories (alias: catg)(salary, code, name, status)
customers(amount, id, status, salary)
Task: Retrieve amount from categories that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16583 | train |
v2 | Schema:
projects (alias: prj)(value, date, salary, type)
managers(id, salary, level, status)
Task: Find name from projects where a matching record exists in managers with the same status.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16584 | train |
v1 | Schema:
items (alias: lne)(id, amount, level, date)
transactions(date, salary, code, name)
Task: Retrieve id from items whose id is found in transactions rows where type matches the outer record.
SQL: | SELECT id FROM items AS lne
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.type = lne.type
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16585 | train |
v3 | Schema:
orders (alias: ord)(name, id, date, type)
categories(date, code, value, status)
Task: Retrieve name from orders with value above the COUNT(salary) of categories rows sharing the same status.
SQL: | SELECT name FROM orders AS ord
WHERE value > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16586 | train |
v1 | Schema:
projects (alias: prj)(id, name, value, salary)
shipments(date, status, code, level)
Task: Retrieve salary from projects whose code is found in shipments rows where type matches the outer record.
SQL: | SELECT salary FROM projects AS prj
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16587 | train |
v1 | Schema:
items (alias: lne)(amount, value, type, date)
employees(status, id, date, name)
Task: Retrieve code from items whose id is found in employees rows where id matches the outer record.
SQL: | SELECT code FROM items AS lne
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.id = lne.id
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16588 | train |
v3 | Schema:
orders (alias: ord)(id, type, name, amount)
products(amount, salary, id, name)
Task: Retrieve amount from orders with value above the COUNT(salary) of products rows sharing the same status.
SQL: | SELECT amount FROM orders AS ord
WHERE value > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16589 | train |
v2 | Schema:
schedules (alias: schd)(salary, id, amount, level)
departments(code, salary, date, id)
Task: Retrieve salary from schedules that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16590 | train |
v1 | Schema:
customers (alias: cust)(salary, type, name, id)
products(code, status, name, type)
Task: Find amount from customers where id appears in products entries with matching level.
SQL: | SELECT amount FROM customers AS cust
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16591 | train |
v3 | Schema:
managers (alias: mgr)(amount, value, code, type)
schedules(level, date, value, code)
Task: Find name from managers where salary exceeds the count of amount from schedules for the same code.
SQL: | SELECT name FROM managers AS mgr
WHERE salary > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16592 | train |
v1 | Schema:
shipments (alias: shp)(name, date, id, code)
customers(value, code, type, date)
Task: Select id from shipments where type exists in customers for the same status.
SQL: | SELECT id FROM shipments AS shp
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16593 | train |
v1 | Schema:
accounts (alias: acct)(status, id, date, amount)
items(type, status, amount, value)
Task: Find value from accounts where level appears in items entries with matching type.
SQL: | SELECT value FROM accounts AS acct
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16594 | train |
v1 | Schema:
orders (alias: ord)(type, level, value, status)
managers(id, level, status, type)
Task: Select amount from orders where id exists in managers for the same id.
SQL: | SELECT amount FROM orders AS ord
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16595 | train |
v3 | Schema:
tasks (alias: tsk)(date, level, code, type)
sales(name, type, id, value)
Task: Retrieve name from tasks with amount above the COUNT(salary) of sales rows sharing the same level.
SQL: | SELECT name FROM tasks AS tsk
WHERE amount > (
SELECT COUNT(salary) FROM sales AS sale
WHERE sale.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16596 | train |
v2 | Schema:
orders (alias: ord)(amount, name, value, date)
staff(salary, level, date, amount)
Task: Retrieve id from orders that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16597 | train |
v3 | Schema:
transactions (alias: txn)(code, salary, value, date)
shipments(amount, type, date, value)
Task: Retrieve code from transactions with value above the AVG(amount) of shipments rows sharing the same code.
SQL: | SELECT code FROM transactions AS txn
WHERE value > (
SELECT AVG(amount) FROM shipments AS shp
WHERE shp.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16598 | train |
v1 | Schema:
schedules (alias: schd)(name, value, type, salary)
departments(level, amount, salary, status)
Task: Select amount from schedules where type exists in departments for the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16599 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.