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
v3
Schema: employees (alias: emp)(date, salary, status, id) transactions(salary, code, name, status) Task: Retrieve amount from employees with amount above the MIN(value) of transactions rows sharing the same type. SQL:
SELECT amount FROM employees AS emp WHERE amount > ( SELECT MIN(value) FROM transactions AS txn WHERE txn.type = emp.type );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00800
train
v3
Schema: orders (alias: ord)(code, level, date, salary) requests(salary, date, type, value) Task: Retrieve id from orders with value above the COUNT(value) of requests rows sharing the same level. SQL:
SELECT id FROM orders AS ord WHERE value > ( SELECT COUNT(value) FROM requests AS ordr WHERE ordr.level = ord.level );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00801
train
v3
Schema: shipments (alias: shp)(amount, type, name, id) invoices(level, salary, status, date) Task: Retrieve amount from shipments with amount above the SUM(salary) of invoices rows sharing the same code. SQL:
SELECT amount FROM shipments AS shp WHERE amount > ( SELECT SUM(salary) FROM invoices AS inv WHERE inv.code = shp.code );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00802
train
v2
Schema: items (alias: lne)(salary, name, type, value) regions(value, name, amount, salary) Task: Retrieve salary from items that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = lne.level );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "salary", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00803
train
v1
Schema: sales (alias: sale)(salary, code, id, status) regions(value, amount, level, code) Task: Select id from sales where status exists in regions for the same id. SQL:
SELECT id FROM sales AS sale WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.id = sale.id );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00804
train
v3
Schema: products (alias: prod)(level, id, value, code) schedules(name, value, amount, code) Task: Find value from products where amount exceeds the average amount from schedules for the same level. SQL:
SELECT value FROM products AS prod WHERE amount > ( SELECT AVG(amount) FROM schedules AS schd WHERE schd.level = prod.level );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00805
train
v1
Schema: items (alias: lne)(status, id, date, salary) departments(name, id, value, amount) Task: Retrieve value from items whose type is found in departments rows where status matches the outer record. SQL:
SELECT value FROM items AS lne WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.status = lne.status );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00806
train
v1
Schema: staff (alias: empl)(value, status, amount, type) orders(value, salary, code, name) Task: Retrieve code from staff whose type is found in orders rows where type matches the outer record. SQL:
SELECT code FROM staff AS empl WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.type = empl.type );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_00807
train
v1
Schema: shipments (alias: shp)(status, id, code, salary) employees(value, salary, type, status) Task: Select code from shipments where code exists in employees for the same id. SQL:
SELECT code FROM shipments AS shp WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.id = shp.id );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00808
train
v1
Schema: categories (alias: catg)(amount, status, name, id) sales(id, status, value, name) Task: Find id from categories where status appears in sales entries with matching type. SQL:
SELECT id FROM categories AS catg WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.type = catg.type );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00809
train
v2
Schema: requests (alias: ordr)(code, date, amount, type) products(status, type, date, amount) Task: Find code from requests where a matching record exists in products with the same status. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = ordr.status );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "code", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00810
train
v3
Schema: accounts (alias: acct)(type, id, date, name) schedules(name, type, date, status) Task: Retrieve name from accounts with salary above the AVG(amount) of schedules rows sharing the same status. SQL:
SELECT name FROM accounts AS acct WHERE salary > ( SELECT AVG(amount) FROM schedules AS schd WHERE schd.status = acct.status );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00811
train
v1
Schema: schedules (alias: schd)(status, type, code, salary) staff(amount, name, type, salary) Task: Find salary from schedules where status appears in staff entries with matching status. SQL:
SELECT salary FROM schedules AS schd WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.status = schd.status );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00812
train
v1
Schema: categories (alias: catg)(salary, date, status, amount) invoices(name, id, salary, date) Task: Select amount from categories where status exists in invoices for the same type. SQL:
SELECT amount FROM categories AS catg WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.type = catg.type );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00813
train
v3
Schema: transactions (alias: txn)(id, salary, date, type) products(code, status, id, name) Task: Retrieve name from transactions with salary above the SUM(value) of products rows sharing the same id. SQL:
SELECT name FROM transactions AS txn WHERE salary > ( SELECT SUM(value) FROM products AS prod WHERE prod.id = txn.id );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00814
train
v3
Schema: sales (alias: sale)(code, amount, value, level) staff(id, date, level, name) Task: Retrieve amount from sales with value above the MAX(salary) of staff rows sharing the same code. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT MAX(salary) FROM staff AS empl WHERE empl.code = sale.code );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00815
train
v3
Schema: employees (alias: emp)(name, id, value, date) transactions(date, status, name, amount) Task: Retrieve salary from employees with salary above the MIN(amount) of transactions rows sharing the same level. SQL:
SELECT salary FROM employees AS emp WHERE salary > ( SELECT MIN(amount) FROM transactions AS txn WHERE txn.level = emp.level );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00816
train
v1
Schema: employees (alias: emp)(salary, level, value, type) accounts(id, type, status, code) Task: Find value from employees where level appears in accounts entries with matching id. SQL:
SELECT value FROM employees AS emp WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.id = emp.id );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00817
train
v2
Schema: categories (alias: catg)(date, name, value, level) employees(type, id, status, date) Task: Retrieve amount from categories that have at least one corresponding entry in employees sharing the same id. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = catg.id );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "amount", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00818
train
v1
Schema: branches (alias: brc)(amount, code, name, level) products(salary, code, level, value) Task: Find salary from branches where code appears in products entries with matching code. SQL:
SELECT salary FROM branches AS brc WHERE code IN ( SELECT code FROM products AS prod WHERE prod.code = brc.code );
{ "outer_table": "branches", "inner_table": "products", "outer_alias": "brc", "inner_alias": "prod", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_00819
train
v3
Schema: managers (alias: mgr)(type, level, amount, salary) customers(id, status, amount, level) Task: Retrieve value from managers with salary above the SUM(salary) of customers rows sharing the same level. SQL:
SELECT value FROM managers AS mgr WHERE salary > ( SELECT SUM(salary) FROM customers AS cust WHERE cust.level = mgr.level );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00820
train
v2
Schema: projects (alias: prj)(type, name, code, value) products(code, salary, type, amount) Task: Retrieve name from projects that have at least one corresponding entry in products sharing the same type. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = prj.type );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "prj", "inner_alias": "prod", "proj_col": "name", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00821
train
v3
Schema: customers (alias: cust)(name, code, date, status) staff(level, status, value, name) Task: Find name from customers where amount exceeds the count of value from staff for the same status. SQL:
SELECT name FROM customers AS cust WHERE amount > ( SELECT COUNT(value) FROM staff AS empl WHERE empl.status = cust.status );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00822
train
v3
Schema: tasks (alias: tsk)(type, level, value, date) regions(amount, name, date, status) Task: Retrieve code from tasks with amount above the MIN(salary) of regions rows sharing the same type. SQL:
SELECT code FROM tasks AS tsk WHERE amount > ( SELECT MIN(salary) FROM regions AS rgn WHERE rgn.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "tsk", "inner_alias": "rgn", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_00823
train
v2
Schema: orders (alias: ord)(amount, type, salary, status) projects(level, salary, code, status) Task: Find amount from orders where a matching record exists in projects with the same status. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = ord.status );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "amount", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00824
train
v2
Schema: categories (alias: catg)(name, date, status, value) invoices(value, amount, id, salary) Task: Retrieve name from categories that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = catg.type );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "name", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00825
train
v3
Schema: customers (alias: cust)(id, type, name, amount) regions(value, salary, date, code) Task: Retrieve salary from customers with value above the SUM(salary) of regions rows sharing the same level. SQL:
SELECT salary FROM customers AS cust WHERE value > ( SELECT SUM(salary) FROM regions AS rgn WHERE rgn.level = cust.level );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00826
train
v3
Schema: shipments (alias: shp)(type, value, code, amount) regions(code, value, id, salary) Task: Retrieve id from shipments with value above the AVG(salary) of regions rows sharing the same level. SQL:
SELECT id FROM shipments AS shp WHERE value > ( SELECT AVG(salary) FROM regions AS rgn WHERE rgn.level = shp.level );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00827
train
v1
Schema: shipments (alias: shp)(salary, type, level, name) departments(level, status, name, id) Task: Find name from shipments where status appears in departments entries with matching code. SQL:
SELECT name FROM shipments AS shp WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.code = shp.code );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00828
train
v3
Schema: sales (alias: sale)(amount, date, value, type) departments(value, level, type, code) Task: Retrieve salary from sales with amount above the SUM(value) of departments rows sharing the same status. SQL:
SELECT salary FROM sales AS sale WHERE amount > ( SELECT SUM(value) FROM departments AS dept WHERE dept.status = sale.status );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00829
train
v2
Schema: transactions (alias: txn)(code, level, date, type) sales(status, salary, id, level) Task: Retrieve code from transactions that have at least one corresponding entry in sales sharing the same id. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = txn.id );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "code", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00830
train
v1
Schema: invoices (alias: inv)(type, code, salary, date) customers(date, type, amount, status) Task: Find value from invoices where code appears in customers entries with matching status. SQL:
SELECT value FROM invoices AS inv WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.status = inv.status );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00831
train
v3
Schema: branches (alias: brc)(id, name, amount, salary) employees(level, type, value, status) Task: Find salary from branches where salary exceeds the maximum salary from employees for the same status. SQL:
SELECT salary FROM branches AS brc WHERE salary > ( SELECT MAX(salary) FROM employees AS emp WHERE emp.status = brc.status );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_00832
train
v1
Schema: staff (alias: empl)(value, status, date, code) requests(code, type, salary, value) Task: Select value from staff where level exists in requests for the same id. SQL:
SELECT value FROM staff AS empl WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.id = empl.id );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_00833
train
v1
Schema: requests (alias: ordr)(amount, level, status, code) employees(id, date, value, type) Task: Find id from requests where status appears in employees entries with matching status. SQL:
SELECT id FROM requests AS ordr WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.status = ordr.status );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00834
train
v3
Schema: requests (alias: ordr)(value, id, amount, code) transactions(status, date, value, amount) Task: Retrieve amount from requests with value above the SUM(salary) of transactions rows sharing the same id. SQL:
SELECT amount FROM requests AS ordr WHERE value > ( SELECT SUM(salary) FROM transactions AS txn WHERE txn.id = ordr.id );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00835
train
v2
Schema: customers (alias: cust)(value, code, name, id) transactions(type, date, value, id) Task: Retrieve id from customers that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = cust.level );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "id", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00836
train
v2
Schema: tasks (alias: tsk)(type, level, date, name) invoices(id, level, value, status) Task: Find id from tasks where a matching record exists in invoices with the same level. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "invoices", "outer_alias": "tsk", "inner_alias": "inv", "proj_col": "id", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_00837
train
v1
Schema: sales (alias: sale)(code, amount, type, level) requests(value, salary, level, amount) Task: Retrieve code from sales whose type is found in requests rows where code matches the outer record. SQL:
SELECT code FROM sales AS sale WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.code = sale.code );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00838
train
v2
Schema: departments (alias: dept)(type, id, status, level) projects(code, name, salary, amount) Task: Find value from departments where a matching record exists in projects with the same level. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = dept.level );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "value", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00839
train
v3
Schema: products (alias: prod)(name, date, amount, salary) requests(id, type, name, value) Task: Retrieve amount from products with value above the MIN(amount) of requests rows sharing the same status. SQL:
SELECT amount FROM products AS prod WHERE value > ( SELECT MIN(amount) FROM requests AS ordr WHERE ordr.status = prod.status );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00840
train
v1
Schema: invoices (alias: inv)(type, amount, value, code) shipments(value, type, date, level) Task: Retrieve value from invoices whose code is found in shipments rows where type matches the outer record. SQL:
SELECT value FROM invoices AS inv WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.type = inv.type );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00841
train
v2
Schema: accounts (alias: acct)(status, salary, value, date) categories(amount, type, salary, value) Task: Find value from accounts where a matching record exists in categories with the same code. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = acct.code );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "value", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00842
train
v3
Schema: customers (alias: cust)(status, code, type, amount) employees(level, code, id, name) Task: Retrieve value from customers with value above the SUM(value) of employees rows sharing the same level. SQL:
SELECT value FROM customers AS cust WHERE value > ( SELECT SUM(value) FROM employees AS emp WHERE emp.level = cust.level );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00843
train
v3
Schema: regions (alias: rgn)(type, name, level, date) categories(level, date, status, value) Task: Retrieve salary from regions with amount above the AVG(salary) of categories rows sharing the same id. SQL:
SELECT salary FROM regions AS rgn WHERE amount > ( SELECT AVG(salary) FROM categories AS catg WHERE catg.id = rgn.id );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_00844
train
v2
Schema: tasks (alias: tsk)(salary, type, value, status) departments(code, salary, amount, value) Task: Find id from tasks where a matching record exists in departments with the same id. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "tsk", "inner_alias": "dept", "proj_col": "id", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_00845
train
v2
Schema: transactions (alias: txn)(status, id, date, type) employees(name, date, level, salary) Task: Retrieve salary from transactions that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = txn.code );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "salary", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00846
train
v1
Schema: tasks (alias: tsk)(value, date, name, level) staff(code, date, amount, status) Task: Retrieve code from tasks whose level is found in staff rows where type matches the outer record. SQL:
SELECT code FROM tasks AS tsk WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_00847
train
v2
Schema: regions (alias: rgn)(level, salary, amount, name) customers(value, date, code, id) Task: Retrieve amount from regions that have at least one corresponding entry in customers sharing the same level. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = rgn.level );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "amount", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_00848
train
v2
Schema: customers (alias: cust)(date, amount, level, value) orders(code, amount, salary, value) Task: Retrieve code from customers that have at least one corresponding entry in orders sharing the same status. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = cust.status );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "code", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00849
train
v2
Schema: branches (alias: brc)(id, value, name, date) transactions(type, amount, value, name) Task: Find id from branches where a matching record exists in transactions with the same code. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = brc.code );
{ "outer_table": "branches", "inner_table": "transactions", "outer_alias": "brc", "inner_alias": "txn", "proj_col": "id", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_00850
train
v1
Schema: items (alias: lne)(type, code, value, level) customers(value, id, level, code) Task: Select id from items where id exists in customers for the same id. SQL:
SELECT id FROM items AS lne WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.id = lne.id );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00851
train
v2
Schema: shipments (alias: shp)(salary, code, level, id) projects(amount, salary, id, status) Task: Retrieve code from shipments that have at least one corresponding entry in projects sharing the same status. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = shp.status );
{ "outer_table": "shipments", "inner_table": "projects", "outer_alias": "shp", "inner_alias": "prj", "proj_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00852
train
v2
Schema: shipments (alias: shp)(id, type, value, amount) accounts(amount, type, id, salary) Task: Retrieve id from shipments that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = shp.status );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "id", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00853
train
v2
Schema: schedules (alias: schd)(code, status, amount, id) sales(name, level, status, value) Task: Retrieve amount from schedules that have at least one corresponding entry in sales sharing the same code. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = schd.code );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "amount", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00854
train
v1
Schema: departments (alias: dept)(value, status, level, id) sales(type, code, level, name) Task: Retrieve name from departments whose status is found in sales rows where code matches the outer record. SQL:
SELECT name FROM departments AS dept WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.code = dept.code );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00855
train
v1
Schema: schedules (alias: schd)(status, name, code, type) employees(name, id, value, status) Task: Select salary from schedules where status exists in employees for the same level. SQL:
SELECT salary FROM schedules AS schd WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.level = schd.level );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00856
train
v3
Schema: schedules (alias: schd)(status, level, name, value) items(amount, status, salary, date) Task: Find amount from schedules where amount exceeds the count of salary from items for the same code. SQL:
SELECT amount FROM schedules AS schd WHERE amount > ( SELECT COUNT(salary) FROM items AS lne WHERE lne.code = schd.code );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00857
train
v1
Schema: branches (alias: brc)(type, date, code, name) regions(value, date, code, name) Task: Select amount from branches where code exists in regions for the same code. SQL:
SELECT amount FROM branches AS brc WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.code = brc.code );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "brc", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_00858
train
v1
Schema: transactions (alias: txn)(status, value, salary, level) items(amount, salary, type, date) Task: Find amount from transactions where code appears in items entries with matching code. SQL:
SELECT amount FROM transactions AS txn WHERE code IN ( SELECT code FROM items AS lne WHERE lne.code = txn.code );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00859
train
v2
Schema: employees (alias: emp)(id, name, code, value) customers(type, value, salary, id) Task: Retrieve name from employees that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = emp.type );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "name", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00860
train
v1
Schema: employees (alias: emp)(amount, date, value, code) managers(name, status, amount, date) Task: Find name from employees where status appears in managers entries with matching status. SQL:
SELECT name FROM employees AS emp WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.status = emp.status );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00861
train
v1
Schema: shipments (alias: shp)(status, date, id, salary) customers(salary, type, value, id) Task: Find salary from shipments where level appears in customers entries with matching type. SQL:
SELECT salary FROM shipments AS shp WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.type = shp.type );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00862
train
v1
Schema: orders (alias: ord)(type, status, amount, date) regions(status, id, level, name) Task: Find name from orders where level appears in regions entries with matching code. SQL:
SELECT name FROM orders AS ord WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.code = ord.code );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00863
train
v2
Schema: products (alias: prod)(level, name, status, salary) managers(code, level, date, id) Task: Retrieve name from products that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = prod.code );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "name", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00864
train
v3
Schema: tasks (alias: tsk)(date, id, amount, name) customers(level, salary, status, code) Task: Find name from tasks where value exceeds the total salary from customers for the same code. SQL:
SELECT name FROM tasks AS tsk WHERE value > ( SELECT SUM(salary) FROM customers AS cust WHERE cust.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "customers", "outer_alias": "tsk", "inner_alias": "cust", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_00865
train
v2
Schema: transactions (alias: txn)(amount, name, value, id) shipments(name, id, code, type) Task: Retrieve id from transactions that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = txn.status );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "id", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00866
train
v3
Schema: schedules (alias: schd)(salary, name, type, amount) sales(type, name, amount, value) Task: Find amount from schedules where salary exceeds the maximum salary from sales for the same code. SQL:
SELECT amount FROM schedules AS schd WHERE salary > ( SELECT MAX(salary) FROM sales AS sale WHERE sale.code = schd.code );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00867
train
v1
Schema: customers (alias: cust)(level, status, id, amount) sales(status, id, level, date) Task: Select amount from customers where type exists in sales for the same status. SQL:
SELECT amount FROM customers AS cust WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.status = cust.status );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00868
train
v3
Schema: regions (alias: rgn)(type, level, date, amount) shipments(amount, value, id, code) Task: Find id from regions where amount exceeds the total amount from shipments for the same level. SQL:
SELECT id FROM regions AS rgn WHERE amount > ( SELECT SUM(amount) FROM shipments AS shp WHERE shp.level = rgn.level );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_00869
train
v2
Schema: items (alias: lne)(date, amount, code, level) orders(type, id, code, name) Task: Find value from items where a matching record exists in orders with the same level. SQL:
SELECT value 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": "value", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00870
train
v1
Schema: schedules (alias: schd)(name, salary, status, level) invoices(level, code, amount, salary) Task: Find amount from schedules where status appears in invoices entries with matching status. SQL:
SELECT amount FROM schedules AS schd WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.status = schd.status );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00871
train
v1
Schema: items (alias: lne)(date, code, name, amount) orders(amount, code, name, type) Task: Select code from items where code exists in orders for the same id. SQL:
SELECT code FROM items AS lne WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.id = lne.id );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00872
train
v3
Schema: products (alias: prod)(id, amount, level, value) shipments(status, code, level, salary) Task: Find value from products where amount exceeds the average salary from shipments for the same id. SQL:
SELECT value FROM products AS prod WHERE amount > ( SELECT AVG(salary) FROM shipments AS shp WHERE shp.id = prod.id );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00873
train
v1
Schema: accounts (alias: acct)(date, value, salary, amount) orders(type, id, amount, salary) Task: Find salary from accounts where id appears in orders entries with matching status. SQL:
SELECT salary FROM accounts AS acct WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.status = acct.status );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00874
train
v2
Schema: orders (alias: ord)(level, salary, code, date) items(code, amount, salary, 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_00875
train
v3
Schema: accounts (alias: acct)(id, status, code, name) categories(id, date, status, amount) Task: Find code from accounts where salary exceeds the maximum amount from categories for the same status. SQL:
SELECT code FROM accounts AS acct WHERE salary > ( SELECT MAX(amount) FROM categories AS catg WHERE catg.status = acct.status );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00876
train
v3
Schema: orders (alias: ord)(salary, type, value, name) staff(code, status, level, value) Task: Find salary from orders where value exceeds the minimum salary from staff for the same type. SQL:
SELECT salary FROM orders AS ord WHERE value > ( SELECT MIN(salary) FROM staff AS empl WHERE empl.type = ord.type );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00877
train
v2
Schema: customers (alias: cust)(level, id, value, salary) shipments(salary, level, value, amount) Task: Retrieve id from customers that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = cust.id );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "id", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00878
train
v2
Schema: sales (alias: sale)(salary, name, value, date) tasks(value, name, level, code) Task: Find amount from sales where a matching record exists in tasks with the same status. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = sale.status );
{ "outer_table": "sales", "inner_table": "tasks", "outer_alias": "sale", "inner_alias": "tsk", "proj_col": "amount", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00879
train
v1
Schema: schedules (alias: schd)(amount, salary, status, date) sales(code, value, salary, name) Task: Find code from schedules where code appears in sales entries with matching code. SQL:
SELECT code FROM schedules AS schd WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.code = schd.code );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00880
train
v1
Schema: customers (alias: cust)(date, code, value, name) branches(salary, level, date, value) Task: Find id from customers where id appears in branches entries with matching type. SQL:
SELECT id FROM customers AS cust WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.type = cust.type );
{ "outer_table": "customers", "inner_table": "branches", "outer_alias": "cust", "inner_alias": "brc", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00881
train
v2
Schema: branches (alias: brc)(level, salary, status, code) shipments(date, salary, type, code) Task: Retrieve code from branches that have at least one corresponding entry in shipments sharing the same level. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = brc.level );
{ "outer_table": "branches", "inner_table": "shipments", "outer_alias": "brc", "inner_alias": "shp", "proj_col": "code", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_00882
train
v1
Schema: tasks (alias: tsk)(code, salary, name, id) products(level, value, date, amount) Task: Select id from tasks where code exists in products for the same code. SQL:
SELECT id FROM tasks AS tsk WHERE code IN ( SELECT code FROM products AS prod WHERE prod.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_00883
train
v3
Schema: transactions (alias: txn)(id, salary, level, type) projects(name, status, amount, salary) Task: Find name from transactions where salary exceeds the minimum value from projects for the same code. SQL:
SELECT name FROM transactions AS txn WHERE salary > ( SELECT MIN(value) FROM projects AS prj WHERE prj.code = txn.code );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "txn", "inner_alias": "prj", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00884
train
v1
Schema: transactions (alias: txn)(id, amount, level, salary) accounts(id, salary, code, amount) Task: Select name from transactions where status exists in accounts for the same level. SQL:
SELECT name FROM transactions AS txn WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.level = txn.level );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00885
train
v1
Schema: invoices (alias: inv)(level, status, value, amount) sales(value, type, salary, date) Task: Select salary from invoices where status exists in sales for the same level. SQL:
SELECT salary FROM invoices AS inv WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.level = inv.level );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00886
train
v3
Schema: shipments (alias: shp)(salary, id, code, status) branches(salary, code, type, level) Task: Retrieve id from shipments with amount above the SUM(salary) of branches rows sharing the same level. SQL:
SELECT id FROM shipments AS shp WHERE amount > ( SELECT SUM(salary) FROM branches AS brc WHERE brc.level = shp.level );
{ "outer_table": "shipments", "inner_table": "branches", "outer_alias": "shp", "inner_alias": "brc", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00887
train
v2
Schema: staff (alias: empl)(level, id, type, name) transactions(salary, amount, date, value) Task: Find value from staff where a matching record exists in transactions with the same level. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = empl.level );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "value", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_00888
train
v3
Schema: employees (alias: emp)(id, amount, value, date) regions(status, type, name, value) Task: Find salary from employees where amount exceeds the average salary from regions for the same level. SQL:
SELECT salary FROM employees AS emp WHERE amount > ( SELECT AVG(salary) FROM regions AS rgn WHERE rgn.level = emp.level );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00889
train
v1
Schema: requests (alias: ordr)(code, status, id, amount) projects(name, amount, value, id) Task: Select code from requests where status exists in projects for the same level. SQL:
SELECT code FROM requests AS ordr WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.level = ordr.level );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00890
train
v3
Schema: sales (alias: sale)(value, status, code, date) managers(id, type, salary, date) Task: Find amount from sales where salary exceeds the maximum amount from managers for the same type. SQL:
SELECT amount FROM sales AS sale WHERE salary > ( SELECT MAX(amount) FROM managers AS mgr WHERE mgr.type = sale.type );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00891
train
v2
Schema: departments (alias: dept)(amount, code, salary, status) products(level, amount, value, code) Task: Find code from departments where a matching record exists in products with the same type. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = dept.type );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "code", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00892
train
v3
Schema: orders (alias: ord)(level, type, amount, code) accounts(code, salary, date, status) Task: Find name from orders where value exceeds the total value from accounts for the same id. SQL:
SELECT name FROM orders AS ord WHERE value > ( SELECT SUM(value) FROM accounts AS acct WHERE acct.id = ord.id );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00893
train
v2
Schema: shipments (alias: shp)(id, amount, level, name) requests(value, level, name, id) Task: Find name from shipments where a matching record exists in requests with the same status. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = shp.status );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "name", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00894
train
v1
Schema: invoices (alias: inv)(salary, date, name, code) transactions(type, level, date, value) Task: Retrieve amount from invoices whose code is found in transactions rows where status matches the outer record. SQL:
SELECT amount FROM invoices AS inv WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.status = inv.status );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00895
train
v1
Schema: items (alias: lne)(salary, name, type, code) categories(salary, code, type, amount) Task: Select value from items where code exists in categories for the same status. SQL:
SELECT value FROM items AS lne WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.status = lne.status );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00896
train
v2
Schema: sales (alias: sale)(status, code, value, name) staff(code, type, status, level) Task: Retrieve id from sales that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = sale.type );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "id", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00897
train
v2
Schema: requests (alias: ordr)(code, value, type, salary) sales(status, type, level, date) Task: Find code from requests where a matching record exists in sales with the same id. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = ordr.id );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "code", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00898
train
v1
Schema: invoices (alias: inv)(amount, type, salary, code) tasks(salary, type, level, code) Task: Retrieve name from invoices whose type is found in tasks rows where code matches the outer record. SQL:
SELECT name FROM invoices AS inv WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.code = inv.code );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00899
train