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:
projects (alias: prj)(date, status, amount, type)
invoices(code, type, date, value)
Task: Retrieve code from projects that have at least one corresponding entry in invoices sharing the same level.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16200 | train |
v2 | Schema:
requests (alias: ordr)(code, date, salary, level)
regions(code, type, id, date)
Task: Retrieve id from requests that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16201 | train |
v3 | Schema:
staff (alias: empl)(salary, value, name, status)
orders(name, type, level, date)
Task: Retrieve salary from staff with value above the COUNT(salary) of orders rows sharing the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE value > (
SELECT COUNT(salary) FROM orders AS ord
WHERE ord.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16202 | train |
v1 | Schema:
managers (alias: mgr)(value, amount, level, code)
accounts(id, type, salary, amount)
Task: Find amount from managers where code appears in accounts entries with matching level.
SQL: | SELECT amount FROM managers AS mgr
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16203 | train |
v1 | Schema:
schedules (alias: schd)(type, status, code, value)
regions(name, type, salary, status)
Task: Find name from schedules where status appears in regions entries with matching id.
SQL: | SELECT name FROM schedules AS schd
WHERE status IN (
SELECT status 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": "status",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16204 | train |
v2 | Schema:
schedules (alias: schd)(salary, value, amount, code)
branches(code, salary, name, date)
Task: Find id from schedules where a matching record exists in branches with the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16205 | train |
v2 | Schema:
customers (alias: cust)(type, value, amount, code)
tasks(name, type, value, level)
Task: Find value from customers where a matching record exists in tasks with the same status.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "tasks",
"outer_alias": "cust",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16206 | train |
v1 | Schema:
customers (alias: cust)(amount, id, date, code)
employees(value, code, name, amount)
Task: Select code from customers where status exists in employees for the same status.
SQL: | SELECT code FROM customers AS cust
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16207 | train |
v1 | Schema:
accounts (alias: acct)(name, status, value, level)
requests(status, name, type, salary)
Task: Select code from accounts where status exists in requests for the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16208 | train |
v3 | Schema:
employees (alias: emp)(name, amount, value, type)
managers(level, type, value, status)
Task: Retrieve amount from employees with value above the MAX(salary) of managers rows sharing the same code.
SQL: | SELECT amount FROM employees AS emp
WHERE value > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16209 | train |
v1 | Schema:
orders (alias: ord)(level, amount, status, value)
items(type, value, id, code)
Task: Retrieve value from orders whose type is found in items rows where id matches the outer record.
SQL: | SELECT value FROM orders AS ord
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16210 | train |
v1 | Schema:
employees (alias: emp)(salary, value, code, type)
items(status, name, date, code)
Task: Select salary from employees where status exists in items for the same type.
SQL: | SELECT salary FROM employees AS emp
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16211 | train |
v3 | Schema:
projects (alias: prj)(salary, id, code, type)
branches(name, salary, id, value)
Task: Retrieve amount from projects with salary above the AVG(amount) of branches rows sharing the same type.
SQL: | SELECT amount FROM projects AS prj
WHERE salary > (
SELECT AVG(amount) FROM branches AS brc
WHERE brc.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16212 | train |
v2 | Schema:
projects (alias: prj)(amount, salary, value, name)
accounts(status, date, id, level)
Task: Find amount from projects where a matching record exists in accounts with the same status.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16213 | train |
v3 | Schema:
employees (alias: emp)(date, amount, code, type)
items(status, type, salary, value)
Task: Find code from employees where salary exceeds the maximum value from items for the same code.
SQL: | SELECT code FROM employees AS emp
WHERE salary > (
SELECT MAX(value) FROM items AS lne
WHERE lne.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16214 | train |
v1 | Schema:
employees (alias: emp)(level, date, amount, status)
orders(id, amount, code, status)
Task: Retrieve value from employees whose type is found in orders rows where type matches the outer record.
SQL: | SELECT value FROM employees AS emp
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16215 | train |
v3 | Schema:
accounts (alias: acct)(code, name, level, salary)
managers(level, date, name, status)
Task: Find id from accounts where salary exceeds the minimum value from managers for the same type.
SQL: | SELECT id FROM accounts AS acct
WHERE salary > (
SELECT MIN(value) FROM managers AS mgr
WHERE mgr.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16216 | train |
v2 | Schema:
regions (alias: rgn)(type, level, status, id)
schedules(id, status, value, amount)
Task: Retrieve code from regions that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT code 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": "code",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16217 | train |
v1 | Schema:
categories (alias: catg)(id, date, salary, code)
invoices(id, date, level, salary)
Task: Retrieve code from categories whose type is found in invoices rows where code matches the outer record.
SQL: | SELECT code FROM categories AS catg
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16218 | train |
v3 | Schema:
invoices (alias: inv)(code, id, value, status)
shipments(amount, id, name, status)
Task: Retrieve value from invoices with value above the MIN(value) of shipments rows sharing the same id.
SQL: | SELECT value FROM invoices AS inv
WHERE value > (
SELECT MIN(value) FROM shipments AS shp
WHERE shp.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16219 | train |
v2 | Schema:
regions (alias: rgn)(level, date, amount, type)
employees(id, name, value, code)
Task: Find value from regions where a matching record exists in employees with the same type.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16220 | train |
v2 | Schema:
branches (alias: brc)(id, code, status, value)
requests(value, salary, amount, level)
Task: Retrieve salary from branches that have at least one corresponding entry in requests sharing the same id.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16221 | train |
v3 | Schema:
sales (alias: sale)(salary, date, amount, status)
schedules(status, date, name, salary)
Task: Find code from sales where amount exceeds the maximum salary from schedules for the same id.
SQL: | SELECT code FROM sales AS sale
WHERE amount > (
SELECT MAX(salary) FROM schedules AS schd
WHERE schd.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16222 | train |
v1 | Schema:
schedules (alias: schd)(level, status, code, id)
accounts(value, date, status, level)
Task: Select id from schedules where status exists in accounts for the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16223 | train |
v3 | Schema:
schedules (alias: schd)(amount, status, name, salary)
managers(level, status, salary, type)
Task: Find value from schedules where salary exceeds the average amount from managers for the same type.
SQL: | SELECT value FROM schedules AS schd
WHERE salary > (
SELECT AVG(amount) FROM managers AS mgr
WHERE mgr.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16224 | train |
v1 | Schema:
items (alias: lne)(type, name, date, status)
invoices(name, id, type, code)
Task: Select value from items where status exists in invoices for the same status.
SQL: | SELECT value FROM items AS lne
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.status = lne.status
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16225 | train |
v2 | Schema:
orders (alias: ord)(code, salary, amount, value)
shipments(name, salary, value, code)
Task: Find value from orders where a matching record exists in shipments with the same type.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16226 | train |
v2 | Schema:
schedules (alias: schd)(status, level, value, name)
products(amount, salary, name, status)
Task: Find amount from schedules where a matching record exists in products with the same level.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16227 | train |
v1 | Schema:
customers (alias: cust)(id, name, value, type)
employees(status, value, amount, id)
Task: Retrieve salary from customers whose id is found in employees rows where status matches the outer record.
SQL: | SELECT salary FROM customers AS cust
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16228 | train |
v3 | Schema:
transactions (alias: txn)(date, id, amount, status)
orders(status, type, name, amount)
Task: Find amount from transactions where amount exceeds the count of value from orders for the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE amount > (
SELECT COUNT(value) FROM orders AS ord
WHERE ord.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16229 | train |
v3 | Schema:
sales (alias: sale)(salary, id, value, amount)
transactions(level, id, salary, type)
Task: Find id from sales where value exceeds the total amount from transactions for the same status.
SQL: | SELECT id FROM sales AS sale
WHERE value > (
SELECT SUM(amount) FROM transactions AS txn
WHERE txn.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16230 | train |
v2 | Schema:
projects (alias: prj)(level, status, code, date)
orders(code, salary, name, status)
Task: Retrieve amount from projects that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "orders",
"outer_alias": "prj",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16231 | train |
v2 | Schema:
schedules (alias: schd)(code, value, date, name)
accounts(id, value, name, amount)
Task: Find value from schedules where a matching record exists in accounts with the same status.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16232 | train |
v3 | Schema:
employees (alias: emp)(code, amount, status, salary)
sales(code, level, salary, id)
Task: Retrieve value from employees with amount above the AVG(salary) of sales rows sharing the same id.
SQL: | SELECT value FROM employees AS emp
WHERE amount > (
SELECT AVG(salary) FROM sales AS sale
WHERE sale.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16233 | train |
v3 | Schema:
schedules (alias: schd)(salary, status, type, date)
orders(salary, amount, code, level)
Task: Retrieve id from schedules with value above the SUM(value) of orders rows sharing the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE value > (
SELECT SUM(value) FROM orders AS ord
WHERE ord.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16234 | train |
v3 | Schema:
accounts (alias: acct)(value, level, status, type)
schedules(value, code, name, status)
Task: Find name from accounts where salary exceeds the maximum salary from schedules for the same id.
SQL: | SELECT name FROM accounts AS acct
WHERE salary > (
SELECT MAX(salary) FROM schedules AS schd
WHERE schd.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16235 | train |
v2 | Schema:
shipments (alias: shp)(id, type, level, code)
categories(name, value, date, status)
Task: Find value from shipments where a matching record exists in categories with the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16236 | train |
v3 | Schema:
categories (alias: catg)(code, level, type, status)
departments(date, code, level, type)
Task: Find amount from categories where amount exceeds the maximum amount from departments for the same code.
SQL: | SELECT amount FROM categories AS catg
WHERE amount > (
SELECT MAX(amount) FROM departments AS dept
WHERE dept.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16237 | train |
v1 | Schema:
invoices (alias: inv)(type, amount, salary, level)
sales(value, salary, name, amount)
Task: Select id from invoices where type exists in sales for the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16238 | train |
v3 | Schema:
categories (alias: catg)(level, code, salary, id)
orders(type, name, value, code)
Task: Find salary from categories where salary exceeds the average salary from orders for the same level.
SQL: | SELECT salary FROM categories AS catg
WHERE salary > (
SELECT AVG(salary) FROM orders AS ord
WHERE ord.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16239 | train |
v3 | Schema:
sales (alias: sale)(salary, type, id, status)
regions(value, name, status, level)
Task: Retrieve id from sales with amount above the COUNT(value) of regions rows sharing the same type.
SQL: | SELECT id FROM sales AS sale
WHERE amount > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16240 | train |
v2 | Schema:
requests (alias: ordr)(status, code, id, salary)
branches(name, level, type, status)
Task: Find name from requests where a matching record exists in branches with the same type.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16241 | train |
v1 | Schema:
regions (alias: rgn)(name, type, level, code)
employees(salary, amount, type, status)
Task: Retrieve salary from regions whose id is found in employees rows where code matches the outer record.
SQL: | SELECT salary FROM regions AS rgn
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16242 | train |
v2 | Schema:
orders (alias: ord)(name, status, type, id)
managers(name, id, date, level)
Task: Find id from orders where a matching record exists in managers with the same code.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16243 | train |
v1 | Schema:
invoices (alias: inv)(status, type, date, level)
staff(date, amount, level, id)
Task: Select code from invoices where status exists in staff for the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16244 | train |
v3 | Schema:
accounts (alias: acct)(level, name, code, value)
schedules(type, code, name, amount)
Task: Retrieve salary from accounts with salary above the MIN(value) of schedules rows sharing the same code.
SQL: | SELECT salary FROM accounts AS acct
WHERE salary > (
SELECT MIN(value) FROM schedules AS schd
WHERE schd.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16245 | train |
v2 | Schema:
orders (alias: ord)(date, id, name, level)
transactions(salary, value, date, level)
Task: Find value from orders where a matching record exists in transactions with the same id.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16246 | train |
v1 | Schema:
departments (alias: dept)(status, date, level, type)
customers(date, id, type, amount)
Task: Retrieve amount from departments whose type is found in customers rows where type matches the outer record.
SQL: | SELECT amount FROM departments AS dept
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16247 | train |
v3 | Schema:
items (alias: lne)(name, salary, type, date)
branches(salary, amount, value, name)
Task: Retrieve salary from items with value above the AVG(value) of branches rows sharing the same status.
SQL: | SELECT salary FROM items AS lne
WHERE value > (
SELECT AVG(value) FROM branches AS brc
WHERE brc.status = lne.status
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16248 | train |
v3 | Schema:
products (alias: prod)(status, name, salary, code)
branches(value, date, id, amount)
Task: Retrieve value from products with amount above the AVG(value) of branches rows sharing the same status.
SQL: | SELECT value FROM products AS prod
WHERE amount > (
SELECT AVG(value) FROM branches AS brc
WHERE brc.status = prod.status
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16249 | train |
v2 | Schema:
employees (alias: emp)(amount, code, value, level)
shipments(name, amount, date, level)
Task: Retrieve salary from employees that have at least one corresponding entry in shipments sharing the same level.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16250 | train |
v1 | Schema:
schedules (alias: schd)(code, date, value, type)
transactions(name, id, status, level)
Task: Select name from schedules where id exists in transactions for the same status.
SQL: | SELECT name FROM schedules AS schd
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16251 | train |
v1 | Schema:
items (alias: lne)(status, date, code, level)
managers(value, name, amount, code)
Task: Select id from items where type exists in managers for the same code.
SQL: | SELECT id FROM items AS lne
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16252 | train |
v1 | Schema:
transactions (alias: txn)(salary, code, status, name)
regions(date, level, name, status)
Task: Retrieve id from transactions whose code is found in regions rows where type matches the outer record.
SQL: | SELECT id FROM transactions AS txn
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16253 | train |
v1 | Schema:
staff (alias: empl)(salary, code, id, type)
transactions(code, level, id, type)
Task: Select amount from staff where level exists in transactions for the same code.
SQL: | SELECT amount FROM staff AS empl
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16254 | train |
v2 | Schema:
regions (alias: rgn)(type, level, salary, code)
shipments(salary, name, amount, code)
Task: Retrieve code from regions that have at least one corresponding entry in shipments sharing the same status.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16255 | train |
v2 | Schema:
orders (alias: ord)(amount, status, name, date)
customers(status, date, name, type)
Task: Retrieve salary from orders that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16256 | train |
v2 | Schema:
schedules (alias: schd)(value, date, code, type)
orders(name, type, salary, status)
Task: Find value from schedules where a matching record exists in orders with the same id.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16257 | train |
v1 | Schema:
items (alias: lne)(amount, level, status, type)
orders(code, salary, status, id)
Task: Find amount from items where status appears in orders entries with matching status.
SQL: | SELECT amount FROM items AS lne
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.status = lne.status
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16258 | train |
v3 | Schema:
regions (alias: rgn)(salary, level, status, id)
items(code, id, level, amount)
Task: Find amount from regions where salary exceeds the minimum amount from items for the same status.
SQL: | SELECT amount FROM regions AS rgn
WHERE salary > (
SELECT MIN(amount) FROM items AS lne
WHERE lne.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16259 | train |
v1 | Schema:
transactions (alias: txn)(id, status, code, salary)
shipments(level, code, date, name)
Task: Select salary from transactions where id exists in shipments for the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16260 | train |
v2 | Schema:
customers (alias: cust)(status, salary, name, amount)
projects(salary, status, date, amount)
Task: Find id from customers where a matching record exists in projects with the same type.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16261 | train |
v3 | Schema:
transactions (alias: txn)(type, amount, code, salary)
schedules(level, name, code, amount)
Task: Find id from transactions where value exceeds the minimum salary from schedules for the same status.
SQL: | SELECT id FROM transactions AS txn
WHERE value > (
SELECT MIN(salary) FROM schedules AS schd
WHERE schd.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16262 | train |
v2 | Schema:
orders (alias: ord)(id, amount, status, code)
requests(type, name, level, amount)
Task: Retrieve value from orders that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16263 | train |
v1 | Schema:
regions (alias: rgn)(level, salary, name, amount)
tasks(status, type, level, date)
Task: Find salary from regions where code appears in tasks entries with matching id.
SQL: | SELECT salary FROM regions AS rgn
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16264 | train |
v1 | Schema:
projects (alias: prj)(status, amount, level, salary)
departments(amount, salary, level, code)
Task: Find value from projects where type appears in departments entries with matching type.
SQL: | SELECT value FROM projects AS prj
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16265 | train |
v2 | Schema:
items (alias: lne)(status, amount, value, date)
orders(id, level, salary, amount)
Task: Retrieve name from items that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = lne.level
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16266 | train |
v3 | Schema:
accounts (alias: acct)(value, date, id, name)
managers(amount, level, date, code)
Task: Retrieve amount from accounts with value above the MIN(amount) of managers rows sharing the same status.
SQL: | SELECT amount FROM accounts AS acct
WHERE value > (
SELECT MIN(amount) FROM managers AS mgr
WHERE mgr.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16267 | train |
v3 | Schema:
accounts (alias: acct)(code, level, name, status)
tasks(salary, code, status, amount)
Task: Retrieve code from accounts with salary above the COUNT(amount) of tasks rows sharing the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE salary > (
SELECT COUNT(amount) FROM tasks AS tsk
WHERE tsk.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16268 | train |
v3 | Schema:
products (alias: prod)(name, date, level, status)
customers(name, type, salary, id)
Task: Find amount from products where value exceeds the average amount from customers for the same level.
SQL: | SELECT amount FROM products AS prod
WHERE value > (
SELECT AVG(amount) FROM customers AS cust
WHERE cust.level = prod.level
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16269 | train |
v1 | Schema:
requests (alias: ordr)(id, code, name, status)
products(code, id, level, status)
Task: Retrieve name from requests whose status is found in products rows where code matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16270 | train |
v2 | Schema:
accounts (alias: acct)(id, date, level, code)
items(id, level, salary, status)
Task: Retrieve amount from accounts that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16271 | train |
v3 | Schema:
transactions (alias: txn)(salary, date, code, amount)
items(date, name, salary, amount)
Task: Retrieve name from transactions with salary above the COUNT(salary) of items rows sharing the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE salary > (
SELECT COUNT(salary) FROM items AS lne
WHERE lne.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16272 | train |
v1 | Schema:
employees (alias: emp)(amount, name, value, status)
staff(type, date, value, code)
Task: Find name from employees where status appears in staff entries with matching code.
SQL: | SELECT name FROM employees AS emp
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16273 | train |
v3 | Schema:
branches (alias: brc)(type, status, date, value)
customers(level, salary, date, code)
Task: Find value from branches where amount exceeds the average value from customers for the same code.
SQL: | SELECT value FROM branches AS brc
WHERE amount > (
SELECT AVG(value) FROM customers AS cust
WHERE cust.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16274 | train |
v3 | Schema:
schedules (alias: schd)(name, type, status, code)
accounts(id, salary, level, name)
Task: Find name from schedules where value exceeds the average value from accounts for the same type.
SQL: | SELECT name FROM schedules AS schd
WHERE value > (
SELECT AVG(value) FROM accounts AS acct
WHERE acct.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16275 | train |
v1 | Schema:
regions (alias: rgn)(date, amount, type, salary)
projects(name, amount, status, date)
Task: Select name from regions where type exists in projects for the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16276 | train |
v1 | Schema:
employees (alias: emp)(status, value, name, code)
regions(date, level, id, value)
Task: Retrieve code from employees whose level is found in regions rows where status matches the outer record.
SQL: | SELECT code FROM employees AS emp
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16277 | train |
v1 | Schema:
transactions (alias: txn)(type, amount, status, salary)
branches(name, amount, date, id)
Task: Retrieve amount from transactions whose id is found in branches rows where status matches the outer record.
SQL: | SELECT amount FROM transactions AS txn
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16278 | train |
v3 | Schema:
transactions (alias: txn)(value, id, level, salary)
sales(level, status, salary, id)
Task: Retrieve code from transactions with salary above the SUM(value) of sales rows sharing the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE salary > (
SELECT SUM(value) FROM sales AS sale
WHERE sale.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16279 | train |
v2 | Schema:
regions (alias: rgn)(date, type, salary, value)
managers(salary, id, name, status)
Task: Retrieve name from regions that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16280 | train |
v1 | Schema:
branches (alias: brc)(type, status, salary, date)
employees(type, name, amount, value)
Task: Select name from branches where code exists in employees for the same type.
SQL: | SELECT name FROM branches AS brc
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16281 | train |
v2 | Schema:
regions (alias: rgn)(id, value, type, amount)
customers(type, code, date, salary)
Task: Retrieve id from regions that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16282 | train |
v1 | Schema:
schedules (alias: schd)(code, salary, value, id)
departments(code, value, level, type)
Task: Retrieve name from schedules whose code is found in departments rows where id matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16283 | train |
v1 | Schema:
products (alias: prod)(type, status, date, id)
orders(type, code, date, level)
Task: Retrieve amount from products whose level is found in orders rows where status matches the outer record.
SQL: | SELECT amount FROM products AS prod
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.status = prod.status
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16284 | train |
v3 | Schema:
employees (alias: emp)(id, code, level, value)
sales(status, salary, amount, type)
Task: Retrieve value from employees with salary above the COUNT(salary) of sales rows sharing the same type.
SQL: | SELECT value FROM employees AS emp
WHERE salary > (
SELECT COUNT(salary) FROM sales AS sale
WHERE sale.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16285 | train |
v2 | Schema:
tasks (alias: tsk)(status, level, value, code)
items(value, salary, amount, code)
Task: Retrieve salary from tasks that have at least one corresponding entry in items sharing the same code.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "items",
"outer_alias": "tsk",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16286 | train |
v2 | Schema:
tasks (alias: tsk)(date, status, value, code)
products(date, level, value, name)
Task: Find amount from tasks where a matching record exists in products with the same type.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16287 | train |
v3 | Schema:
departments (alias: dept)(type, value, name, date)
schedules(type, salary, date, value)
Task: Retrieve value from departments with salary above the AVG(value) of schedules rows sharing the same status.
SQL: | SELECT value FROM departments AS dept
WHERE salary > (
SELECT AVG(value) FROM schedules AS schd
WHERE schd.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16288 | train |
v3 | Schema:
invoices (alias: inv)(id, salary, amount, level)
regions(value, salary, name, id)
Task: Retrieve value from invoices with value above the SUM(amount) of regions rows sharing the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE value > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16289 | train |
v1 | Schema:
categories (alias: catg)(salary, level, value, id)
projects(code, status, value, date)
Task: Retrieve salary from categories whose level is found in projects rows where id matches the outer record.
SQL: | SELECT salary FROM categories AS catg
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16290 | train |
v3 | Schema:
staff (alias: empl)(amount, date, status, code)
orders(code, level, date, amount)
Task: Retrieve salary from staff with value above the MAX(amount) of orders rows sharing the same type.
SQL: | SELECT salary FROM staff AS empl
WHERE value > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16291 | train |
v2 | Schema:
invoices (alias: inv)(salary, code, id, type)
customers(status, code, id, date)
Task: Retrieve value from invoices that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16292 | train |
v3 | Schema:
schedules (alias: schd)(status, date, code, level)
departments(status, id, type, value)
Task: Find code from schedules where amount exceeds the maximum value from departments for the same type.
SQL: | SELECT code FROM schedules AS schd
WHERE amount > (
SELECT MAX(value) FROM departments AS dept
WHERE dept.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16293 | train |
v3 | Schema:
schedules (alias: schd)(level, name, code, salary)
categories(level, salary, code, type)
Task: Find amount from schedules where amount exceeds the total salary from categories for the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE amount > (
SELECT SUM(salary) FROM categories AS catg
WHERE catg.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16294 | train |
v1 | Schema:
orders (alias: ord)(code, name, level, status)
tasks(date, salary, status, code)
Task: Retrieve value from orders whose status is found in tasks rows where status matches the outer record.
SQL: | SELECT value FROM orders AS ord
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16295 | train |
v2 | Schema:
projects (alias: prj)(amount, level, date, name)
employees(id, type, level, amount)
Task: Find id from projects where a matching record exists in employees with the same code.
SQL: | SELECT id 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": "id",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16296 | train |
v1 | Schema:
requests (alias: ordr)(id, value, code, amount)
managers(code, date, status, level)
Task: Select amount from requests where type exists in managers for the same id.
SQL: | SELECT amount FROM requests AS ordr
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16297 | train |
v2 | Schema:
regions (alias: rgn)(name, value, status, id)
departments(id, code, name, level)
Task: Find amount from regions where a matching record exists in departments with the same type.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16298 | train |
v2 | Schema:
categories (alias: catg)(status, code, type, level)
regions(id, level, salary, status)
Task: Find value from categories where a matching record exists in regions with the same id.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16299 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.