Dataset Viewer
Auto-converted to Parquet Duplicate
variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v2
Schema: employees (alias: emp)(status, code, date, value) tasks(salary, value, status, type) Task: Find code from employees where a matching record exists in tasks with the same type. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = emp.type );
{ "outer_table": "employees", "inner_table": "tasks", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "code", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00000
train
v1
Schema: accounts (alias: acct)(name, id, salary, level) items(date, status, name, code) Task: Retrieve code from accounts whose code is found in items rows where type matches the outer record. SQL:
SELECT code FROM accounts AS acct WHERE code IN ( SELECT code FROM items AS lne WHERE lne.type = acct.type );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00001
train
v3
Schema: regions (alias: rgn)(amount, code, level, salary) schedules(type, salary, id, amount) Task: Retrieve value from regions with value above the MIN(amount) of schedules rows sharing the same id. SQL:
SELECT value FROM regions AS rgn WHERE value > ( SELECT MIN(amount) FROM schedules AS schd WHERE schd.id = rgn.id );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_00002
train
v2
Schema: sales (alias: sale)(name, status, value, salary) departments(id, date, value, code) Task: Retrieve salary from sales that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = sale.level );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "salary", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00003
train
v1
Schema: departments (alias: dept)(value, type, code, date) requests(name, amount, status, salary) Task: Retrieve code from departments whose code is found in requests rows where status matches the outer record. SQL:
SELECT code FROM departments AS dept WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.status = dept.status );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00004
train
v3
Schema: staff (alias: empl)(salary, amount, type, value) requests(name, value, salary, code) Task: Find amount from staff where amount exceeds the average salary from requests for the same code. SQL:
SELECT amount FROM staff AS empl WHERE amount > ( SELECT AVG(salary) FROM requests AS ordr WHERE ordr.code = empl.code );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_00005
train
v2
Schema: invoices (alias: inv)(level, name, status, value) sales(level, salary, date, status) Task: Find salary from invoices where a matching record exists in sales with the same type. SQL:
SELECT salary 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": "salary", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00006
train
v2
Schema: categories (alias: catg)(level, amount, salary, code) accounts(date, name, amount, type) Task: Retrieve id from categories that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = catg.code );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "id", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00007
train
v2
Schema: departments (alias: dept)(value, type, code, status) categories(code, id, name, type) Task: Find value from departments where a matching record exists in categories with the same type. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = dept.type );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "value", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00008
train
v3
Schema: branches (alias: brc)(date, id, level, amount) employees(value, code, amount, type) Task: Retrieve salary from branches with salary above the MAX(value) of employees rows sharing the same code. SQL:
SELECT salary FROM branches AS brc WHERE salary > ( SELECT MAX(value) FROM employees AS emp WHERE emp.code = brc.code );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_00009
train
v1
Schema: orders (alias: ord)(name, value, amount, status) invoices(type, id, status, date) Task: Find value from orders where status appears in invoices entries with matching id. SQL:
SELECT value FROM orders AS ord WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.id = ord.id );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00010
train
v3
Schema: employees (alias: emp)(type, salary, amount, status) shipments(value, type, id, code) Task: Retrieve salary from employees with salary above the AVG(amount) of shipments rows sharing the same level. SQL:
SELECT salary FROM employees AS emp WHERE salary > ( SELECT AVG(amount) FROM shipments AS shp WHERE shp.level = emp.level );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00011
train
v2
Schema: projects (alias: prj)(type, amount, date, name) categories(date, id, amount, value) Task: Retrieve amount from projects that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT amount FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = prj.id );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "amount", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00012
train
v1
Schema: items (alias: lne)(level, id, code, salary) sales(value, name, type, salary) Task: Find salary from items where level appears in sales entries with matching status. SQL:
SELECT salary FROM items AS lne WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.status = lne.status );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "salary", "filter_col": "level", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00013
train
v1
Schema: transactions (alias: txn)(type, level, amount, status) branches(level, type, date, status) Task: Find value from transactions where level appears in branches entries with matching level. SQL:
SELECT value FROM transactions AS txn WHERE level IN ( SELECT level FROM branches AS brc WHERE brc.level = txn.level );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00014
train
v2
Schema: managers (alias: mgr)(salary, amount, level, id) invoices(amount, date, name, value) Task: Retrieve name from managers that have at least one corresponding entry in invoices sharing the same level. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = mgr.level );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "name", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00015
train
v2
Schema: tasks (alias: tsk)(level, value, code, status) sales(level, date, name, code) Task: Retrieve name from tasks that have at least one corresponding entry in sales sharing the same code. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "sales", "outer_alias": "tsk", "inner_alias": "sale", "proj_col": "name", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_00016
train
v3
Schema: schedules (alias: schd)(value, status, salary, type) products(code, type, level, name) Task: Retrieve name from schedules with value above the MAX(amount) of products rows sharing the same level. SQL:
SELECT name FROM schedules AS schd WHERE value > ( SELECT MAX(amount) FROM products AS prod WHERE prod.level = schd.level );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00017
train
v2
Schema: branches (alias: brc)(type, value, salary, level) employees(amount, value, status, id) Task: Find amount from branches where a matching record exists in employees with the same type. SQL:
SELECT amount FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = brc.type );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "amount", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_00018
train
v2
Schema: employees (alias: emp)(type, value, date, name) staff(id, type, salary, level) Task: Retrieve id from employees that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = emp.status );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00019
train
v2
Schema: categories (alias: catg)(id, salary, name, amount) sales(type, salary, status, amount) Task: Find name from categories where a matching record exists in sales with the same status. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = catg.status );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "name", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00020
train
v1
Schema: invoices (alias: inv)(date, code, id, value) customers(type, salary, name, date) Task: Select id from invoices where level exists in customers for the same code. SQL:
SELECT id FROM invoices AS inv WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.code = inv.code );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00021
train
v3
Schema: schedules (alias: schd)(level, type, status, name) projects(level, code, amount, date) Task: Find code from schedules where value exceeds the count of amount from projects for the same id. SQL:
SELECT code FROM schedules AS schd WHERE value > ( SELECT COUNT(amount) FROM projects AS prj WHERE prj.id = schd.id );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00022
train
v3
Schema: products (alias: prod)(level, name, date, amount) tasks(date, status, salary, type) Task: Retrieve code from products with amount above the MIN(amount) of tasks rows sharing the same type. SQL:
SELECT code FROM products AS prod WHERE amount > ( SELECT MIN(amount) FROM tasks AS tsk WHERE tsk.type = prod.type );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00023
train
v3
Schema: schedules (alias: schd)(id, salary, amount, date) requests(id, type, amount, salary) Task: Find amount from schedules where salary exceeds the maximum value from requests for the same code. SQL:
SELECT amount FROM schedules AS schd WHERE salary > ( SELECT MAX(value) FROM requests AS ordr WHERE ordr.code = schd.code );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00024
train
v3
Schema: sales (alias: sale)(status, date, type, id) requests(amount, code, level, status) Task: Retrieve amount from sales with salary above the COUNT(amount) of requests rows sharing the same type. SQL:
SELECT amount FROM sales AS sale WHERE salary > ( SELECT COUNT(amount) FROM requests AS ordr WHERE ordr.type = sale.type );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00025
train
v3
Schema: items (alias: lne)(code, status, amount, value) employees(code, status, salary, name) Task: Retrieve amount from items with value above the SUM(salary) of employees rows sharing the same status. SQL:
SELECT amount FROM items AS lne WHERE value > ( SELECT SUM(salary) FROM employees AS emp WHERE emp.status = lne.status );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00026
train
v2
Schema: transactions (alias: txn)(amount, salary, status, type) departments(name, type, status, amount) Task: Retrieve id from transactions that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT id 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": "id", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00027
train
v3
Schema: staff (alias: empl)(amount, level, name, value) schedules(status, code, id, name) Task: Find code from staff where salary exceeds the average amount from schedules for the same status. SQL:
SELECT code FROM staff AS empl WHERE salary > ( SELECT AVG(amount) FROM schedules AS schd WHERE schd.status = empl.status );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_00028
train
v1
Schema: regions (alias: rgn)(name, level, code, status) products(salary, status, level, value) Task: Retrieve salary from regions whose status is found in products rows where level matches the outer record. SQL:
SELECT salary FROM regions AS rgn WHERE status IN ( SELECT status FROM products AS prod WHERE prod.level = rgn.level );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_00029
train
v1
Schema: transactions (alias: txn)(type, code, name, value) shipments(code, type, level, name) Task: Select value from transactions where code exists in shipments for the same type. SQL:
SELECT value FROM transactions AS txn WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.type = txn.type );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00030
train
v3
Schema: schedules (alias: schd)(name, amount, date, status) items(status, type, date, salary) Task: Find name from schedules where salary exceeds the count of value from items for the same status. SQL:
SELECT name FROM schedules AS schd WHERE salary > ( SELECT COUNT(value) FROM items AS lne WHERE lne.status = schd.status );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00031
train
v3
Schema: accounts (alias: acct)(name, amount, date, type) products(level, code, amount, value) Task: Retrieve name from accounts with amount above the COUNT(amount) of products rows sharing the same type. SQL:
SELECT name FROM accounts AS acct WHERE amount > ( SELECT COUNT(amount) FROM products AS prod WHERE prod.type = acct.type );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00032
train
v1
Schema: products (alias: prod)(level, id, amount, status) transactions(amount, id, status, type) Task: Retrieve name from products whose level is found in transactions rows where code matches the outer record. SQL:
SELECT name FROM products AS prod WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.code = prod.code );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00033
train
v2
Schema: accounts (alias: acct)(level, date, value, amount) items(name, level, salary, status) Task: Find value from accounts where a matching record exists in items with the same status. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = acct.status );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "value", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00034
train
v1
Schema: sales (alias: sale)(amount, level, name, salary) products(id, code, status, value) Task: Retrieve amount from sales whose level is found in products rows where type matches the outer record. SQL:
SELECT amount FROM sales AS sale WHERE level IN ( SELECT level FROM products AS prod WHERE prod.type = sale.type );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00035
train
v3
Schema: regions (alias: rgn)(date, code, salary, type) requests(date, salary, name, value) Task: Find salary from regions where value exceeds the maximum amount from requests for the same level. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT MAX(amount) FROM requests AS ordr WHERE ordr.level = rgn.level );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_00036
train
v2
Schema: customers (alias: cust)(salary, date, amount, status) tasks(code, id, type, level) Task: Find amount from customers where a matching record exists in tasks with the same status. SQL:
SELECT amount 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": "amount", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00037
train
v2
Schema: orders (alias: ord)(value, name, type, level) items(amount, name, date, id) Task: Find code from orders where a matching record exists in items with the same type. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = ord.type );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "code", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00038
train
v1
Schema: sales (alias: sale)(salary, status, value, level) orders(value, type, salary, status) Task: Find amount from sales where level appears in orders entries with matching level. SQL:
SELECT amount FROM sales AS sale WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.level = sale.level );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00039
train
v3
Schema: shipments (alias: shp)(salary, type, amount, status) accounts(salary, level, date, code) Task: Find salary from shipments where salary exceeds the maximum amount from accounts for the same level. SQL:
SELECT salary FROM shipments AS shp WHERE salary > ( SELECT MAX(amount) FROM accounts AS acct WHERE acct.level = shp.level );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00040
train
v3
Schema: requests (alias: ordr)(level, name, salary, amount) schedules(amount, id, level, code) Task: Retrieve amount from requests with value above the MIN(salary) of schedules rows sharing the same type. SQL:
SELECT amount FROM requests AS ordr WHERE value > ( SELECT MIN(salary) FROM schedules AS schd WHERE schd.type = ordr.type );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00041
train
v1
Schema: items (alias: lne)(code, type, amount, id) projects(type, id, salary, amount) Task: Select id from items where type exists in projects for the same level. SQL:
SELECT id FROM items AS lne WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.level = lne.level );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00042
train
v1
Schema: categories (alias: catg)(id, name, level, amount) regions(date, name, amount, status) Task: Retrieve id from categories whose code is found in regions rows where status matches the outer record. SQL:
SELECT id FROM categories AS catg WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.status = catg.status );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00043
train
v3
Schema: employees (alias: emp)(status, name, id, amount) tasks(code, amount, salary, status) Task: Find amount from employees where amount exceeds the average amount from tasks for the same id. SQL:
SELECT amount FROM employees AS emp WHERE amount > ( SELECT AVG(amount) FROM tasks AS tsk WHERE tsk.id = emp.id );
{ "outer_table": "employees", "inner_table": "tasks", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00044
train
v1
Schema: branches (alias: brc)(salary, amount, date, level) items(status, salary, amount, date) Task: Select name from branches where code exists in items for the same id. SQL:
SELECT name FROM branches AS brc WHERE code IN ( SELECT code FROM items AS lne WHERE lne.id = brc.id );
{ "outer_table": "branches", "inner_table": "items", "outer_alias": "brc", "inner_alias": "lne", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_00045
train
v2
Schema: orders (alias: ord)(salary, type, amount, level) schedules(level, salary, type, value) Task: Find id from orders where a matching record exists in schedules with the same level. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = ord.level );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "id", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00046
train
v1
Schema: products (alias: prod)(amount, date, salary, id) branches(date, amount, level, type) Task: Retrieve amount from products whose code is found in branches rows where status matches the outer record. SQL:
SELECT amount FROM products AS prod WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.status = prod.status );
{ "outer_table": "products", "inner_table": "branches", "outer_alias": "prod", "inner_alias": "brc", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00047
train
v3
Schema: managers (alias: mgr)(date, name, salary, status) branches(date, status, level, value) Task: Find code from managers where amount exceeds the count of salary from branches for the same id. SQL:
SELECT code FROM managers AS mgr WHERE amount > ( SELECT COUNT(salary) FROM branches AS brc WHERE brc.id = mgr.id );
{ "outer_table": "managers", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00048
train
v1
Schema: requests (alias: ordr)(date, status, type, amount) sales(level, salary, type, code) Task: Retrieve id from requests whose level is found in sales rows where code matches the outer record. SQL:
SELECT id FROM requests AS ordr WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.code = ordr.code );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00049
train
v1
Schema: accounts (alias: acct)(date, id, value, type) invoices(name, code, level, date) Task: Retrieve name from accounts whose status is found in invoices rows where id matches the outer record. SQL:
SELECT name FROM accounts AS acct WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.id = acct.id );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00050
train
v3
Schema: employees (alias: emp)(name, value, date, type) shipments(name, salary, date, amount) Task: Find code from employees where amount exceeds the total value from shipments for the same status. SQL:
SELECT code FROM employees AS emp WHERE amount > ( SELECT SUM(value) FROM shipments AS shp WHERE shp.status = emp.status );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00051
train
v3
Schema: invoices (alias: inv)(id, status, level, name) managers(type, code, status, level) Task: Retrieve amount from invoices with amount above the MIN(amount) of managers rows sharing the same type. SQL:
SELECT amount FROM invoices AS inv WHERE amount > ( SELECT MIN(amount) FROM managers AS mgr WHERE mgr.type = inv.type );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00052
train
v3
Schema: invoices (alias: inv)(status, salary, level, name) accounts(salary, value, code, type) Task: Retrieve name from invoices with amount above the SUM(salary) of accounts rows sharing the same type. SQL:
SELECT name FROM invoices AS inv WHERE amount > ( SELECT SUM(salary) FROM accounts AS acct WHERE acct.type = inv.type );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00053
train
v2
Schema: shipments (alias: shp)(level, value, code, name) accounts(level, id, status, date) Task: Find id from shipments where a matching record exists in accounts with the same type. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = shp.type );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "id", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00054
train
v3
Schema: staff (alias: empl)(status, date, amount, code) branches(status, type, name, level) Task: Retrieve name from staff with salary above the MIN(amount) of branches rows sharing the same code. SQL:
SELECT name FROM staff AS empl WHERE salary > ( SELECT MIN(amount) FROM branches AS brc WHERE brc.code = empl.code );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_00055
train
v3
Schema: customers (alias: cust)(id, status, level, type) branches(code, id, level, value) Task: Find code from customers where salary exceeds the count of salary from branches for the same status. SQL:
SELECT code 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": "code", "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_00056
train
v3
Schema: shipments (alias: shp)(id, status, level, name) schedules(status, type, id, amount) Task: Retrieve amount from shipments with value above the MAX(amount) of schedules rows sharing the same code. SQL:
SELECT amount FROM shipments AS shp WHERE value > ( SELECT MAX(amount) FROM schedules AS schd WHERE schd.code = shp.code );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00057
train
v2
Schema: staff (alias: empl)(value, amount, code, name) schedules(amount, code, id, value) Task: Retrieve amount from staff that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = empl.level );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "amount", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_00058
train
v2
Schema: items (alias: lne)(type, date, id, value) shipments(level, status, amount, code) Task: Retrieve name from items that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = lne.type );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "name", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00059
train
v3
Schema: branches (alias: brc)(id, amount, status, name) customers(id, code, status, value) Task: Find id from branches where amount exceeds the minimum salary from customers for the same type. SQL:
SELECT id FROM branches AS brc WHERE amount > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.type = brc.type );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_00060
train
v1
Schema: projects (alias: prj)(id, name, salary, value) invoices(type, date, code, name) Task: Find value from projects where status appears in invoices entries with matching status. SQL:
SELECT value FROM projects AS prj WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.status = prj.status );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "prj", "inner_alias": "inv", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00061
train
v3
Schema: sales (alias: sale)(name, value, level, date) transactions(code, amount, level, name) Task: Find amount from sales where value exceeds the minimum salary from transactions for the same id. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT MIN(salary) FROM transactions AS txn WHERE txn.id = sale.id );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00062
train
v2
Schema: products (alias: prod)(name, level, status, date) items(value, code, salary, amount) Task: Retrieve id from products that have at least one corresponding entry in items sharing the same code. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = prod.code );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "id", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00063
train
v3
Schema: categories (alias: catg)(level, type, code, status) schedules(id, code, amount, date) Task: Retrieve value from categories with salary above the AVG(salary) of schedules rows sharing the same level. SQL:
SELECT value FROM categories AS catg WHERE salary > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.level = catg.level );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "value", "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_00064
train
v1
Schema: sales (alias: sale)(value, id, date, amount) items(level, status, date, type) Task: Select code from sales where id exists in items for the same code. SQL:
SELECT code FROM sales AS sale WHERE id IN ( SELECT id FROM items AS lne WHERE lne.code = sale.code );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00065
train
v3
Schema: items (alias: lne)(date, value, level, salary) requests(type, id, level, date) Task: Retrieve value from items with value above the COUNT(value) of requests rows sharing the same id. SQL:
SELECT value FROM items AS lne WHERE value > ( SELECT COUNT(value) FROM requests AS ordr WHERE ordr.id = lne.id );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00066
train
v2
Schema: regions (alias: rgn)(status, value, id, type) customers(value, type, level, date) Task: Retrieve amount from regions that have at least one corresponding entry in customers sharing the same code. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = rgn.code );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "amount", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_00067
train
v3
Schema: customers (alias: cust)(status, code, id, name) managers(level, id, salary, type) Task: Find code from customers where value exceeds the average amount from managers for the same level. SQL:
SELECT code FROM customers AS cust WHERE value > ( SELECT AVG(amount) FROM managers AS mgr WHERE mgr.level = cust.level );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00068
train
v1
Schema: departments (alias: dept)(status, type, id, level) schedules(type, status, id, salary) Task: Select amount from departments where type exists in schedules for the same code. SQL:
SELECT amount FROM departments AS dept WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.code = dept.code );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00069
train
v3
Schema: items (alias: lne)(id, level, type, amount) tasks(name, id, value, level) Task: Find salary from items where salary exceeds the average value from tasks for the same type. SQL:
SELECT salary FROM items AS lne WHERE salary > ( SELECT AVG(value) FROM tasks AS tsk WHERE tsk.type = lne.type );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00070
train
v2
Schema: managers (alias: mgr)(level, code, salary, id) sales(code, name, salary, level) Task: Find salary from managers where a matching record exists in sales with the same id. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = mgr.id );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "salary", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00071
train
v1
Schema: staff (alias: empl)(amount, status, level, id) shipments(name, value, type, id) Task: Select id from staff where type exists in shipments for the same level. SQL:
SELECT id FROM staff AS empl WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.level = empl.level );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_00072
train
v2
Schema: projects (alias: prj)(status, date, code, name) branches(amount, id, status, salary) Task: Find name from projects where a matching record exists in branches with the same id. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = prj.id );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "name", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00073
train
v2
Schema: departments (alias: dept)(level, salary, value, status) schedules(amount, status, name, code) Task: Find name from departments where a matching record exists in schedules with the same id. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = dept.id );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "name", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00074
train
v2
Schema: transactions (alias: txn)(date, value, name, id) staff(level, date, salary, id) Task: Find code from transactions where a matching record exists in staff with the same level. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = txn.level );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "code", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00075
train
v3
Schema: shipments (alias: shp)(amount, code, name, date) managers(date, value, status, name) Task: Retrieve id from shipments with amount above the MAX(salary) of managers rows sharing the same status. SQL:
SELECT id FROM shipments AS shp WHERE amount > ( SELECT MAX(salary) FROM managers AS mgr WHERE mgr.status = shp.status );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00076
train
v3
Schema: employees (alias: emp)(date, status, amount, salary) departments(code, date, value, level) Task: Retrieve amount from employees with value above the SUM(amount) of departments rows sharing the same status. SQL:
SELECT amount FROM employees AS emp WHERE value > ( SELECT SUM(amount) FROM departments AS dept WHERE dept.status = emp.status );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00077
train
v1
Schema: shipments (alias: shp)(value, name, date, level) sales(name, salary, value, id) Task: Select code from shipments where type exists in sales for the same id. SQL:
SELECT code FROM shipments AS shp WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.id = shp.id );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00078
train
v1
Schema: departments (alias: dept)(status, type, value, date) regions(type, name, salary, code) Task: Retrieve salary from departments whose code is found in regions rows where status matches the outer record. SQL:
SELECT salary FROM departments AS dept WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.status = dept.status );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00079
train
v1
Schema: accounts (alias: acct)(date, level, name, id) items(status, level, id, amount) Task: Select code from accounts where code exists in items for the same code. SQL:
SELECT code FROM accounts AS acct WHERE code IN ( SELECT code FROM items AS lne WHERE lne.code = acct.code );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00080
train
v3
Schema: orders (alias: ord)(salary, type, status, name) sales(status, level, amount, name) Task: Retrieve name from orders with amount above the SUM(salary) of sales rows sharing the same code. SQL:
SELECT name FROM orders AS ord WHERE amount > ( SELECT SUM(salary) FROM sales AS sale WHERE sale.code = ord.code );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00081
train
v3
Schema: projects (alias: prj)(salary, id, date, value) employees(date, status, id, type) Task: Retrieve value from projects with salary above the COUNT(amount) of employees rows sharing the same type. SQL:
SELECT value FROM projects AS prj WHERE salary > ( SELECT COUNT(amount) FROM employees AS emp WHERE emp.type = prj.type );
{ "outer_table": "projects", "inner_table": "employees", "outer_alias": "prj", "inner_alias": "emp", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00082
train
v1
Schema: staff (alias: empl)(date, id, status, salary) orders(level, status, salary, code) Task: Find amount from staff where level appears in orders entries with matching level. SQL:
SELECT amount FROM staff AS empl WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.level = empl.level );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_00083
train
v1
Schema: orders (alias: ord)(value, type, code, date) branches(status, salary, type, id) Task: Select name from orders where code exists in branches for the same id. SQL:
SELECT name FROM orders AS ord WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.id = ord.id );
{ "outer_table": "orders", "inner_table": "branches", "outer_alias": "ord", "inner_alias": "brc", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00084
train
v3
Schema: schedules (alias: schd)(salary, code, date, type) transactions(id, date, name, level) Task: Find salary from schedules where value exceeds the minimum amount from transactions for the same id. SQL:
SELECT salary FROM schedules AS schd WHERE value > ( SELECT MIN(amount) FROM transactions AS txn WHERE txn.id = schd.id );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00085
train
v3
Schema: schedules (alias: schd)(amount, code, value, salary) employees(status, amount, value, level) Task: Retrieve name from schedules with salary above the SUM(amount) of employees rows sharing the same status. SQL:
SELECT name FROM schedules AS schd WHERE salary > ( SELECT SUM(amount) FROM employees AS emp WHERE emp.status = schd.status );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00086
train
v1
Schema: invoices (alias: inv)(salary, code, date, level) schedules(status, value, code, id) Task: Find id from invoices where type appears in schedules entries with matching status. SQL:
SELECT id FROM invoices AS inv WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.status = inv.status );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00087
train
v1
Schema: categories (alias: catg)(type, name, level, id) requests(value, id, status, name) Task: Find id from categories where level appears in requests entries with matching level. SQL:
SELECT id FROM categories AS catg WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.level = catg.level );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00088
train
v1
Schema: sales (alias: sale)(date, amount, code, name) items(salary, date, code, name) Task: Retrieve code from sales whose level is found in items rows where id matches the outer record. SQL:
SELECT code FROM sales AS sale WHERE level IN ( SELECT level FROM items AS lne WHERE lne.id = sale.id );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00089
train
v2
Schema: schedules (alias: schd)(code, id, value, type) categories(id, type, date, name) Task: Retrieve salary from schedules that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = schd.id );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "salary", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00090
train
v1
Schema: transactions (alias: txn)(id, salary, date, status) shipments(status, salary, type, code) Task: Find amount from transactions where id appears in shipments entries with matching code. SQL:
SELECT amount FROM transactions AS txn WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.code = txn.code );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00091
train
v3
Schema: projects (alias: prj)(status, amount, name, date) transactions(id, type, amount, salary) Task: Find code from projects where salary exceeds the minimum value from transactions for the same id. SQL:
SELECT code FROM projects AS prj WHERE salary > ( SELECT MIN(value) FROM transactions AS txn WHERE txn.id = prj.id );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00092
train
v3
Schema: customers (alias: cust)(level, type, salary, amount) employees(level, salary, value, id) Task: Find id from customers where salary exceeds the minimum amount from employees for the same id. SQL:
SELECT id FROM customers AS cust WHERE salary > ( SELECT MIN(amount) FROM employees AS emp WHERE emp.id = cust.id );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00093
train
v2
Schema: branches (alias: brc)(type, code, date, salary) departments(level, salary, status, amount) Task: Find name from branches where a matching record exists in departments with the same level. SQL:
SELECT name FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = brc.level );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "brc", "inner_alias": "dept", "proj_col": "name", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_00094
train
v3
Schema: schedules (alias: schd)(amount, salary, code, id) requests(salary, amount, id, level) Task: Retrieve name from schedules with value above the AVG(salary) of requests rows sharing the same code. SQL:
SELECT name FROM schedules AS schd WHERE value > ( SELECT AVG(salary) FROM requests AS ordr WHERE ordr.code = schd.code );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00095
train
v1
Schema: managers (alias: mgr)(code, name, value, type) requests(code, id, value, amount) Task: Find id from managers where code appears in requests entries with matching id. SQL:
SELECT id FROM managers AS mgr WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.id = mgr.id );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00096
train
v1
Schema: projects (alias: prj)(amount, level, id, value) products(type, name, code, status) Task: Select amount from projects where id exists in products for the same level. SQL:
SELECT amount FROM projects AS prj WHERE id IN ( SELECT id FROM products AS prod WHERE prod.level = prj.level );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "prj", "inner_alias": "prod", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00097
train
v1
Schema: products (alias: prod)(value, level, code, name) sales(amount, date, id, level) Task: Select code from products where type exists in sales for the same id. SQL:
SELECT code FROM products AS prod WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.id = prod.id );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00098
train
v3
Schema: shipments (alias: shp)(salary, name, level, id) orders(level, type, amount, salary) Task: Retrieve value from shipments with amount above the SUM(value) of orders rows sharing the same type. SQL:
SELECT value FROM shipments AS shp WHERE amount > ( SELECT SUM(value) FROM orders AS ord WHERE ord.type = shp.type );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00099
train
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
28