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: staff (alias: empl)(type, amount, value, status) tasks(date, salary, amount, id) Task: Retrieve salary from staff that have at least one corresponding entry in tasks sharing the same type. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = empl.type );
{ "outer_table": "staff", "inner_table": "tasks", "outer_alias": "empl", "inner_alias": "tsk", "proj_col": "salary", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09700
train
v3
Schema: invoices (alias: inv)(type, code, date, name) items(salary, id, status, value) Task: Find value from invoices where value exceeds the count of value from items for the same status. SQL:
SELECT value FROM invoices AS inv WHERE value > ( SELECT COUNT(value) FROM items AS lne WHERE lne.status = inv.status );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09701
train
v3
Schema: staff (alias: empl)(status, salary, code, type) schedules(date, level, status, value) Task: Find salary from staff where value exceeds the maximum value from schedules for the same type. SQL:
SELECT salary FROM staff AS empl WHERE value > ( SELECT MAX(value) FROM schedules AS schd WHERE schd.type = empl.type );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09702
train
v3
Schema: employees (alias: emp)(code, value, type, status) customers(value, salary, code, name) Task: Find code from employees where amount exceeds the minimum salary from customers for the same status. SQL:
SELECT code FROM employees AS emp WHERE amount > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.status = emp.status );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09703
train
v2
Schema: branches (alias: brc)(value, level, name, id) projects(salary, code, value, name) Task: Find id from branches where a matching record exists in projects with the same type. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = brc.type );
{ "outer_table": "branches", "inner_table": "projects", "outer_alias": "brc", "inner_alias": "prj", "proj_col": "id", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09704
train
v2
Schema: requests (alias: ordr)(level, status, code, name) departments(date, value, id, code) Task: Find id from requests where a matching record exists in departments with the same type. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = ordr.type );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "id", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09705
train
v3
Schema: invoices (alias: inv)(name, code, date, amount) schedules(status, salary, id, value) Task: Find id from invoices where value exceeds the average salary from schedules for the same level. SQL:
SELECT id FROM invoices AS inv WHERE value > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.level = inv.level );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09706
train
v2
Schema: requests (alias: ordr)(type, value, date, id) schedules(type, code, salary, amount) Task: Find id from requests where a matching record exists in schedules with the same code. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = ordr.code );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "id", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09707
train
v3
Schema: departments (alias: dept)(amount, code, level, name) requests(type, level, amount, id) Task: Retrieve amount from departments with value above the AVG(value) of requests rows sharing the same id. SQL:
SELECT amount FROM departments AS dept WHERE value > ( SELECT AVG(value) FROM requests AS ordr WHERE ordr.id = dept.id );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09708
train
v2
Schema: departments (alias: dept)(level, amount, type, name) staff(status, salary, amount, id) Task: Retrieve name from departments that have at least one corresponding entry in staff sharing the same code. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = dept.code );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "name", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09709
train
v2
Schema: regions (alias: rgn)(name, status, code, type) schedules(id, level, code, value) Task: Retrieve salary from regions that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = rgn.level );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "salary", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09710
train
v2
Schema: shipments (alias: shp)(code, type, value, salary) regions(date, id, level, salary) Task: Find code from shipments where a matching record exists in regions with the same status. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = shp.status );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_09711
train
v3
Schema: branches (alias: brc)(type, level, date, id) shipments(level, type, amount, code) Task: Retrieve id from branches with value above the SUM(salary) of shipments rows sharing the same status. SQL:
SELECT id FROM branches AS brc WHERE value > ( SELECT SUM(salary) FROM shipments AS shp WHERE shp.status = brc.status );
{ "outer_table": "branches", "inner_table": "shipments", "outer_alias": "brc", "inner_alias": "shp", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09712
train
v1
Schema: regions (alias: rgn)(id, salary, type, status) managers(level, date, type, id) Task: Select code from regions where level exists in managers for the same level. SQL:
SELECT code FROM regions AS rgn WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.level = rgn.level );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09713
train
v3
Schema: items (alias: lne)(level, code, name, amount) categories(status, amount, id, date) Task: Retrieve name from items with value above the MIN(amount) of categories rows sharing the same code. SQL:
SELECT name FROM items AS lne WHERE value > ( SELECT MIN(amount) FROM categories AS catg WHERE catg.code = lne.code );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09714
train
v2
Schema: sales (alias: sale)(amount, id, date, status) transactions(name, status, date, amount) Task: Find salary from sales where a matching record exists in transactions with the same status. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = sale.status );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "salary", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09715
train
v3
Schema: employees (alias: emp)(level, code, value, id) managers(id, date, code, type) Task: Find name from employees where value exceeds the average salary from managers for the same id. SQL:
SELECT name FROM employees AS emp WHERE value > ( SELECT AVG(salary) FROM managers AS mgr WHERE mgr.id = emp.id );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09716
train
v3
Schema: staff (alias: empl)(id, salary, status, value) tasks(status, code, value, salary) Task: Retrieve amount from staff with amount above the COUNT(amount) of tasks rows sharing the same id. SQL:
SELECT amount FROM staff AS empl WHERE amount > ( SELECT COUNT(amount) FROM tasks AS tsk WHERE tsk.id = empl.id );
{ "outer_table": "staff", "inner_table": "tasks", "outer_alias": "empl", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09717
train
v1
Schema: branches (alias: brc)(amount, salary, name, type) orders(amount, id, code, name) Task: Retrieve id from branches whose id is found in orders rows where type matches the outer record. SQL:
SELECT id FROM branches AS brc WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.type = brc.type );
{ "outer_table": "branches", "inner_table": "orders", "outer_alias": "brc", "inner_alias": "ord", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09718
train
v1
Schema: projects (alias: prj)(status, salary, code, type) invoices(amount, status, type, date) Task: Retrieve amount from projects whose code is found in invoices rows where id matches the outer record. SQL:
SELECT amount FROM projects AS prj WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.id = prj.id );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "prj", "inner_alias": "inv", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_09719
train
v1
Schema: accounts (alias: acct)(level, salary, value, type) employees(status, salary, date, type) Task: Select value from accounts where id exists in employees for the same code. SQL:
SELECT value FROM accounts AS acct WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09720
train
v3
Schema: managers (alias: mgr)(salary, status, level, value) transactions(salary, amount, value, name) Task: Retrieve value from managers with salary above the COUNT(value) of transactions rows sharing the same type. SQL:
SELECT value FROM managers AS mgr WHERE salary > ( SELECT COUNT(value) FROM transactions AS txn WHERE txn.type = mgr.type );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09721
train
v2
Schema: requests (alias: ordr)(name, value, id, type) items(name, level, type, salary) Task: Find id from requests where a matching record exists in items with the same id. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = ordr.id );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "id", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09722
train
v1
Schema: transactions (alias: txn)(id, name, type, salary) customers(id, salary, value, type) Task: Retrieve name from transactions whose level is found in customers rows where level matches the outer record. SQL:
SELECT name FROM transactions AS txn WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.level = txn.level );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09723
train
v1
Schema: items (alias: lne)(type, id, date, value) tasks(name, code, level, value) Task: Select code from items where type exists in tasks for the same level. SQL:
SELECT code FROM items AS lne WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.level = lne.level );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09724
train
v2
Schema: projects (alias: prj)(id, salary, value, amount) products(salary, id, name, value) Task: Retrieve code from projects that have at least one corresponding entry in products sharing the same code. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = prj.code );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "prj", "inner_alias": "prod", "proj_col": "code", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_09725
train
v3
Schema: shipments (alias: shp)(status, value, level, amount) requests(status, level, amount, value) Task: Find id from shipments where value exceeds the minimum salary from requests for the same code. SQL:
SELECT id FROM shipments AS shp WHERE value > ( SELECT MIN(salary) FROM requests AS ordr WHERE ordr.code = shp.code );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_09726
train
v3
Schema: categories (alias: catg)(level, salary, date, status) managers(amount, date, salary, code) Task: Retrieve salary from categories with value above the SUM(salary) of managers rows sharing the same code. SQL:
SELECT salary FROM categories AS catg WHERE value > ( SELECT SUM(salary) FROM managers AS mgr WHERE mgr.code = catg.code );
{ "outer_table": "categories", "inner_table": "managers", "outer_alias": "catg", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09727
train
v1
Schema: invoices (alias: inv)(salary, level, status, value) regions(salary, type, code, name) Task: Retrieve amount from invoices whose id is found in regions rows where id matches the outer record. SQL:
SELECT amount FROM invoices AS inv WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.id = inv.id );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09728
train
v2
Schema: employees (alias: emp)(code, level, name, type) orders(code, salary, name, value) Task: Retrieve amount from employees that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = emp.id );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "amount", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09729
train
v3
Schema: projects (alias: prj)(code, amount, name, value) invoices(amount, value, date, code) Task: Find id from projects where salary exceeds the average value from invoices for the same type. SQL:
SELECT id FROM projects AS prj WHERE salary > ( SELECT AVG(value) FROM invoices AS inv WHERE inv.type = prj.type );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "prj", "inner_alias": "inv", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_09730
train
v2
Schema: staff (alias: empl)(level, date, code, type) products(amount, level, type, value) Task: Find id from staff where a matching record exists in products with the same status. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = empl.status );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "id", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09731
train
v2
Schema: items (alias: lne)(level, type, name, date) customers(code, value, date, status) Task: Find salary from items where a matching record exists in customers with the same type. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = lne.type );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "salary", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09732
train
v1
Schema: customers (alias: cust)(status, code, amount, value) invoices(value, level, code, date) Task: Find value from customers where type appears in invoices entries with matching level. SQL:
SELECT value FROM customers AS cust WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.level = cust.level );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09733
train
v2
Schema: orders (alias: ord)(level, id, date, code) requests(id, type, code, level) Task: Retrieve value from orders that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = ord.type );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "value", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09734
train
v2
Schema: projects (alias: prj)(code, value, salary, id) branches(salary, date, status, id) Task: Retrieve id from projects that have at least one corresponding entry in branches sharing the same type. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = prj.type );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "id", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_09735
train
v1
Schema: employees (alias: emp)(id, name, code, level) tasks(amount, id, name, status) Task: Select amount from employees where level exists in tasks for the same type. SQL:
SELECT amount FROM employees AS emp WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.type = emp.type );
{ "outer_table": "employees", "inner_table": "tasks", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09736
train
v3
Schema: employees (alias: emp)(date, salary, id, value) managers(salary, status, id, type) Task: Find id from employees where salary exceeds the total value from managers for the same id. SQL:
SELECT id FROM employees AS emp WHERE salary > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.id = emp.id );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09737
train
v2
Schema: sales (alias: sale)(date, value, name, level) staff(type, level, id, code) Task: Find amount from sales where a matching record exists in staff with the same level. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = sale.level );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "amount", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09738
train
v2
Schema: managers (alias: mgr)(id, date, salary, value) products(amount, level, date, name) Task: Find id from managers where a matching record exists in products with the same code. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = mgr.code );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09739
train
v1
Schema: orders (alias: ord)(date, value, code, salary) accounts(name, value, code, salary) Task: Retrieve code from orders whose status is found in accounts rows where id matches the outer record. SQL:
SELECT code FROM orders AS ord WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.id = ord.id );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09740
train
v1
Schema: products (alias: prod)(salary, name, status, date) shipments(id, type, level, code) Task: Find value from products where status appears in shipments entries with matching id. SQL:
SELECT value FROM products AS prod WHERE status IN ( SELECT status 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": "status", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09741
train
v2
Schema: accounts (alias: acct)(date, type, code, salary) requests(amount, salary, status, type) Task: Retrieve value from accounts that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = acct.code );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "value", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09742
train
v1
Schema: departments (alias: dept)(date, amount, type, value) employees(type, level, code, name) Task: Retrieve amount from departments whose code is found in employees rows where code matches the outer record. SQL:
SELECT amount FROM departments AS dept WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.code = dept.code );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09743
train
v3
Schema: invoices (alias: inv)(status, type, level, code) accounts(salary, type, date, level) Task: Find id from invoices where value exceeds the average salary from accounts for the same level. SQL:
SELECT id FROM invoices AS inv WHERE value > ( SELECT AVG(salary) FROM accounts AS acct WHERE acct.level = inv.level );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09744
train
v2
Schema: accounts (alias: acct)(salary, level, id, amount) invoices(type, code, date, name) Task: Retrieve code from accounts that have at least one corresponding entry in invoices sharing the same level. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = acct.level );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "code", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09745
train
v3
Schema: projects (alias: prj)(code, type, status, id) departments(code, level, salary, type) Task: Find code from projects where amount exceeds the count of salary from departments for the same id. SQL:
SELECT code FROM projects AS prj WHERE amount > ( SELECT COUNT(salary) FROM departments AS dept WHERE dept.id = prj.id );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_09746
train
v2
Schema: managers (alias: mgr)(level, type, name, value) requests(salary, level, type, value) Task: Retrieve value from managers that have at least one corresponding entry in requests sharing the same level. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = mgr.level );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "value", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09747
train
v1
Schema: shipments (alias: shp)(date, status, amount, type) accounts(salary, type, date, level) Task: Retrieve id from shipments whose type is found in accounts rows where id matches the outer record. SQL:
SELECT id FROM shipments AS shp WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.id = shp.id );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_09748
train
v1
Schema: transactions (alias: txn)(id, amount, value, code) orders(name, salary, level, code) Task: Find amount from transactions where type appears in orders entries with matching status. SQL:
SELECT amount FROM transactions AS txn WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.status = txn.status );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09749
train
v1
Schema: accounts (alias: acct)(code, name, date, id) customers(salary, date, value, type) Task: Retrieve code from accounts whose id is found in customers rows where code matches the outer record. SQL:
SELECT code FROM accounts AS acct WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.code = acct.code );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09750
train
v3
Schema: requests (alias: ordr)(id, salary, date, value) managers(status, date, salary, name) Task: Find id from requests where salary exceeds the maximum value from managers for the same type. SQL:
SELECT id FROM requests AS ordr WHERE salary > ( SELECT MAX(value) FROM managers AS mgr WHERE mgr.type = ordr.type );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09751
train
v3
Schema: orders (alias: ord)(id, amount, salary, value) items(date, salary, id, name) Task: Find code from orders where value exceeds the minimum amount from items for the same level. SQL:
SELECT code FROM orders AS ord WHERE value > ( SELECT MIN(amount) FROM items AS lne WHERE lne.level = ord.level );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09752
train
v3
Schema: schedules (alias: schd)(salary, status, level, value) managers(date, id, code, type) Task: Retrieve id from schedules with value above the COUNT(salary) of managers rows sharing the same type. SQL:
SELECT id FROM schedules AS schd WHERE value > ( SELECT COUNT(salary) FROM managers AS mgr WHERE mgr.type = schd.type );
{ "outer_table": "schedules", "inner_table": "managers", "outer_alias": "schd", "inner_alias": "mgr", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09753
train
v3
Schema: items (alias: lne)(status, level, name, amount) customers(level, status, id, date) Task: Find value from items where value exceeds the count of amount from customers for the same type. SQL:
SELECT value FROM items AS lne WHERE value > ( SELECT COUNT(amount) FROM customers AS cust WHERE cust.type = lne.type );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09754
train
v1
Schema: accounts (alias: acct)(id, name, amount, status) shipments(date, level, value, salary) Task: Select value from accounts where status exists in shipments for the same level. SQL:
SELECT value FROM accounts AS acct WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.level = acct.level );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09755
train
v1
Schema: items (alias: lne)(value, name, type, date) managers(status, level, id, date) Task: Retrieve id from items whose id is found in managers rows where id matches the outer record. SQL:
SELECT id FROM items AS lne WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.id = lne.id );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09756
train
v1
Schema: departments (alias: dept)(type, status, salary, amount) staff(value, type, status, salary) Task: Find value from departments where status appears in staff entries with matching level. SQL:
SELECT value FROM departments AS dept WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.level = dept.level );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09757
train
v2
Schema: customers (alias: cust)(amount, id, value, level) invoices(value, date, type, status) Task: Find code from customers where a matching record exists in invoices with the same status. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = cust.status );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "code", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09758
train
v1
Schema: products (alias: prod)(id, date, code, status) transactions(id, salary, code, date) Task: Retrieve id from products whose type is found in transactions rows where type matches the outer record. SQL:
SELECT id FROM products AS prod WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.type = prod.type );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "id", "filter_col": "type", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09759
train
v3
Schema: items (alias: lne)(value, level, id, date) requests(status, amount, value, code) Task: Retrieve code from items with amount above the COUNT(value) of requests rows sharing the same code. SQL:
SELECT code FROM items AS lne WHERE amount > ( SELECT COUNT(value) FROM requests AS ordr WHERE ordr.code = lne.code );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09760
train
v3
Schema: departments (alias: dept)(date, id, amount, value) branches(date, code, amount, level) Task: Find id from departments where amount exceeds the count of value from branches for the same level. SQL:
SELECT id FROM departments AS dept WHERE amount > ( SELECT COUNT(value) FROM branches AS brc WHERE brc.level = dept.level );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09761
train
v2
Schema: regions (alias: rgn)(date, status, value, level) branches(type, name, value, salary) Task: Find name from regions where a matching record exists in branches with the same status. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = rgn.status );
{ "outer_table": "regions", "inner_table": "branches", "outer_alias": "rgn", "inner_alias": "brc", "proj_col": "name", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09762
train
v2
Schema: staff (alias: empl)(level, type, id, salary) orders(name, value, level, code) Task: Find code from staff where a matching record exists in orders with the same status. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = empl.status );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "code", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09763
train
v3
Schema: managers (alias: mgr)(type, salary, level, amount) accounts(status, amount, level, date) Task: Retrieve amount from managers with value above the MIN(value) of accounts rows sharing the same level. SQL:
SELECT amount FROM managers AS mgr WHERE value > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.level = mgr.level );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09764
train
v2
Schema: accounts (alias: acct)(status, type, code, id) projects(code, status, name, type) Task: Find id from accounts where a matching record exists in projects with the same id. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = acct.id );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "id", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09765
train
v3
Schema: managers (alias: mgr)(status, type, id, level) customers(level, salary, type, status) Task: Find id from managers where amount exceeds the minimum salary from customers for the same code. SQL:
SELECT id FROM managers AS mgr WHERE amount > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.code = mgr.code );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09766
train
v2
Schema: staff (alias: empl)(value, salary, code, level) schedules(name, code, level, salary) Task: Retrieve value from staff that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT value 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": "value", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09767
train
v2
Schema: branches (alias: brc)(name, status, amount, value) tasks(value, type, level, status) Task: Find value from branches where a matching record exists in tasks with the same status. SQL:
SELECT value FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = brc.status );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "value", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09768
train
v3
Schema: shipments (alias: shp)(type, date, code, amount) customers(amount, date, salary, code) Task: Retrieve id from shipments with value above the MAX(salary) of customers rows sharing the same status. SQL:
SELECT id FROM shipments AS shp WHERE value > ( SELECT MAX(salary) FROM customers AS cust WHERE cust.status = shp.status );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_09769
train
v1
Schema: managers (alias: mgr)(code, value, date, salary) transactions(level, amount, salary, id) Task: Retrieve name from managers whose status is found in transactions rows where status matches the outer record. SQL:
SELECT name FROM managers AS mgr WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09770
train
v3
Schema: orders (alias: ord)(code, value, salary, id) projects(type, code, status, salary) Task: Find name from orders where value exceeds the count of amount from projects for the same level. SQL:
SELECT name FROM orders AS ord WHERE value > ( SELECT COUNT(amount) FROM projects AS prj WHERE prj.level = ord.level );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09771
train
v1
Schema: staff (alias: empl)(status, date, salary, value) branches(amount, code, date, name) Task: Select name from staff where type exists in branches for the same level. SQL:
SELECT name FROM staff AS empl WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.level = empl.level );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09772
train
v2
Schema: employees (alias: emp)(name, code, status, salary) customers(name, id, date, value) Task: Find name from employees where a matching record exists in customers with the same id. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = emp.id );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "name", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09773
train
v2
Schema: departments (alias: dept)(name, salary, id, value) tasks(code, salary, type, name) Task: Retrieve id from departments that have at least one corresponding entry in tasks sharing the same id. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = dept.id );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "id", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09774
train
v2
Schema: departments (alias: dept)(id, code, name, amount) items(amount, type, value, date) Task: Find value from departments where a matching record exists in items with the same id. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = dept.id );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "value", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09775
train
v1
Schema: items (alias: lne)(salary, value, id, level) schedules(type, value, name, amount) Task: Find name from items where id appears in schedules entries with matching type. SQL:
SELECT name FROM items AS lne WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.type = lne.type );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09776
train
v2
Schema: accounts (alias: acct)(level, id, status, salary) tasks(amount, level, id, value) Task: Retrieve salary from accounts that have at least one corresponding entry in tasks sharing the same id. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = acct.id );
{ "outer_table": "accounts", "inner_table": "tasks", "outer_alias": "acct", "inner_alias": "tsk", "proj_col": "salary", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09777
train
v2
Schema: branches (alias: brc)(status, name, date, id) schedules(name, code, value, amount) Task: Retrieve value from branches that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT value FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = brc.level );
{ "outer_table": "branches", "inner_table": "schedules", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "value", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09778
train
v1
Schema: accounts (alias: acct)(id, date, code, name) requests(value, salary, type, status) Task: Find amount from accounts where type appears in requests entries with matching level. SQL:
SELECT amount FROM accounts AS acct WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.level = acct.level );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09779
train
v1
Schema: branches (alias: brc)(level, type, value, salary) customers(type, id, name, level) Task: Select name from branches where type exists in customers for the same id. SQL:
SELECT name FROM branches AS brc WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.id = brc.id );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09780
train
v1
Schema: schedules (alias: schd)(name, value, date, amount) products(id, type, value, code) Task: Retrieve amount from schedules whose id is found in products rows where id matches the outer record. SQL:
SELECT amount FROM schedules AS schd WHERE id IN ( SELECT id FROM products AS prod WHERE prod.id = schd.id );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09781
train
v1
Schema: invoices (alias: inv)(amount, salary, code, type) items(type, level, name, amount) Task: Find value from invoices where level appears in items entries with matching status. SQL:
SELECT value FROM invoices AS inv WHERE level IN ( SELECT level FROM items AS lne WHERE lne.status = inv.status );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "value", "filter_col": "level", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09782
train
v1
Schema: staff (alias: empl)(salary, value, date, level) regions(salary, date, code, type) Task: Select amount from staff where code exists in regions for the same type. SQL:
SELECT amount FROM staff AS empl WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.type = empl.type );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09783
train
v2
Schema: products (alias: prod)(code, name, amount, id) staff(code, amount, date, id) Task: Retrieve name from products that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = prod.type );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "name", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09784
train
v3
Schema: sales (alias: sale)(value, date, amount, type) schedules(salary, status, value, date) Task: Retrieve salary from sales with amount above the COUNT(salary) of schedules rows sharing the same level. SQL:
SELECT salary FROM sales AS sale WHERE amount > ( SELECT COUNT(salary) FROM schedules AS schd WHERE schd.level = sale.level );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09785
train
v3
Schema: tasks (alias: tsk)(id, level, date, code) items(level, amount, date, name) Task: Find amount from tasks where amount exceeds the count of value from items for the same code. SQL:
SELECT amount FROM tasks AS tsk WHERE amount > ( SELECT COUNT(value) FROM items AS lne WHERE lne.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09786
train
v1
Schema: employees (alias: emp)(type, value, id, amount) managers(status, salary, value, type) Task: Retrieve amount from employees whose status is found in managers rows where id matches the outer record. SQL:
SELECT amount FROM employees AS emp WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.id = emp.id );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09787
train
v1
Schema: categories (alias: catg)(salary, date, status, code) tasks(name, salary, date, status) Task: Find name from categories where code appears in tasks entries with matching code. SQL:
SELECT name FROM categories AS catg WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.code = catg.code );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "catg", "inner_alias": "tsk", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09788
train
v2
Schema: items (alias: lne)(date, salary, value, name) staff(code, id, level, date) Task: Retrieve salary from items that have at least one corresponding entry in staff sharing the same id. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = lne.id );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "salary", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09789
train
v3
Schema: managers (alias: mgr)(type, date, name, code) schedules(level, date, code, status) Task: Find salary from managers where salary exceeds the average amount from schedules for the same code. SQL:
SELECT salary FROM managers AS mgr WHERE salary > ( SELECT AVG(amount) FROM schedules AS schd WHERE schd.code = mgr.code );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09790
train
v1
Schema: items (alias: lne)(status, salary, code, name) projects(amount, salary, date, code) Task: Retrieve id from items whose type is found in projects rows where id matches the outer record. SQL:
SELECT id FROM items AS lne WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.id = lne.id );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09791
train
v3
Schema: tasks (alias: tsk)(id, date, amount, value) sales(name, code, type, level) Task: Find value from tasks where amount exceeds the total value from sales for the same id. SQL:
SELECT value FROM tasks AS tsk WHERE amount > ( SELECT SUM(value) FROM sales AS sale WHERE sale.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "sales", "outer_alias": "tsk", "inner_alias": "sale", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09792
train
v2
Schema: tasks (alias: tsk)(status, type, code, id) transactions(id, code, salary, amount) Task: Retrieve value from tasks that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT value FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "transactions", "outer_alias": "tsk", "inner_alias": "txn", "proj_col": "value", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09793
train
v1
Schema: accounts (alias: acct)(amount, status, value, date) employees(amount, level, salary, date) Task: Select value from accounts where id exists in employees for the same code. SQL:
SELECT value FROM accounts AS acct WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09794
train
v3
Schema: customers (alias: cust)(amount, status, level, code) accounts(amount, name, id, level) Task: Find value from customers where amount exceeds the maximum amount from accounts for the same level. SQL:
SELECT value FROM customers AS cust WHERE amount > ( SELECT MAX(amount) FROM accounts AS acct WHERE acct.level = cust.level );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09795
train
v1
Schema: staff (alias: empl)(level, name, amount, type) schedules(value, name, code, type) Task: Retrieve value from staff whose code is found in schedules rows where type matches the outer record. SQL:
SELECT value FROM staff AS empl WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.type = empl.type );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09796
train
v3
Schema: tasks (alias: tsk)(name, date, amount, level) customers(level, salary, value, code) Task: Retrieve amount from tasks with salary above the AVG(value) of customers rows sharing the same type. SQL:
SELECT amount FROM tasks AS tsk WHERE salary > ( SELECT AVG(value) FROM customers AS cust WHERE cust.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "customers", "outer_alias": "tsk", "inner_alias": "cust", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09797
train
v1
Schema: schedules (alias: schd)(id, level, name, value) staff(amount, value, name, salary) Task: Find amount from schedules where type appears in staff entries with matching code. SQL:
SELECT amount FROM schedules AS schd WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.code = schd.code );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09798
train
v2
Schema: sales (alias: sale)(amount, id, date, name) requests(level, type, salary, code) Task: Retrieve salary from sales that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = sale.type );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "salary", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09799
train