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 |
|---|---|---|---|---|---|---|
v2 | Schema:
employees (alias: emp)(id, salary, type, amount)
regions(level, id, status, date)
Task: Find code from employees where a matching record exists in regions with the same status.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00500 | train |
v3 | Schema:
shipments (alias: shp)(status, level, type, date)
tasks(date, salary, name, value)
Task: Retrieve amount from shipments with amount above the SUM(value) of tasks rows sharing the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE amount > (
SELECT SUM(value) FROM tasks AS tsk
WHERE tsk.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00501 | train |
v2 | Schema:
accounts (alias: acct)(amount, salary, name, id)
invoices(name, value, status, salary)
Task: Find code from accounts where a matching record exists in invoices with the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00502 | train |
v2 | Schema:
categories (alias: catg)(name, value, level, date)
items(type, id, level, value)
Task: Retrieve amount from categories that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00503 | train |
v2 | Schema:
managers (alias: mgr)(type, status, id, value)
shipments(name, level, date, salary)
Task: Retrieve code from managers that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00504 | train |
v3 | Schema:
regions (alias: rgn)(type, name, code, date)
tasks(amount, status, level, value)
Task: Retrieve code from regions with value above the MIN(value) of tasks rows sharing the same level.
SQL: | SELECT code FROM regions AS rgn
WHERE value > (
SELECT MIN(value) FROM tasks AS tsk
WHERE tsk.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00505 | train |
v2 | Schema:
staff (alias: empl)(status, level, value, type)
invoices(type, status, salary, name)
Task: Find id from staff where a matching record exists in invoices with the same level.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_00506 | train |
v3 | Schema:
customers (alias: cust)(amount, name, id, status)
orders(salary, name, code, status)
Task: Find id from customers where salary exceeds the count of salary from orders for the same status.
SQL: | SELECT id FROM customers AS cust
WHERE salary > (
SELECT COUNT(salary) FROM orders AS ord
WHERE ord.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00507 | train |
v3 | Schema:
projects (alias: prj)(level, name, value, code)
accounts(status, value, amount, code)
Task: Retrieve code from projects with amount above the MAX(salary) of accounts rows sharing the same level.
SQL: | SELECT code FROM projects AS prj
WHERE amount > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00508 | train |
v1 | Schema:
projects (alias: prj)(date, id, salary, level)
products(salary, type, id, name)
Task: Find id from projects where id appears in products entries with matching type.
SQL: | SELECT id FROM projects AS prj
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00509 | train |
v3 | Schema:
sales (alias: sale)(value, salary, id, status)
shipments(salary, status, id, code)
Task: Retrieve amount from sales with salary above the SUM(amount) of shipments rows sharing the same id.
SQL: | SELECT amount FROM sales AS sale
WHERE salary > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00510 | train |
v2 | Schema:
categories (alias: catg)(value, type, id, status)
departments(salary, name, type, id)
Task: Find id from categories where a matching record exists in departments with the same id.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00511 | train |
v1 | Schema:
accounts (alias: acct)(level, value, type, date)
shipments(date, level, amount, type)
Task: Select value from accounts where status exists in shipments for the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00512 | train |
v2 | Schema:
branches (alias: brc)(name, value, date, code)
requests(id, name, date, status)
Task: Retrieve salary from branches that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00513 | train |
v1 | Schema:
staff (alias: empl)(amount, value, id, name)
requests(type, date, status, level)
Task: Find salary from staff where status appears in requests entries with matching level.
SQL: | SELECT salary FROM staff AS empl
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_00514 | train |
v3 | Schema:
departments (alias: dept)(value, date, type, code)
tasks(name, date, level, status)
Task: Find code from departments where value exceeds the minimum value from tasks for the same id.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT MIN(value) FROM tasks AS tsk
WHERE tsk.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00515 | train |
v2 | Schema:
schedules (alias: schd)(code, id, date, value)
items(value, code, type, level)
Task: Retrieve code from schedules that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00516 | train |
v1 | Schema:
products (alias: prod)(type, name, id, salary)
requests(value, amount, level, date)
Task: Select code from products where status exists in requests for the same type.
SQL: | SELECT code FROM products AS prod
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.type = prod.type
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00517 | train |
v1 | Schema:
schedules (alias: schd)(value, amount, level, code)
managers(date, amount, type, id)
Task: Select salary from schedules where code exists in managers for the same level.
SQL: | SELECT salary FROM schedules AS schd
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00518 | train |
v1 | Schema:
schedules (alias: schd)(salary, status, value, id)
projects(code, salary, amount, status)
Task: Find name from schedules where code appears in projects entries with matching status.
SQL: | SELECT name FROM schedules AS schd
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00519 | train |
v3 | Schema:
invoices (alias: inv)(id, status, amount, level)
accounts(name, type, id, salary)
Task: Retrieve id from invoices with salary above the MIN(amount) of accounts rows sharing the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE salary > (
SELECT MIN(amount) FROM accounts AS acct
WHERE acct.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00520 | train |
v2 | Schema:
requests (alias: ordr)(value, code, id, name)
shipments(date, status, id, code)
Task: Find amount from requests where a matching record exists in shipments with the same code.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00521 | train |
v1 | Schema:
accounts (alias: acct)(type, value, salary, code)
managers(id, code, type, amount)
Task: Find salary from accounts where type appears in managers entries with matching status.
SQL: | SELECT salary FROM accounts AS acct
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00522 | train |
v1 | Schema:
schedules (alias: schd)(date, name, id, salary)
managers(name, status, salary, id)
Task: Retrieve name from schedules whose code is found in managers rows where status matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00523 | train |
v3 | Schema:
customers (alias: cust)(amount, code, status, value)
managers(level, type, date, id)
Task: Retrieve salary from customers with salary above the AVG(amount) of managers rows sharing the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE salary > (
SELECT AVG(amount) FROM managers AS mgr
WHERE mgr.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00524 | train |
v3 | Schema:
departments (alias: dept)(status, name, salary, amount)
accounts(status, id, value, level)
Task: Retrieve name from departments with salary above the MAX(amount) of accounts rows sharing the same status.
SQL: | SELECT name FROM departments AS dept
WHERE salary > (
SELECT MAX(amount) FROM accounts AS acct
WHERE acct.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00525 | train |
v1 | Schema:
tasks (alias: tsk)(salary, status, code, id)
transactions(salary, value, date, type)
Task: Find id from tasks where type appears in transactions entries with matching id.
SQL: | SELECT id FROM tasks AS tsk
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_00526 | train |
v3 | Schema:
invoices (alias: inv)(type, value, code, amount)
sales(code, type, amount, date)
Task: Find code from invoices where salary exceeds the count of value from sales for the same level.
SQL: | SELECT code FROM invoices AS inv
WHERE salary > (
SELECT COUNT(value) FROM sales AS sale
WHERE sale.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00527 | train |
v1 | Schema:
projects (alias: prj)(type, level, id, salary)
employees(salary, code, type, date)
Task: Select value from projects where id exists in employees for the same level.
SQL: | SELECT value FROM projects AS prj
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00528 | train |
v1 | Schema:
shipments (alias: shp)(status, amount, date, level)
products(code, amount, name, id)
Task: Retrieve name from shipments whose id is found in products rows where id matches the outer record.
SQL: | SELECT name FROM shipments AS shp
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00529 | train |
v2 | Schema:
departments (alias: dept)(name, type, amount, date)
tasks(status, amount, value, date)
Task: Find code from departments where a matching record exists in tasks with the same level.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00530 | train |
v3 | Schema:
departments (alias: dept)(id, status, code, name)
products(date, value, level, name)
Task: Find salary from departments where value exceeds the minimum amount from products for the same code.
SQL: | SELECT salary FROM departments AS dept
WHERE value > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00531 | train |
v2 | Schema:
branches (alias: brc)(id, name, value, level)
departments(level, type, value, salary)
Task: Retrieve salary from branches that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "departments",
"outer_alias": "brc",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00532 | train |
v1 | Schema:
requests (alias: ordr)(amount, type, id, value)
categories(type, amount, status, salary)
Task: Select code from requests where type exists in categories for the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00533 | train |
v2 | Schema:
categories (alias: catg)(name, code, value, salary)
requests(code, name, level, id)
Task: Retrieve code from categories that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00534 | train |
v2 | Schema:
shipments (alias: shp)(salary, name, date, type)
employees(value, level, date, id)
Task: Retrieve name from shipments that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00535 | train |
v2 | Schema:
projects (alias: prj)(salary, id, value, level)
requests(date, status, value, id)
Task: Find value from projects where a matching record exists in requests with the same status.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00536 | train |
v1 | Schema:
sales (alias: sale)(amount, date, status, code)
requests(name, id, value, date)
Task: Find amount from sales where code appears in requests entries with matching level.
SQL: | SELECT amount FROM sales AS sale
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00537 | train |
v2 | Schema:
requests (alias: ordr)(salary, amount, name, code)
staff(date, amount, value, level)
Task: Find salary from requests where a matching record exists in staff with the same type.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00538 | train |
v3 | Schema:
projects (alias: prj)(date, amount, name, status)
tasks(amount, code, status, level)
Task: Retrieve name from projects with salary above the AVG(salary) of tasks rows sharing the same code.
SQL: | SELECT name FROM projects AS prj
WHERE salary > (
SELECT AVG(salary) FROM tasks AS tsk
WHERE tsk.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "prj",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00539 | train |
v1 | Schema:
transactions (alias: txn)(amount, value, id, type)
employees(amount, code, value, date)
Task: Retrieve amount from transactions whose level is found in employees rows where code matches the outer record.
SQL: | SELECT amount FROM transactions AS txn
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00540 | train |
v2 | Schema:
staff (alias: empl)(date, amount, value, status)
customers(status, level, id, value)
Task: Find name from staff where a matching record exists in customers with the same id.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_00541 | train |
v1 | Schema:
customers (alias: cust)(type, code, amount, status)
projects(type, level, code, status)
Task: Find amount from customers where level appears in projects entries with matching id.
SQL: | SELECT amount FROM customers AS cust
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00542 | train |
v1 | Schema:
accounts (alias: acct)(salary, name, level, type)
branches(name, status, level, id)
Task: Find name from accounts where code appears in branches entries with matching code.
SQL: | SELECT name FROM accounts AS acct
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00543 | train |
v2 | Schema:
requests (alias: ordr)(date, value, code, level)
shipments(salary, date, id, code)
Task: Retrieve code from requests that have at least one corresponding entry in shipments sharing the same status.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00544 | train |
v3 | Schema:
regions (alias: rgn)(level, name, value, date)
schedules(salary, amount, name, date)
Task: Retrieve salary from regions with amount above the MAX(salary) of schedules rows sharing the same type.
SQL: | SELECT salary FROM regions AS rgn
WHERE amount > (
SELECT MAX(salary) FROM schedules AS schd
WHERE schd.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00545 | train |
v3 | Schema:
tasks (alias: tsk)(value, amount, name, salary)
schedules(amount, type, date, id)
Task: Retrieve amount from tasks with value above the AVG(salary) of schedules rows sharing the same type.
SQL: | SELECT amount FROM tasks AS tsk
WHERE value > (
SELECT AVG(salary) FROM schedules AS schd
WHERE schd.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_00546 | train |
v3 | Schema:
items (alias: lne)(level, salary, value, code)
shipments(salary, id, amount, name)
Task: Retrieve value from items with amount above the SUM(salary) of shipments rows sharing the same code.
SQL: | SELECT value FROM items AS lne
WHERE amount > (
SELECT SUM(salary) FROM shipments AS shp
WHERE shp.code = lne.code
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00547 | train |
v3 | Schema:
requests (alias: ordr)(id, status, level, code)
schedules(status, level, type, salary)
Task: Find code from requests where value exceeds the average amount from schedules for the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE value > (
SELECT AVG(amount) FROM schedules AS schd
WHERE schd.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00548 | train |
v2 | Schema:
accounts (alias: acct)(value, salary, status, id)
shipments(date, salary, amount, id)
Task: Retrieve id from accounts that have at least one corresponding entry in shipments sharing the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00549 | train |
v2 | Schema:
items (alias: lne)(code, id, name, level)
sales(amount, salary, id, status)
Task: Find amount from items where a matching record exists in sales with the same id.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = lne.id
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00550 | train |
v3 | Schema:
employees (alias: emp)(amount, name, level, id)
products(date, value, name, amount)
Task: Retrieve value from employees with salary above the SUM(value) of products rows sharing the same type.
SQL: | SELECT value FROM employees AS emp
WHERE salary > (
SELECT SUM(value) FROM products AS prod
WHERE prod.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00551 | train |
v3 | Schema:
requests (alias: ordr)(amount, salary, status, id)
sales(value, type, amount, code)
Task: Find amount from requests where amount exceeds the average value from sales for the same level.
SQL: | SELECT amount FROM requests AS ordr
WHERE amount > (
SELECT AVG(value) FROM sales AS sale
WHERE sale.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00552 | train |
v3 | Schema:
customers (alias: cust)(amount, salary, status, name)
invoices(salary, name, type, value)
Task: Retrieve salary from customers with amount above the MIN(amount) of invoices rows sharing the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE amount > (
SELECT MIN(amount) FROM invoices AS inv
WHERE inv.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00553 | train |
v1 | Schema:
staff (alias: empl)(level, status, amount, name)
transactions(name, value, status, salary)
Task: Select amount from staff where level exists in transactions for the same type.
SQL: | SELECT amount FROM staff AS empl
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_00554 | train |
v1 | Schema:
accounts (alias: acct)(type, status, level, name)
categories(type, date, value, id)
Task: Select id from accounts where id exists in categories for the same code.
SQL: | SELECT id FROM accounts AS acct
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00555 | train |
v3 | Schema:
customers (alias: cust)(id, value, status, type)
categories(salary, level, amount, value)
Task: Find value from customers where salary exceeds the total salary from categories for the same code.
SQL: | SELECT value FROM customers AS cust
WHERE salary > (
SELECT SUM(salary) FROM categories AS catg
WHERE catg.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00556 | train |
v2 | Schema:
transactions (alias: txn)(type, level, salary, amount)
employees(id, type, date, status)
Task: Find code from transactions where a matching record exists in employees with the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00557 | train |
v2 | Schema:
sales (alias: sale)(salary, code, id, name)
invoices(salary, id, status, name)
Task: Find amount from sales where a matching record exists in invoices with the same level.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00558 | train |
v3 | Schema:
orders (alias: ord)(code, id, level, value)
items(salary, status, level, id)
Task: Retrieve salary from orders with amount above the COUNT(value) of items rows sharing the same code.
SQL: | SELECT salary FROM orders AS ord
WHERE amount > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00559 | train |
v3 | Schema:
projects (alias: prj)(value, level, status, date)
tasks(type, level, id, date)
Task: Retrieve id from projects with value above the COUNT(salary) of tasks rows sharing the same level.
SQL: | SELECT id FROM projects AS prj
WHERE value > (
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": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00560 | train |
v2 | Schema:
requests (alias: ordr)(id, code, salary, name)
departments(salary, date, value, name)
Task: Find id from requests where a matching record exists in departments with the same type.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00561 | train |
v1 | Schema:
items (alias: lne)(code, date, salary, status)
regions(salary, date, amount, status)
Task: Retrieve salary from items whose status is found in regions rows where id matches the outer record.
SQL: | SELECT salary FROM items AS lne
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.id = lne.id
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00562 | train |
v2 | Schema:
invoices (alias: inv)(id, status, type, level)
tasks(amount, code, name, date)
Task: Find name from invoices where a matching record exists in tasks with the same id.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00563 | train |
v1 | Schema:
staff (alias: empl)(name, level, date, type)
invoices(salary, status, level, amount)
Task: Select name from staff where type exists in invoices for the same code.
SQL: | SELECT name FROM staff AS empl
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_00564 | train |
v3 | Schema:
projects (alias: prj)(id, name, status, level)
staff(name, type, date, level)
Task: Retrieve name from projects with salary above the MAX(amount) of staff rows sharing the same code.
SQL: | SELECT name FROM projects AS prj
WHERE salary > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "staff",
"outer_alias": "prj",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00565 | train |
v3 | Schema:
staff (alias: empl)(value, id, date, type)
departments(date, id, status, type)
Task: Find salary from staff where value exceeds the total value from departments for the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE value > (
SELECT SUM(value) FROM departments AS dept
WHERE dept.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_00566 | train |
v1 | Schema:
managers (alias: mgr)(type, value, name, date)
accounts(value, date, code, amount)
Task: Retrieve salary from managers whose status is found in accounts rows where id matches the outer record.
SQL: | SELECT salary FROM managers AS mgr
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00567 | train |
v1 | Schema:
categories (alias: catg)(value, salary, code, name)
requests(amount, status, level, name)
Task: Find amount from categories where status appears in requests entries with matching level.
SQL: | SELECT amount FROM categories AS catg
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00568 | train |
v1 | Schema:
schedules (alias: schd)(code, type, name, value)
categories(code, salary, type, value)
Task: Select name from schedules where id exists in categories for the same status.
SQL: | SELECT name FROM schedules AS schd
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00569 | train |
v2 | Schema:
shipments (alias: shp)(name, type, salary, date)
regions(value, id, name, salary)
Task: Find salary from shipments where a matching record exists in regions with the same code.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00570 | train |
v2 | Schema:
invoices (alias: inv)(level, amount, type, value)
requests(type, code, salary, name)
Task: Find name from invoices where a matching record exists in requests with the same status.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00571 | train |
v3 | Schema:
customers (alias: cust)(name, level, code, salary)
employees(value, amount, id, type)
Task: Retrieve code from customers with amount above the COUNT(amount) of employees rows sharing the same level.
SQL: | SELECT code FROM customers AS cust
WHERE amount > (
SELECT COUNT(amount) FROM employees AS emp
WHERE emp.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00572 | train |
v2 | Schema:
orders (alias: ord)(salary, value, name, status)
products(name, id, level, code)
Task: Find value from orders where a matching record exists in products with the same level.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00573 | train |
v1 | Schema:
employees (alias: emp)(id, value, salary, date)
categories(amount, code, salary, level)
Task: Retrieve name from employees whose status is found in categories rows where status matches the outer record.
SQL: | SELECT name FROM employees AS emp
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00574 | train |
v2 | Schema:
requests (alias: ordr)(salary, value, level, date)
departments(id, type, level, amount)
Task: Retrieve id from requests that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00575 | train |
v3 | Schema:
employees (alias: emp)(id, date, name, amount)
staff(type, salary, name, date)
Task: Find name from employees where amount exceeds the average value from staff for the same id.
SQL: | SELECT name FROM employees AS emp
WHERE amount > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00576 | train |
v2 | Schema:
projects (alias: prj)(type, id, status, name)
accounts(salary, name, id, level)
Task: Retrieve code from projects that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00577 | train |
v1 | Schema:
regions (alias: rgn)(type, code, date, level)
projects(amount, level, id, code)
Task: Find name from regions where code appears in projects entries with matching id.
SQL: | SELECT name FROM regions AS rgn
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00578 | train |
v3 | Schema:
tasks (alias: tsk)(name, code, value, salary)
projects(name, level, id, date)
Task: Retrieve name from tasks with salary above the MAX(value) of projects rows sharing the same type.
SQL: | SELECT name FROM tasks AS tsk
WHERE salary > (
SELECT MAX(value) FROM projects AS prj
WHERE prj.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_00579 | train |
v1 | Schema:
accounts (alias: acct)(id, level, value, name)
invoices(status, level, id, date)
Task: Select id from accounts where status exists in invoices for the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00580 | train |
v3 | Schema:
transactions (alias: txn)(value, status, level, id)
accounts(id, amount, level, status)
Task: Retrieve id from transactions with salary above the AVG(salary) of accounts rows sharing the same type.
SQL: | SELECT id FROM transactions AS txn
WHERE salary > (
SELECT AVG(salary) FROM accounts AS acct
WHERE acct.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00581 | train |
v3 | Schema:
accounts (alias: acct)(level, amount, date, id)
schedules(type, salary, code, status)
Task: Retrieve salary from accounts with salary above the SUM(amount) of schedules rows sharing the same level.
SQL: | SELECT salary FROM accounts AS acct
WHERE salary > (
SELECT SUM(amount) FROM schedules AS schd
WHERE schd.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00582 | train |
v1 | Schema:
regions (alias: rgn)(salary, name, date, id)
products(id, type, name, code)
Task: Retrieve code from regions whose code is found in products rows where status matches the outer record.
SQL: | SELECT code FROM regions AS rgn
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00583 | train |
v1 | Schema:
shipments (alias: shp)(value, code, name, salary)
categories(status, amount, salary, date)
Task: Find id from shipments where id appears in categories entries with matching type.
SQL: | SELECT id FROM shipments AS shp
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00584 | train |
v3 | Schema:
items (alias: lne)(code, name, salary, amount)
employees(level, name, id, type)
Task: Retrieve value from items with value above the AVG(amount) of employees rows sharing the same level.
SQL: | SELECT value FROM items AS lne
WHERE value > (
SELECT AVG(amount) FROM employees AS emp
WHERE emp.level = lne.level
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00585 | train |
v1 | Schema:
staff (alias: empl)(amount, code, status, salary)
categories(amount, value, name, id)
Task: Select value from staff where status exists in categories for the same level.
SQL: | SELECT value FROM staff AS empl
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_00586 | train |
v1 | Schema:
sales (alias: sale)(salary, amount, type, status)
requests(amount, value, type, salary)
Task: Select name from sales where status exists in requests for the same code.
SQL: | SELECT name FROM sales AS sale
WHERE status IN (
SELECT status 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": "status",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00587 | train |
v1 | Schema:
customers (alias: cust)(amount, type, code, salary)
accounts(name, amount, status, code)
Task: Retrieve salary from customers whose level is found in accounts rows where id matches the outer record.
SQL: | SELECT salary FROM customers AS cust
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00588 | train |
v1 | Schema:
shipments (alias: shp)(code, id, value, date)
requests(id, value, code, type)
Task: Retrieve amount from shipments whose code is found in requests rows where level matches the outer record.
SQL: | SELECT amount FROM shipments AS shp
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00589 | train |
v2 | Schema:
transactions (alias: txn)(type, value, date, amount)
employees(id, value, level, status)
Task: Retrieve amount from transactions that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00590 | train |
v3 | Schema:
items (alias: lne)(status, value, date, code)
regions(salary, status, amount, type)
Task: Find code from items where salary exceeds the total value from regions for the same status.
SQL: | SELECT code FROM items AS lne
WHERE salary > (
SELECT SUM(value) FROM regions AS rgn
WHERE rgn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00591 | train |
v2 | Schema:
employees (alias: emp)(date, name, amount, status)
tasks(level, status, value, amount)
Task: Retrieve amount from employees that have at least one corresponding entry in tasks sharing the same id.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00592 | train |
v3 | Schema:
categories (alias: catg)(id, value, code, name)
transactions(salary, value, status, amount)
Task: Find code from categories where salary exceeds the maximum salary from transactions for the same id.
SQL: | SELECT code FROM categories AS catg
WHERE salary > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00593 | train |
v2 | Schema:
items (alias: lne)(code, status, date, salary)
transactions(level, salary, type, id)
Task: Retrieve value from items that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = lne.id
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00594 | train |
v1 | Schema:
orders (alias: ord)(value, level, status, salary)
projects(status, date, salary, type)
Task: Select id from orders where level exists in projects for the same code.
SQL: | SELECT id FROM orders AS ord
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00595 | train |
v1 | Schema:
invoices (alias: inv)(level, status, code, salary)
customers(name, level, date, value)
Task: Find name from invoices where code appears in customers entries with matching status.
SQL: | SELECT name FROM invoices AS inv
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00596 | train |
v1 | Schema:
customers (alias: cust)(level, code, salary, status)
branches(level, id, status, name)
Task: Retrieve salary from customers whose type is found in branches rows where type matches the outer record.
SQL: | SELECT salary FROM customers AS cust
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "branches",
"outer_alias": "cust",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00597 | train |
v2 | Schema:
employees (alias: emp)(type, date, value, status)
items(status, code, name, value)
Task: Retrieve id from employees that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00598 | train |
v1 | Schema:
schedules (alias: schd)(amount, code, status, date)
regions(id, value, salary, type)
Task: Retrieve name from schedules whose id is found in regions rows where id matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00599 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.