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)(amount, status, salary, value)
invoices(code, name, value, salary)
Task: Find amount from managers where code appears in invoices entries with matching code.
SQL: | SELECT amount FROM managers AS mgr
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18100 | train |
v3 | Schema:
managers (alias: mgr)(id, salary, level, amount)
employees(name, salary, type, amount)
Task: Retrieve amount from managers with amount above the MAX(amount) of employees rows sharing the same code.
SQL: | SELECT amount FROM managers AS mgr
WHERE amount > (
SELECT MAX(amount) FROM employees AS emp
WHERE emp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18101 | train |
v3 | Schema:
requests (alias: ordr)(salary, name, id, amount)
projects(date, salary, status, type)
Task: Find value from requests where salary exceeds the maximum amount from projects for the same code.
SQL: | SELECT value FROM requests AS ordr
WHERE salary > (
SELECT MAX(amount) FROM projects AS prj
WHERE prj.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_18102 | train |
v2 | Schema:
tasks (alias: tsk)(type, amount, code, salary)
employees(amount, status, value, type)
Task: Retrieve code from tasks that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "tsk",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_18103 | train |
v1 | Schema:
invoices (alias: inv)(date, status, type, id)
categories(type, status, level, name)
Task: Find salary from invoices where code appears in categories entries with matching level.
SQL: | SELECT salary FROM invoices AS inv
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18104 | train |
v2 | Schema:
invoices (alias: inv)(name, value, id, type)
orders(date, id, level, salary)
Task: Find salary from invoices where a matching record exists in orders with the same status.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18105 | train |
v3 | Schema:
orders (alias: ord)(id, value, code, status)
branches(amount, code, type, id)
Task: Find amount from orders where amount exceeds the maximum amount from branches for the same id.
SQL: | SELECT amount FROM orders AS ord
WHERE amount > (
SELECT MAX(amount) FROM branches AS brc
WHERE brc.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18106 | train |
v3 | Schema:
managers (alias: mgr)(value, name, id, code)
customers(date, id, code, status)
Task: Retrieve code from managers with salary above the MIN(salary) of customers rows sharing the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE salary > (
SELECT MIN(salary) FROM customers AS cust
WHERE cust.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18107 | train |
v3 | Schema:
items (alias: lne)(name, level, status, code)
sales(level, date, amount, status)
Task: Retrieve amount from items with value above the MIN(amount) of sales rows sharing the same level.
SQL: | SELECT amount FROM items AS lne
WHERE value > (
SELECT MIN(amount) FROM sales AS sale
WHERE sale.level = lne.level
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_18108 | train |
v1 | Schema:
tasks (alias: tsk)(date, type, amount, code)
employees(level, type, value, status)
Task: Find salary from tasks where level appears in employees entries with matching level.
SQL: | SELECT salary FROM tasks AS tsk
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "tsk",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_18109 | train |
v3 | Schema:
staff (alias: empl)(name, type, salary, id)
invoices(level, salary, name, type)
Task: Find code from staff where value exceeds the maximum salary from invoices for the same level.
SQL: | SELECT code FROM staff AS empl
WHERE value > (
SELECT MAX(salary) FROM invoices AS inv
WHERE inv.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_18110 | train |
v1 | Schema:
transactions (alias: txn)(type, code, salary, value)
shipments(salary, value, type, status)
Task: Find name from transactions where level appears in shipments entries with matching id.
SQL: | SELECT name FROM transactions AS txn
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18111 | train |
v2 | Schema:
departments (alias: dept)(salary, status, date, value)
orders(id, amount, salary, status)
Task: Retrieve salary from departments that have at least one corresponding entry in orders sharing the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18112 | train |
v1 | Schema:
branches (alias: brc)(value, amount, id, date)
sales(amount, name, level, status)
Task: Select salary from branches where id exists in sales for the same level.
SQL: | SELECT salary FROM branches AS brc
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_18113 | train |
v3 | Schema:
employees (alias: emp)(date, name, status, value)
schedules(type, status, id, amount)
Task: Retrieve code from employees with amount above the MAX(value) of schedules rows sharing the same type.
SQL: | SELECT code FROM employees AS emp
WHERE amount > (
SELECT MAX(value) FROM schedules AS schd
WHERE schd.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18114 | train |
v1 | Schema:
requests (alias: ordr)(salary, type, date, amount)
customers(id, status, salary, value)
Task: Select amount from requests where id exists in customers for the same status.
SQL: | SELECT amount FROM requests AS ordr
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_18115 | train |
v3 | Schema:
departments (alias: dept)(id, salary, status, date)
categories(salary, amount, name, date)
Task: Retrieve code from departments with value above the AVG(amount) of categories rows sharing the same level.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT AVG(amount) FROM categories AS catg
WHERE catg.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18116 | train |
v3 | Schema:
managers (alias: mgr)(date, id, status, level)
accounts(amount, level, id, status)
Task: Retrieve id from managers with salary above the COUNT(amount) of accounts rows sharing the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE salary > (
SELECT COUNT(amount) FROM accounts AS acct
WHERE acct.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18117 | train |
v3 | Schema:
regions (alias: rgn)(type, amount, value, code)
items(id, amount, date, code)
Task: Retrieve amount from regions with amount above the MIN(amount) of items rows sharing the same type.
SQL: | SELECT amount FROM regions AS rgn
WHERE amount > (
SELECT MIN(amount) FROM items AS lne
WHERE lne.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_18118 | train |
v1 | Schema:
items (alias: lne)(status, amount, value, date)
categories(status, name, salary, date)
Task: Select salary from items where type exists in categories for the same type.
SQL: | SELECT salary FROM items AS lne
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.type = lne.type
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_18119 | train |
v3 | Schema:
accounts (alias: acct)(level, amount, status, type)
staff(type, salary, name, level)
Task: Retrieve value from accounts with amount above the SUM(amount) of staff rows sharing the same type.
SQL: | SELECT value FROM accounts AS acct
WHERE amount > (
SELECT SUM(amount) FROM staff AS empl
WHERE empl.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18120 | train |
v2 | Schema:
regions (alias: rgn)(level, id, status, value)
invoices(name, type, date, amount)
Task: Retrieve name from regions that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_18121 | train |
v2 | Schema:
staff (alias: empl)(code, type, name, status)
projects(value, date, type, salary)
Task: Find name from staff where a matching record exists in projects with the same status.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_18122 | train |
v1 | Schema:
orders (alias: ord)(date, value, type, name)
requests(amount, level, date, value)
Task: Find id from orders where status appears in requests entries with matching code.
SQL: | SELECT id FROM orders AS ord
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18123 | train |
v1 | Schema:
schedules (alias: schd)(value, type, id, amount)
requests(code, id, date, type)
Task: Find value from schedules where level appears in requests entries with matching code.
SQL: | SELECT value FROM schedules AS schd
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_18124 | train |
v1 | Schema:
sales (alias: sale)(date, name, value, level)
products(date, value, name, salary)
Task: Select value from sales where id exists in products for the same status.
SQL: | SELECT value FROM sales AS sale
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18125 | train |
v2 | Schema:
employees (alias: emp)(level, name, value, salary)
transactions(salary, code, name, level)
Task: Find value from employees where a matching record exists in transactions with the same level.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18126 | train |
v2 | Schema:
items (alias: lne)(salary, value, status, amount)
staff(amount, date, id, salary)
Task: Find name from items where a matching record exists in staff with the same type.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = lne.type
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_18127 | train |
v1 | Schema:
managers (alias: mgr)(salary, date, status, value)
invoices(status, level, type, salary)
Task: Select salary from managers where type exists in invoices for the same status.
SQL: | SELECT salary FROM managers AS mgr
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18128 | train |
v2 | Schema:
regions (alias: rgn)(amount, value, level, status)
shipments(value, id, amount, date)
Task: Find id from regions where a matching record exists in shipments with the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_18129 | train |
v2 | Schema:
items (alias: lne)(salary, level, name, code)
products(date, type, value, code)
Task: Retrieve salary from items that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = lne.level
); | {
"outer_table": "items",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_18130 | train |
v3 | Schema:
departments (alias: dept)(salary, type, status, amount)
invoices(name, level, salary, amount)
Task: Retrieve name from departments with amount above the COUNT(value) of invoices rows sharing the same code.
SQL: | SELECT name FROM departments AS dept
WHERE amount > (
SELECT COUNT(value) FROM invoices AS inv
WHERE inv.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "invoices",
"outer_alias": "dept",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18131 | train |
v3 | Schema:
orders (alias: ord)(date, salary, value, level)
branches(date, name, status, level)
Task: Retrieve code from orders with salary above the AVG(amount) of branches rows sharing the same code.
SQL: | SELECT code FROM orders AS ord
WHERE salary > (
SELECT AVG(amount) FROM branches AS brc
WHERE brc.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18132 | train |
v2 | Schema:
transactions (alias: txn)(amount, value, status, code)
tasks(salary, code, type, value)
Task: Retrieve id from transactions that have at least one corresponding entry in tasks sharing the same id.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18133 | train |
v3 | Schema:
staff (alias: empl)(name, amount, status, level)
customers(value, date, id, code)
Task: Retrieve code from staff with value above the MAX(amount) of customers rows sharing the same code.
SQL: | SELECT code FROM staff AS empl
WHERE value > (
SELECT MAX(amount) FROM customers AS cust
WHERE cust.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_18134 | train |
v3 | Schema:
managers (alias: mgr)(code, name, amount, id)
invoices(id, code, level, type)
Task: Find code from managers where salary exceeds the maximum salary from invoices for the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE salary > (
SELECT MAX(salary) FROM invoices AS inv
WHERE inv.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18135 | train |
v2 | Schema:
branches (alias: brc)(salary, date, amount, id)
projects(type, salary, code, date)
Task: Retrieve amount from branches that have at least one corresponding entry in projects sharing the same level.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_18136 | train |
v1 | Schema:
tasks (alias: tsk)(amount, name, value, code)
products(level, value, id, amount)
Task: Retrieve salary from tasks whose type is found in products rows where type matches the outer record.
SQL: | SELECT salary FROM tasks AS tsk
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_18137 | train |
v2 | Schema:
requests (alias: ordr)(amount, id, code, name)
staff(name, id, salary, type)
Task: Find salary from requests where a matching record exists in staff with the same level.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_18138 | train |
v3 | Schema:
accounts (alias: acct)(type, name, level, id)
schedules(amount, id, name, type)
Task: Find name from accounts where amount exceeds the average value from schedules for the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE amount > (
SELECT AVG(value) FROM schedules AS schd
WHERE schd.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18139 | train |
v2 | Schema:
products (alias: prod)(code, id, salary, level)
customers(name, id, date, value)
Task: Retrieve id from products that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = prod.status
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18140 | train |
v1 | Schema:
sales (alias: sale)(id, name, value, code)
orders(type, code, salary, status)
Task: Find id from sales where code appears in orders entries with matching id.
SQL: | SELECT id FROM sales AS sale
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18141 | train |
v1 | Schema:
categories (alias: catg)(code, type, status, salary)
tasks(name, type, status, code)
Task: Select code from categories where type exists in tasks for the same code.
SQL: | SELECT code FROM categories AS catg
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_18142 | train |
v1 | Schema:
schedules (alias: schd)(id, value, name, level)
customers(amount, type, code, level)
Task: Retrieve value from schedules whose status is found in customers rows where id matches the outer record.
SQL: | SELECT value FROM schedules AS schd
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_18143 | train |
v2 | Schema:
regions (alias: rgn)(salary, date, amount, level)
transactions(name, level, amount, code)
Task: Retrieve amount from regions that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_18144 | train |
v2 | Schema:
shipments (alias: shp)(date, type, id, code)
projects(code, name, level, status)
Task: Retrieve code from shipments that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_18145 | train |
v2 | Schema:
orders (alias: ord)(date, level, value, id)
projects(salary, id, status, level)
Task: Retrieve amount from orders that have at least one corresponding entry in projects sharing the same type.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18146 | train |
v3 | Schema:
customers (alias: cust)(salary, code, type, amount)
branches(date, type, amount, salary)
Task: Find amount from customers where salary exceeds the count of salary from branches for the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE salary > (
SELECT COUNT(salary) FROM branches AS brc
WHERE brc.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "branches",
"outer_alias": "cust",
"inner_alias": "brc",
"proj_col": "amount",
"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_18147 | train |
v3 | Schema:
products (alias: prod)(value, name, code, status)
staff(level, value, type, name)
Task: Find id from products where amount exceeds the total salary from staff for the same status.
SQL: | SELECT id FROM products AS prod
WHERE amount > (
SELECT SUM(salary) FROM staff AS empl
WHERE empl.status = prod.status
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18148 | train |
v1 | Schema:
projects (alias: prj)(name, status, amount, value)
requests(name, date, code, type)
Task: Retrieve amount from projects whose id is found in requests rows where status matches the outer record.
SQL: | SELECT amount FROM projects AS prj
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_18149 | train |
v1 | Schema:
branches (alias: brc)(id, date, amount, value)
orders(value, salary, id, type)
Task: Select id from branches where level exists in orders for the same type.
SQL: | SELECT id FROM branches AS brc
WHERE level IN (
SELECT level 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": "level",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_18150 | train |
v1 | Schema:
tasks (alias: tsk)(id, date, name, level)
accounts(id, amount, code, value)
Task: Select code from tasks where level exists in accounts for the same level.
SQL: | SELECT code FROM tasks AS tsk
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_18151 | train |
v1 | Schema:
managers (alias: mgr)(id, status, name, date)
customers(amount, level, salary, value)
Task: Find amount from managers where level appears in customers entries with matching status.
SQL: | SELECT amount FROM managers AS mgr
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18152 | train |
v2 | Schema:
orders (alias: ord)(status, type, code, amount)
managers(id, salary, status, level)
Task: Find amount from orders where a matching record exists in managers with the same status.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18153 | train |
v2 | Schema:
regions (alias: rgn)(date, type, name, status)
schedules(status, level, type, value)
Task: Retrieve id from regions that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_18154 | train |
v1 | Schema:
invoices (alias: inv)(status, name, code, date)
managers(code, salary, id, amount)
Task: Select id from invoices where code exists in managers for the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18155 | train |
v1 | Schema:
staff (alias: empl)(amount, code, type, date)
transactions(level, id, salary, code)
Task: Retrieve salary from staff whose type is found in transactions rows where code matches the outer record.
SQL: | SELECT salary FROM staff AS empl
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_18156 | train |
v2 | Schema:
tasks (alias: tsk)(level, id, date, code)
regions(date, amount, value, name)
Task: Find name from tasks where a matching record exists in regions with the same status.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_18157 | train |
v2 | Schema:
invoices (alias: inv)(salary, value, level, code)
sales(date, status, code, amount)
Task: Find name from invoices where a matching record exists in sales with the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18158 | train |
v1 | Schema:
managers (alias: mgr)(level, value, salary, date)
products(id, type, name, code)
Task: Select id from managers where type exists in products for the same id.
SQL: | SELECT id FROM managers AS mgr
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18159 | train |
v3 | Schema:
orders (alias: ord)(level, value, code, amount)
invoices(name, value, level, amount)
Task: Find value from orders where salary exceeds the minimum amount from invoices for the same status.
SQL: | SELECT value FROM orders AS ord
WHERE salary > (
SELECT MIN(amount) FROM invoices AS inv
WHERE inv.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18160 | train |
v2 | Schema:
accounts (alias: acct)(value, status, level, type)
shipments(level, id, type, date)
Task: Retrieve name from accounts that have at least one corresponding entry in shipments sharing the same status.
SQL: | SELECT name 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": "name",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18161 | train |
v2 | Schema:
customers (alias: cust)(id, salary, code, value)
regions(date, level, salary, name)
Task: Retrieve value from customers that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18162 | train |
v2 | Schema:
departments (alias: dept)(status, name, id, level)
branches(level, amount, value, date)
Task: Find amount from departments where a matching record exists in branches with the same code.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18163 | train |
v1 | Schema:
regions (alias: rgn)(name, value, level, id)
shipments(status, amount, value, code)
Task: Retrieve id from regions whose level is found in shipments rows where id matches the outer record.
SQL: | SELECT id FROM regions AS rgn
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_18164 | train |
v3 | Schema:
shipments (alias: shp)(name, status, id, amount)
accounts(status, amount, level, name)
Task: Find name from shipments where salary exceeds the minimum value from accounts for the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE salary > (
SELECT MIN(value) FROM accounts AS acct
WHERE acct.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_18165 | train |
v3 | Schema:
sales (alias: sale)(date, code, id, salary)
managers(value, id, date, code)
Task: Retrieve salary from sales with value above the SUM(salary) of managers rows sharing the same id.
SQL: | SELECT salary FROM sales AS sale
WHERE value > (
SELECT SUM(salary) FROM managers AS mgr
WHERE mgr.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18166 | train |
v3 | Schema:
requests (alias: ordr)(value, id, amount, salary)
customers(code, amount, level, name)
Task: Find id from requests where salary exceeds the total value from customers for the same id.
SQL: | SELECT id FROM requests AS ordr
WHERE salary > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_18167 | train |
v3 | Schema:
invoices (alias: inv)(date, type, salary, value)
transactions(name, value, type, id)
Task: Find name from invoices where salary exceeds the minimum amount from transactions for the same code.
SQL: | SELECT name FROM invoices AS inv
WHERE salary > (
SELECT MIN(amount) FROM transactions AS txn
WHERE txn.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18168 | train |
v1 | Schema:
employees (alias: emp)(amount, value, code, date)
schedules(value, code, amount, status)
Task: Find value from employees where code appears in schedules entries with matching type.
SQL: | SELECT value FROM employees AS emp
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18169 | train |
v2 | Schema:
sales (alias: sale)(code, type, name, id)
orders(status, date, value, id)
Task: Find value from sales where a matching record exists in orders with the same type.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18170 | train |
v3 | Schema:
shipments (alias: shp)(code, name, date, id)
managers(value, status, code, salary)
Task: Retrieve code from shipments with amount above the MAX(value) of managers rows sharing the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE amount > (
SELECT MAX(value) FROM managers AS mgr
WHERE mgr.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_18171 | train |
v3 | Schema:
employees (alias: emp)(level, name, value, type)
managers(code, type, value, level)
Task: Retrieve salary from employees with value above the MIN(amount) of managers rows sharing the same id.
SQL: | SELECT salary FROM employees AS emp
WHERE value > (
SELECT MIN(amount) FROM managers AS mgr
WHERE mgr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18172 | train |
v1 | Schema:
tasks (alias: tsk)(salary, id, value, type)
transactions(id, salary, status, level)
Task: Retrieve amount from tasks whose status is found in transactions rows where code matches the outer record.
SQL: | SELECT amount FROM tasks AS tsk
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_18173 | train |
v1 | Schema:
tasks (alias: tsk)(status, date, code, level)
accounts(status, id, code, level)
Task: Select salary from tasks where level exists in accounts for the same level.
SQL: | SELECT salary FROM tasks AS tsk
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_18174 | train |
v1 | Schema:
regions (alias: rgn)(name, level, id, status)
customers(code, id, level, value)
Task: Find amount from regions where id appears in customers entries with matching level.
SQL: | SELECT amount FROM regions AS rgn
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_18175 | train |
v1 | Schema:
items (alias: lne)(date, code, id, value)
managers(type, id, value, salary)
Task: Find id from items where code appears in managers entries with matching type.
SQL: | SELECT id FROM items AS lne
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.type = lne.type
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_18176 | train |
v1 | Schema:
accounts (alias: acct)(level, name, date, amount)
shipments(id, code, value, salary)
Task: Find salary from accounts where id appears in shipments entries with matching code.
SQL: | SELECT salary FROM accounts AS acct
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18177 | train |
v2 | Schema:
managers (alias: mgr)(date, name, value, amount)
customers(name, status, type, date)
Task: Find salary from managers where a matching record exists in customers with the same code.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18178 | train |
v2 | Schema:
requests (alias: ordr)(name, level, salary, type)
orders(level, date, value, id)
Task: Find salary from requests where a matching record exists in orders with the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_18179 | train |
v1 | Schema:
items (alias: lne)(salary, amount, date, code)
regions(name, type, level, date)
Task: Select value from items where code exists in regions for the same id.
SQL: | SELECT value FROM items AS lne
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.id = lne.id
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_18180 | train |
v3 | Schema:
customers (alias: cust)(type, level, status, name)
items(name, id, code, salary)
Task: Retrieve amount from customers with amount above the AVG(amount) of items rows sharing the same code.
SQL: | SELECT amount FROM customers AS cust
WHERE amount > (
SELECT AVG(amount) FROM items AS lne
WHERE lne.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18181 | train |
v1 | Schema:
tasks (alias: tsk)(amount, status, date, type)
projects(code, status, type, name)
Task: Select amount from tasks where id exists in projects for the same code.
SQL: | SELECT amount FROM tasks AS tsk
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_18182 | train |
v2 | Schema:
staff (alias: empl)(name, level, status, date)
tasks(level, value, status, id)
Task: Find value from staff where a matching record exists in tasks with the same status.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_18183 | train |
v2 | Schema:
accounts (alias: acct)(level, date, id, amount)
staff(value, name, salary, id)
Task: Find code from accounts where a matching record exists in staff with the same id.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18184 | train |
v2 | Schema:
projects (alias: prj)(date, status, salary, type)
employees(name, id, status, code)
Task: Retrieve salary from projects that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_18185 | train |
v1 | Schema:
tasks (alias: tsk)(date, status, type, id)
invoices(name, salary, amount, level)
Task: Find code from tasks where type appears in invoices entries with matching id.
SQL: | SELECT code FROM tasks AS tsk
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_18186 | train |
v3 | Schema:
branches (alias: brc)(level, date, code, status)
orders(level, type, date, amount)
Task: Retrieve salary from branches with amount above the MAX(salary) of orders rows sharing the same level.
SQL: | SELECT salary FROM branches AS brc
WHERE amount > (
SELECT MAX(salary) FROM orders AS ord
WHERE ord.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_18187 | train |
v1 | Schema:
staff (alias: empl)(id, salary, code, date)
regions(id, amount, code, type)
Task: Find id from staff where status appears in regions entries with matching type.
SQL: | SELECT id FROM staff AS empl
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_18188 | train |
v2 | Schema:
transactions (alias: txn)(id, code, type, name)
departments(name, code, date, level)
Task: Find amount from transactions where a matching record exists in departments with the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18189 | train |
v2 | Schema:
products (alias: prod)(salary, value, id, name)
employees(date, salary, level, id)
Task: Retrieve code from products that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = prod.type
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18190 | train |
v2 | Schema:
schedules (alias: schd)(status, id, name, salary)
invoices(value, salary, type, status)
Task: Find code from schedules where a matching record exists in invoices with the same status.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_18191 | train |
v3 | Schema:
sales (alias: sale)(id, value, date, status)
items(amount, type, id, date)
Task: Retrieve value from sales with value above the MIN(salary) of items rows sharing the same status.
SQL: | SELECT value FROM sales AS sale
WHERE value > (
SELECT MIN(salary) FROM items AS lne
WHERE lne.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18192 | train |
v3 | Schema:
staff (alias: empl)(type, name, date, value)
sales(salary, value, status, amount)
Task: Find name from staff where value exceeds the count of amount from sales for the same id.
SQL: | SELECT name FROM staff AS empl
WHERE value > (
SELECT COUNT(amount) FROM sales AS sale
WHERE sale.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_18193 | train |
v1 | Schema:
employees (alias: emp)(code, salary, name, type)
projects(date, level, id, value)
Task: Find salary from employees where level appears in projects entries with matching id.
SQL: | SELECT salary FROM employees AS emp
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "projects",
"outer_alias": "emp",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18194 | train |
v3 | Schema:
accounts (alias: acct)(name, level, status, value)
managers(salary, date, code, value)
Task: Find code from accounts where amount exceeds the total salary from managers for the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE amount > (
SELECT SUM(salary) FROM managers AS mgr
WHERE mgr.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18195 | train |
v3 | Schema:
staff (alias: empl)(status, salary, value, level)
branches(name, type, status, code)
Task: Retrieve code from staff with salary above the MAX(salary) of branches rows sharing the same id.
SQL: | SELECT code FROM staff AS empl
WHERE salary > (
SELECT MAX(salary) FROM branches AS brc
WHERE brc.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_18196 | train |
v3 | Schema:
accounts (alias: acct)(value, level, amount, name)
staff(type, date, level, amount)
Task: Find code from accounts where amount exceeds the average value from staff for the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE amount > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18197 | train |
v3 | Schema:
staff (alias: empl)(level, id, status, code)
invoices(value, amount, salary, code)
Task: Retrieve value from staff with amount above the MAX(amount) of invoices rows sharing the same code.
SQL: | SELECT value FROM staff AS empl
WHERE amount > (
SELECT MAX(amount) FROM invoices AS inv
WHERE inv.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_18198 | train |
v3 | Schema:
departments (alias: dept)(value, code, date, status)
regions(value, code, id, status)
Task: Retrieve code from departments with value above the SUM(salary) of regions rows sharing the same code.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT SUM(salary) FROM regions AS rgn
WHERE rgn.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18199 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.