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:
managers (alias: mgr)(type, status, id, code)
employees(type, status, name, date)
Task: Find amount from managers where id appears in employees entries with matching id.
SQL: | SELECT amount FROM managers AS mgr
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11500 | train |
v1 | Schema:
schedules (alias: schd)(code, level, type, status)
branches(type, value, status, salary)
Task: Select amount from schedules where id exists in branches for the same code.
SQL: | SELECT amount FROM schedules AS schd
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11501 | train |
v2 | Schema:
tasks (alias: tsk)(level, amount, type, code)
projects(level, code, type, date)
Task: Retrieve amount from tasks that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11502 | train |
v3 | Schema:
requests (alias: ordr)(date, amount, value, status)
categories(name, salary, level, value)
Task: Retrieve id from requests with value above the MAX(value) of categories rows sharing the same id.
SQL: | SELECT id FROM requests AS ordr
WHERE value > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11503 | train |
v2 | Schema:
accounts (alias: acct)(status, level, type, amount)
items(name, amount, date, level)
Task: Find id from accounts where a matching record exists in items with the same id.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11504 | train |
v1 | Schema:
invoices (alias: inv)(id, code, status, date)
employees(code, date, amount, type)
Task: Find salary from invoices where level appears in employees entries with matching status.
SQL: | SELECT salary FROM invoices AS inv
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11505 | train |
v2 | Schema:
departments (alias: dept)(amount, type, salary, code)
transactions(code, id, date, status)
Task: Find amount from departments where a matching record exists in transactions with the same status.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11506 | train |
v1 | Schema:
managers (alias: mgr)(level, salary, status, id)
requests(level, date, status, id)
Task: Select id from managers where type exists in requests for the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11507 | train |
v2 | Schema:
orders (alias: ord)(value, id, amount, name)
managers(type, value, code, salary)
Task: Find name from orders where a matching record exists in managers with the same level.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11508 | train |
v2 | Schema:
orders (alias: ord)(salary, type, level, value)
tasks(id, code, date, type)
Task: Find id from orders where a matching record exists in tasks with the same status.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11509 | train |
v3 | Schema:
shipments (alias: shp)(id, value, date, type)
invoices(level, amount, name, value)
Task: Find code from shipments where salary exceeds the average value from invoices for the same level.
SQL: | SELECT code FROM shipments AS shp
WHERE salary > (
SELECT AVG(value) FROM invoices AS inv
WHERE inv.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11510 | train |
v2 | Schema:
categories (alias: catg)(value, salary, type, name)
sales(name, value, status, id)
Task: Find id from categories where a matching record exists in sales with the same type.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11511 | train |
v2 | Schema:
items (alias: lne)(id, salary, date, type)
staff(status, level, amount, type)
Task: Retrieve code from items that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = lne.status
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11512 | train |
v2 | Schema:
projects (alias: prj)(code, amount, name, id)
sales(salary, value, level, type)
Task: Find amount from projects where a matching record exists in sales with the same type.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11513 | train |
v2 | Schema:
categories (alias: catg)(code, value, name, type)
branches(status, value, id, amount)
Task: Find id from categories where a matching record exists in branches with the same level.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11514 | train |
v3 | Schema:
orders (alias: ord)(amount, id, level, date)
regions(id, value, salary, level)
Task: Retrieve salary from orders with salary above the COUNT(amount) of regions rows sharing the same type.
SQL: | SELECT salary FROM orders AS ord
WHERE salary > (
SELECT COUNT(amount) FROM regions AS rgn
WHERE rgn.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11515 | train |
v1 | Schema:
invoices (alias: inv)(code, date, salary, name)
departments(id, status, level, amount)
Task: Find amount from invoices where level appears in departments entries with matching status.
SQL: | SELECT amount FROM invoices AS inv
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11516 | train |
v3 | Schema:
transactions (alias: txn)(id, code, level, value)
categories(name, salary, code, date)
Task: Find code from transactions where salary exceeds the average value from categories for the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE salary > (
SELECT AVG(value) FROM categories AS catg
WHERE catg.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11517 | train |
v1 | Schema:
schedules (alias: schd)(amount, status, id, level)
accounts(status, level, id, salary)
Task: Select id from schedules where status exists in accounts for the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11518 | train |
v1 | Schema:
items (alias: lne)(amount, id, name, type)
requests(id, value, code, level)
Task: Find value from items where status appears in requests entries with matching id.
SQL: | SELECT value FROM items AS lne
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.id = lne.id
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11519 | train |
v2 | Schema:
branches (alias: brc)(amount, level, salary, status)
departments(salary, level, name, value)
Task: Retrieve value from branches that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "departments",
"outer_alias": "brc",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11520 | train |
v3 | Schema:
branches (alias: brc)(level, code, name, id)
categories(type, code, status, name)
Task: Find id from branches where value exceeds the count of salary from categories for the same code.
SQL: | SELECT id FROM branches AS brc
WHERE value > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11521 | train |
v1 | Schema:
departments (alias: dept)(amount, id, status, type)
schedules(name, level, status, amount)
Task: Retrieve id from departments whose status is found in schedules rows where type matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11522 | train |
v3 | Schema:
orders (alias: ord)(amount, value, type, id)
sales(level, type, code, date)
Task: Retrieve value from orders with salary above the MIN(amount) of sales rows sharing the same level.
SQL: | SELECT value FROM orders AS ord
WHERE salary > (
SELECT MIN(amount) FROM sales AS sale
WHERE sale.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11523 | train |
v2 | Schema:
projects (alias: prj)(salary, value, status, amount)
transactions(id, status, type, value)
Task: Retrieve amount from projects that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11524 | train |
v3 | Schema:
tasks (alias: tsk)(salary, code, level, id)
regions(salary, level, id, value)
Task: Retrieve name from tasks with amount above the SUM(value) of regions rows sharing the same code.
SQL: | SELECT name FROM tasks AS tsk
WHERE amount > (
SELECT SUM(value) FROM regions AS rgn
WHERE rgn.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11525 | train |
v1 | Schema:
invoices (alias: inv)(id, type, amount, level)
orders(amount, id, value, status)
Task: Find code from invoices where type appears in orders entries with matching type.
SQL: | SELECT code FROM invoices AS inv
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11526 | train |
v1 | Schema:
branches (alias: brc)(salary, id, status, amount)
employees(name, code, status, amount)
Task: Select name from branches where code exists in employees for the same level.
SQL: | SELECT name FROM branches AS brc
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11527 | train |
v3 | Schema:
departments (alias: dept)(level, code, id, salary)
regions(level, code, id, value)
Task: Find salary from departments where value exceeds the minimum value from regions for the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE value > (
SELECT MIN(value) FROM regions AS rgn
WHERE rgn.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11528 | train |
v1 | Schema:
products (alias: prod)(type, code, value, name)
transactions(type, level, date, code)
Task: Select code from products where type exists in transactions for the same status.
SQL: | SELECT code FROM products AS prod
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.status = prod.status
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11529 | train |
v2 | Schema:
items (alias: lne)(date, level, name, status)
orders(status, level, date, type)
Task: Find amount from items where a matching record exists in orders with the same code.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = lne.code
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11530 | train |
v1 | Schema:
managers (alias: mgr)(value, status, code, date)
schedules(name, date, level, value)
Task: Find name from managers where id appears in schedules entries with matching id.
SQL: | SELECT name FROM managers AS mgr
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11531 | train |
v3 | Schema:
branches (alias: brc)(name, code, type, value)
categories(code, level, amount, type)
Task: Find value from branches where amount exceeds the maximum salary from categories for the same id.
SQL: | SELECT value FROM branches AS brc
WHERE amount > (
SELECT MAX(salary) FROM categories AS catg
WHERE catg.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11532 | train |
v3 | Schema:
invoices (alias: inv)(level, id, name, amount)
products(level, type, code, id)
Task: Find amount from invoices where salary exceeds the total value from products for the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE salary > (
SELECT SUM(value) 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": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11533 | train |
v1 | Schema:
managers (alias: mgr)(value, status, date, id)
orders(type, level, salary, id)
Task: Select id from managers where type exists in orders for the same id.
SQL: | SELECT id FROM managers AS mgr
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11534 | train |
v2 | Schema:
sales (alias: sale)(type, value, date, salary)
regions(level, value, status, date)
Task: Find salary from sales where a matching record exists in regions with the same type.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11535 | train |
v3 | Schema:
projects (alias: prj)(level, salary, amount, status)
tasks(value, name, type, id)
Task: Find amount from projects where amount exceeds the count of salary from tasks for the same level.
SQL: | SELECT amount FROM projects AS prj
WHERE amount > (
SELECT COUNT(salary) FROM tasks AS tsk
WHERE tsk.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "prj",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11536 | train |
v1 | Schema:
branches (alias: brc)(status, code, value, salary)
employees(name, status, level, value)
Task: Select code from branches where code exists in employees for the same code.
SQL: | SELECT code FROM branches AS brc
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11537 | train |
v2 | Schema:
customers (alias: cust)(amount, type, level, id)
accounts(code, type, id, value)
Task: Retrieve salary from customers that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11538 | train |
v1 | Schema:
transactions (alias: txn)(status, value, level, salary)
branches(level, status, name, id)
Task: Select amount from transactions where code exists in branches for the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11539 | train |
v3 | Schema:
shipments (alias: shp)(value, type, id, level)
sales(status, amount, id, value)
Task: Retrieve id from shipments with salary above the MAX(salary) of sales rows sharing the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE salary > (
SELECT MAX(salary) FROM sales AS sale
WHERE sale.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11540 | train |
v3 | Schema:
requests (alias: ordr)(amount, value, id, date)
tasks(id, code, status, value)
Task: Find name from requests where value exceeds the maximum value from tasks for the same id.
SQL: | SELECT name FROM requests AS ordr
WHERE value > (
SELECT MAX(value) FROM tasks AS tsk
WHERE tsk.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11541 | train |
v3 | Schema:
schedules (alias: schd)(type, level, date, amount)
departments(id, level, code, name)
Task: Retrieve salary from schedules with amount above the SUM(salary) of departments rows sharing the same status.
SQL: | SELECT salary FROM schedules AS schd
WHERE amount > (
SELECT SUM(salary) FROM departments AS dept
WHERE dept.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11542 | train |
v1 | Schema:
transactions (alias: txn)(id, name, status, salary)
invoices(name, date, status, level)
Task: Find value from transactions where status appears in invoices entries with matching status.
SQL: | SELECT value FROM transactions AS txn
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11543 | train |
v1 | Schema:
categories (alias: catg)(id, level, date, status)
staff(salary, status, level, value)
Task: Retrieve code from categories whose code is found in staff rows where type matches the outer record.
SQL: | SELECT code FROM categories AS catg
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11544 | train |
v1 | Schema:
tasks (alias: tsk)(amount, id, value, code)
branches(value, name, level, date)
Task: Retrieve amount from tasks whose type is found in branches rows where level matches the outer record.
SQL: | SELECT amount FROM tasks AS tsk
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11545 | train |
v2 | Schema:
shipments (alias: shp)(date, id, name, amount)
accounts(status, level, id, date)
Task: Retrieve name from shipments that have at least one corresponding entry in accounts sharing the same type.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11546 | train |
v1 | Schema:
branches (alias: brc)(type, value, amount, salary)
orders(salary, type, level, date)
Task: Select id from branches where status exists in orders for the same type.
SQL: | SELECT id FROM branches AS brc
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11547 | train |
v1 | Schema:
tasks (alias: tsk)(status, name, value, level)
managers(type, salary, level, name)
Task: Retrieve name from tasks whose status is found in managers rows where status matches the outer record.
SQL: | SELECT name FROM tasks AS tsk
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11548 | train |
v3 | Schema:
employees (alias: emp)(code, salary, amount, id)
tasks(id, name, code, date)
Task: Find name from employees where value exceeds the maximum amount from tasks for the same code.
SQL: | SELECT name FROM employees AS emp
WHERE value > (
SELECT MAX(amount) FROM tasks AS tsk
WHERE tsk.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11549 | train |
v3 | Schema:
projects (alias: prj)(type, amount, id, status)
tasks(level, salary, amount, type)
Task: Find name from projects where salary exceeds the count of value from tasks for the same id.
SQL: | SELECT name FROM projects AS prj
WHERE salary > (
SELECT COUNT(value) FROM tasks AS tsk
WHERE tsk.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "prj",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11550 | train |
v2 | Schema:
tasks (alias: tsk)(date, status, code, salary)
items(date, type, code, name)
Task: Retrieve amount from tasks that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "items",
"outer_alias": "tsk",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11551 | train |
v2 | Schema:
schedules (alias: schd)(id, status, salary, date)
categories(date, type, id, value)
Task: Retrieve id from schedules that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11552 | train |
v2 | Schema:
employees (alias: emp)(name, type, status, code)
requests(salary, id, date, type)
Task: Retrieve salary from employees that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11553 | train |
v1 | Schema:
managers (alias: mgr)(code, level, amount, date)
items(code, salary, level, name)
Task: Find salary from managers where status appears in items entries with matching code.
SQL: | SELECT salary FROM managers AS mgr
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11554 | train |
v3 | Schema:
projects (alias: prj)(id, value, salary, date)
categories(id, salary, amount, level)
Task: Find amount from projects where value exceeds the maximum amount from categories for the same id.
SQL: | SELECT amount FROM projects AS prj
WHERE value > (
SELECT MAX(amount) FROM categories AS catg
WHERE catg.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11555 | train |
v2 | Schema:
regions (alias: rgn)(type, name, status, value)
transactions(name, date, code, level)
Task: Retrieve name from regions that have at least one corresponding entry in transactions sharing the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11556 | train |
v2 | Schema:
projects (alias: prj)(type, code, date, id)
employees(name, code, date, salary)
Task: Find value from projects where a matching record exists in employees with the same status.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11557 | train |
v3 | Schema:
products (alias: prod)(status, value, amount, date)
transactions(amount, id, date, status)
Task: Find id from products where salary exceeds the count of amount from transactions for the same type.
SQL: | SELECT id FROM products AS prod
WHERE salary > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.type = prod.type
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11558 | train |
v2 | Schema:
departments (alias: dept)(value, id, salary, date)
staff(amount, value, code, date)
Task: Retrieve code from departments that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT code 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": "code",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11559 | train |
v2 | Schema:
regions (alias: rgn)(status, amount, id, level)
staff(type, date, salary, status)
Task: Retrieve value from regions that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11560 | train |
v3 | Schema:
items (alias: lne)(name, amount, salary, value)
shipments(type, code, name, amount)
Task: Find name from items where value exceeds the minimum salary from shipments for the same id.
SQL: | SELECT name FROM items AS lne
WHERE value > (
SELECT MIN(salary) FROM shipments AS shp
WHERE shp.id = lne.id
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11561 | train |
v3 | Schema:
regions (alias: rgn)(code, status, amount, level)
accounts(date, level, salary, name)
Task: Retrieve name from regions with amount above the COUNT(salary) of accounts rows sharing the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE amount > (
SELECT COUNT(salary) FROM accounts AS acct
WHERE acct.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11562 | train |
v3 | Schema:
requests (alias: ordr)(type, level, date, salary)
shipments(id, code, salary, status)
Task: Retrieve code from requests with value above the MAX(value) of shipments rows sharing the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE value > (
SELECT MAX(value) FROM shipments AS shp
WHERE shp.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11563 | train |
v1 | Schema:
items (alias: lne)(id, salary, date, amount)
accounts(code, type, amount, date)
Task: Find id from items where id appears in accounts entries with matching type.
SQL: | SELECT id FROM items AS lne
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.type = lne.type
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11564 | train |
v2 | Schema:
requests (alias: ordr)(name, status, value, type)
regions(name, level, code, amount)
Task: Retrieve name from requests that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11565 | train |
v1 | Schema:
invoices (alias: inv)(id, type, level, value)
customers(type, code, salary, status)
Task: Find value from invoices where id appears in customers entries with matching level.
SQL: | SELECT value FROM invoices AS inv
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11566 | train |
v3 | Schema:
schedules (alias: schd)(code, value, type, name)
transactions(status, code, level, value)
Task: Retrieve name from schedules with amount above the MIN(value) of transactions rows sharing the same status.
SQL: | SELECT name FROM schedules AS schd
WHERE amount > (
SELECT MIN(value) FROM transactions AS txn
WHERE txn.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11567 | train |
v1 | Schema:
shipments (alias: shp)(salary, id, date, amount)
departments(type, id, status, level)
Task: Find salary from shipments where code appears in departments entries with matching status.
SQL: | SELECT salary FROM shipments AS shp
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11568 | train |
v2 | Schema:
projects (alias: prj)(amount, status, type, id)
orders(code, level, amount, name)
Task: Find salary from projects where a matching record exists in orders with the same type.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "orders",
"outer_alias": "prj",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11569 | train |
v2 | Schema:
sales (alias: sale)(value, id, name, date)
items(amount, name, level, code)
Task: Find amount from sales where a matching record exists in items with the same id.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11570 | train |
v2 | Schema:
products (alias: prod)(date, name, salary, type)
staff(date, code, status, amount)
Task: Find salary from products where a matching record exists in staff with the same id.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = prod.id
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11571 | train |
v1 | Schema:
staff (alias: empl)(id, salary, level, code)
employees(date, salary, value, type)
Task: Find salary from staff where type appears in employees entries with matching id.
SQL: | SELECT salary FROM staff AS empl
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11572 | train |
v3 | Schema:
categories (alias: catg)(code, id, amount, status)
tasks(salary, amount, code, level)
Task: Find value from categories where salary exceeds the maximum amount from tasks for the same level.
SQL: | SELECT value FROM categories AS catg
WHERE salary > (
SELECT MAX(amount) FROM tasks AS tsk
WHERE tsk.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11573 | train |
v1 | Schema:
schedules (alias: schd)(value, id, code, level)
items(date, status, amount, salary)
Task: Select name from schedules where level exists in items for the same code.
SQL: | SELECT name FROM schedules AS schd
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11574 | train |
v3 | Schema:
products (alias: prod)(amount, salary, value, id)
items(date, amount, salary, level)
Task: Retrieve name from products with value above the SUM(value) of items rows sharing the same code.
SQL: | SELECT name FROM products AS prod
WHERE value > (
SELECT SUM(value) FROM items AS lne
WHERE lne.code = prod.code
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11575 | train |
v3 | Schema:
accounts (alias: acct)(date, value, code, status)
regions(salary, code, status, type)
Task: Find value from accounts where salary exceeds the count of salary from regions for the same level.
SQL: | SELECT value FROM accounts AS acct
WHERE salary > (
SELECT COUNT(salary) FROM regions AS rgn
WHERE rgn.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11576 | train |
v1 | Schema:
managers (alias: mgr)(level, name, code, value)
invoices(date, id, name, type)
Task: Find name from managers where id appears in invoices entries with matching type.
SQL: | SELECT name FROM managers AS mgr
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11577 | train |
v1 | Schema:
tasks (alias: tsk)(type, amount, status, salary)
categories(type, code, status, amount)
Task: Find id from tasks where status appears in categories entries with matching status.
SQL: | SELECT id FROM tasks AS tsk
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11578 | train |
v2 | Schema:
branches (alias: brc)(salary, name, amount, code)
tasks(code, salary, value, level)
Task: Retrieve value from branches that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11579 | train |
v1 | Schema:
orders (alias: ord)(amount, status, id, code)
items(status, name, salary, type)
Task: Select code from orders where status exists in items for the same code.
SQL: | SELECT code FROM orders AS ord
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11580 | train |
v1 | Schema:
schedules (alias: schd)(value, salary, amount, id)
sales(value, id, level, code)
Task: Retrieve code from schedules whose status is found in sales rows where id matches the outer record.
SQL: | SELECT code FROM schedules AS schd
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11581 | train |
v1 | Schema:
shipments (alias: shp)(type, id, amount, code)
transactions(status, value, name, salary)
Task: Select name from shipments where type exists in transactions for the same type.
SQL: | SELECT name FROM shipments AS shp
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11582 | train |
v3 | Schema:
customers (alias: cust)(amount, status, code, type)
staff(value, date, type, level)
Task: Retrieve value from customers with salary above the COUNT(amount) of staff rows sharing the same level.
SQL: | SELECT value FROM customers AS cust
WHERE salary > (
SELECT COUNT(amount) FROM staff AS empl
WHERE empl.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11583 | train |
v3 | Schema:
projects (alias: prj)(status, date, value, salary)
invoices(salary, type, value, level)
Task: Find amount from projects where amount exceeds the count of salary from invoices for the same code.
SQL: | SELECT amount FROM projects AS prj
WHERE amount > (
SELECT COUNT(salary) FROM invoices AS inv
WHERE inv.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11584 | train |
v1 | Schema:
branches (alias: brc)(date, id, name, type)
categories(amount, date, value, id)
Task: Retrieve amount from branches whose status is found in categories rows where id matches the outer record.
SQL: | SELECT amount FROM branches AS brc
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11585 | train |
v2 | Schema:
orders (alias: ord)(type, id, status, date)
employees(date, id, type, name)
Task: Retrieve name from orders that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11586 | train |
v3 | Schema:
invoices (alias: inv)(amount, value, salary, type)
tasks(code, status, date, amount)
Task: Find value from invoices where amount exceeds the total value from tasks for the same level.
SQL: | SELECT value FROM invoices AS inv
WHERE amount > (
SELECT SUM(value) FROM tasks AS tsk
WHERE tsk.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11587 | train |
v2 | Schema:
orders (alias: ord)(salary, date, name, code)
requests(code, level, status, date)
Task: Find value from orders where a matching record exists in requests with the same id.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11588 | train |
v2 | Schema:
orders (alias: ord)(name, salary, value, date)
requests(code, id, level, date)
Task: Find code from orders where a matching record exists in requests with the same id.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11589 | train |
v3 | Schema:
requests (alias: ordr)(status, code, id, value)
transactions(code, name, id, salary)
Task: Retrieve salary from requests with amount above the COUNT(value) of transactions rows sharing the same type.
SQL: | SELECT salary FROM requests AS ordr
WHERE amount > (
SELECT COUNT(value) FROM transactions AS txn
WHERE txn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11590 | train |
v2 | Schema:
orders (alias: ord)(value, status, name, amount)
accounts(value, id, date, level)
Task: Find amount from orders where a matching record exists in accounts with the same type.
SQL: | SELECT amount 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": "amount",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11591 | train |
v1 | Schema:
branches (alias: brc)(code, salary, level, status)
items(date, code, status, salary)
Task: Retrieve value from branches whose code is found in items rows where type matches the outer record.
SQL: | SELECT value FROM branches AS brc
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11592 | train |
v2 | Schema:
tasks (alias: tsk)(date, name, level, status)
products(name, type, code, status)
Task: Find name from tasks where a matching record exists in products with the same status.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11593 | train |
v2 | Schema:
departments (alias: dept)(salary, level, value, code)
products(value, salary, type, date)
Task: Find value from departments where a matching record exists in products with the same status.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11594 | train |
v3 | Schema:
regions (alias: rgn)(level, name, date, code)
employees(code, date, value, status)
Task: Find salary from regions where value exceeds the average value from employees for the same id.
SQL: | SELECT salary FROM regions AS rgn
WHERE value > (
SELECT AVG(value) FROM employees AS emp
WHERE emp.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11595 | train |
v3 | Schema:
tasks (alias: tsk)(status, type, value, name)
products(level, date, type, amount)
Task: Retrieve name from tasks with salary above the AVG(value) of products rows sharing the same id.
SQL: | SELECT name FROM tasks AS tsk
WHERE salary > (
SELECT AVG(value) FROM products AS prod
WHERE prod.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11596 | train |
v2 | Schema:
regions (alias: rgn)(date, level, amount, salary)
products(id, code, salary, status)
Task: Find salary from regions where a matching record exists in products with the same code.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11597 | train |
v3 | Schema:
categories (alias: catg)(level, name, type, salary)
accounts(type, id, status, salary)
Task: Find salary from categories where salary exceeds the count of amount from accounts for the same status.
SQL: | SELECT salary FROM categories AS catg
WHERE salary > (
SELECT COUNT(amount) FROM accounts AS acct
WHERE acct.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11598 | train |
v3 | Schema:
employees (alias: emp)(type, date, status, name)
managers(salary, status, code, level)
Task: Find id from employees where salary exceeds the total amount from managers for the same type.
SQL: | SELECT id FROM employees AS emp
WHERE salary > (
SELECT SUM(amount) FROM managers AS mgr
WHERE mgr.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11599 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.