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)(id, code, date, salary) sales(date, id, name, status) Task: Find code from staff where a matching record exists in sales with the same level. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = empl.level );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "code", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12800
train
v2
Schema: invoices (alias: inv)(level, salary, id, value) orders(value, name, status, type) Task: Find id from invoices where a matching record exists in orders with the same level. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = inv.level );
{ "outer_table": "invoices", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "id", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12801
train
v2
Schema: transactions (alias: txn)(code, name, status, salary) managers(value, status, date, salary) Task: Retrieve amount from transactions that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = txn.status );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "amount", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12802
train
v3
Schema: items (alias: lne)(salary, date, name, value) managers(amount, name, id, value) Task: Find code from items where amount exceeds the maximum salary from managers for the same type. SQL:
SELECT code FROM items AS lne WHERE amount > ( SELECT MAX(salary) FROM managers AS mgr WHERE mgr.type = lne.type );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12803
train
v2
Schema: shipments (alias: shp)(level, value, status, date) requests(salary, id, code, level) Task: Retrieve id from shipments that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT id 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": "id", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_12804
train
v1
Schema: shipments (alias: shp)(type, id, level, status) requests(code, status, level, salary) Task: Select value from shipments where level exists in requests for the same level. SQL:
SELECT value FROM shipments AS shp WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.level = shp.level );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_12805
train
v3
Schema: accounts (alias: acct)(name, value, id, date) employees(level, value, status, date) Task: Find salary from accounts where amount exceeds the total amount from employees for the same id. SQL:
SELECT salary FROM accounts AS acct WHERE amount > ( SELECT SUM(amount) FROM employees AS emp WHERE emp.id = acct.id );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12806
train
v2
Schema: sales (alias: sale)(status, id, date, type) staff(status, salary, amount, id) Task: Find amount from sales where a matching record exists in staff with the same id. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = sale.id );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "amount", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12807
train
v3
Schema: orders (alias: ord)(value, salary, id, status) regions(date, code, name, amount) Task: Find name from orders where salary exceeds the maximum salary from regions for the same id. SQL:
SELECT name FROM orders AS ord WHERE salary > ( SELECT MAX(salary) FROM regions AS rgn WHERE rgn.id = ord.id );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12808
train
v2
Schema: staff (alias: empl)(salary, name, amount, type) managers(value, code, name, id) Task: Find name from staff where a matching record exists in managers with the same id. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = empl.id );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "name", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12809
train
v1
Schema: items (alias: lne)(code, level, value, id) staff(amount, type, date, status) Task: Find code from items where code appears in staff entries with matching type. SQL:
SELECT code FROM items AS lne WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.type = lne.type );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12810
train
v2
Schema: employees (alias: emp)(date, id, level, amount) departments(code, level, date, salary) Task: Find value from employees where a matching record exists in departments with the same level. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = emp.level );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "value", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12811
train
v2
Schema: products (alias: prod)(id, value, level, type) managers(name, date, status, amount) Task: Retrieve name from products that have at least one corresponding entry in managers sharing the same type. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = prod.type );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "name", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12812
train
v2
Schema: managers (alias: mgr)(status, date, salary, type) items(level, type, id, code) Task: Find code from managers where a matching record exists in items with the same id. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = mgr.id );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "code", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12813
train
v3
Schema: managers (alias: mgr)(amount, salary, name, value) orders(type, value, amount, code) Task: Retrieve salary from managers with salary above the MIN(salary) of orders rows sharing the same status. SQL:
SELECT salary FROM managers AS mgr WHERE salary > ( SELECT MIN(salary) FROM orders AS ord WHERE ord.status = mgr.status );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12814
train
v1
Schema: products (alias: prod)(type, status, date, name) items(amount, level, salary, type) Task: Select salary from products where id exists in items for the same code. SQL:
SELECT salary FROM products AS prod WHERE id IN ( SELECT id FROM items AS lne WHERE lne.code = prod.code );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12815
train
v1
Schema: employees (alias: emp)(name, type, status, id) sales(name, value, amount, status) Task: Retrieve value from employees whose level is found in sales rows where code matches the outer record. SQL:
SELECT value FROM employees AS emp WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.code = emp.code );
{ "outer_table": "employees", "inner_table": "sales", "outer_alias": "emp", "inner_alias": "sale", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12816
train
v1
Schema: products (alias: prod)(salary, status, id, value) accounts(status, date, id, value) Task: Find id from products where code appears in accounts entries with matching code. SQL:
SELECT id FROM products AS prod WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.code = prod.code );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12817
train
v3
Schema: items (alias: lne)(status, level, type, code) regions(level, type, name, amount) Task: Retrieve amount from items with amount above the SUM(salary) of regions rows sharing the same level. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT SUM(salary) FROM regions AS rgn WHERE rgn.level = lne.level );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12818
train
v3
Schema: accounts (alias: acct)(type, id, date, level) customers(salary, date, id, type) Task: Retrieve id from accounts with amount above the MAX(amount) of customers rows sharing the same status. SQL:
SELECT id FROM accounts AS acct WHERE amount > ( SELECT MAX(amount) FROM customers AS cust WHERE cust.status = acct.status );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12819
train
v1
Schema: schedules (alias: schd)(amount, salary, id, value) accounts(status, name, code, amount) Task: Retrieve name from schedules whose status is found in accounts rows where code matches the outer record. SQL:
SELECT name FROM schedules AS schd WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.code = schd.code );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12820
train
v1
Schema: tasks (alias: tsk)(id, status, salary, date) invoices(level, id, status, salary) Task: Find value from tasks where id appears in invoices entries with matching status. SQL:
SELECT value FROM tasks AS tsk WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "invoices", "outer_alias": "tsk", "inner_alias": "inv", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12821
train
v1
Schema: shipments (alias: shp)(id, date, value, status) customers(level, name, type, salary) Task: Select name from shipments where code exists in customers for the same level. SQL:
SELECT name FROM shipments AS shp WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.level = shp.level );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_12822
train
v2
Schema: requests (alias: ordr)(value, date, salary, id) staff(date, level, type, amount) Task: Retrieve id from requests that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = ordr.status );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "id", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12823
train
v2
Schema: regions (alias: rgn)(status, id, type, value) customers(name, type, salary, level) Task: Retrieve id from regions that have at least one corresponding entry in customers sharing the same status. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = rgn.status );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "id", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12824
train
v1
Schema: employees (alias: emp)(salary, id, type, amount) regions(salary, code, value, level) Task: Select salary from employees where code exists in regions for the same id. SQL:
SELECT salary FROM employees AS emp WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.id = emp.id );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12825
train
v2
Schema: categories (alias: catg)(date, id, salary, code) accounts(value, salary, id, level) Task: Find id from categories where a matching record exists in accounts with the same status. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = catg.status );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "id", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12826
train
v2
Schema: departments (alias: dept)(id, date, name, level) items(level, name, amount, date) Task: Find salary from departments where a matching record exists in items with the same status. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = dept.status );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "salary", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12827
train
v3
Schema: departments (alias: dept)(code, date, id, level) requests(value, id, type, date) Task: Find code from departments where value exceeds the total amount from requests for the same status. SQL:
SELECT code FROM departments AS dept WHERE value > ( SELECT SUM(amount) FROM requests AS ordr WHERE ordr.status = dept.status );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12828
train
v1
Schema: customers (alias: cust)(status, date, level, salary) invoices(level, code, type, name) Task: Select id from customers where status exists in invoices for the same status. SQL:
SELECT id FROM customers AS cust WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.status = cust.status );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12829
train
v2
Schema: orders (alias: ord)(name, id, value, level) customers(salary, amount, date, level) Task: Retrieve salary from orders that have at least one corresponding entry in customers sharing the same id. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = ord.id );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "salary", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12830
train
v3
Schema: items (alias: lne)(id, value, code, level) regions(id, salary, level, name) Task: Find salary from items where value exceeds the count of value from regions for the same id. SQL:
SELECT salary FROM items AS lne WHERE value > ( SELECT COUNT(value) FROM regions AS rgn WHERE rgn.id = lne.id );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12831
train
v2
Schema: sales (alias: sale)(value, code, date, name) items(id, level, salary, date) Task: Retrieve amount from sales that have at least one corresponding entry in items sharing the same status. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = sale.status );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "amount", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12832
train
v2
Schema: items (alias: lne)(salary, value, type, status) shipments(name, level, id, type) Task: Retrieve salary from items that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = lne.status );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "salary", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12833
train
v2
Schema: customers (alias: cust)(value, salary, level, type) departments(type, status, code, amount) Task: Find name from customers where a matching record exists in departments with the same status. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = cust.status );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "name", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12834
train
v2
Schema: managers (alias: mgr)(amount, salary, type, id) customers(amount, status, name, value) Task: Retrieve code from managers that have at least one corresponding entry in customers sharing the same status. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = mgr.status );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "code", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12835
train
v1
Schema: sales (alias: sale)(amount, type, salary, status) customers(name, type, amount, value) Task: Find amount from sales where type appears in customers entries with matching status. SQL:
SELECT amount FROM sales AS sale WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.status = sale.status );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12836
train
v1
Schema: projects (alias: prj)(code, id, salary, date) employees(status, amount, type, id) Task: Select amount from projects where id exists in employees for the same code. SQL:
SELECT amount FROM projects AS prj WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.code = prj.code );
{ "outer_table": "projects", "inner_table": "employees", "outer_alias": "prj", "inner_alias": "emp", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12837
train
v1
Schema: orders (alias: ord)(id, level, status, type) invoices(id, date, code, level) Task: Select id from orders where status exists in invoices for the same type. SQL:
SELECT id FROM orders AS ord WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.type = ord.type );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12838
train
v2
Schema: tasks (alias: tsk)(salary, date, id, level) departments(value, id, level, code) Task: Retrieve id from tasks that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "tsk", "inner_alias": "dept", "proj_col": "id", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12839
train
v2
Schema: products (alias: prod)(value, level, amount, salary) shipments(type, level, value, salary) Task: Find value from products where a matching record exists in shipments with the same id. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = prod.id );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "value", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12840
train
v2
Schema: regions (alias: rgn)(code, type, value, status) shipments(status, name, type, date) Task: Retrieve value from regions that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = rgn.id );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "value", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12841
train
v2
Schema: departments (alias: dept)(status, value, salary, id) customers(code, salary, amount, status) Task: Find amount from departments where a matching record exists in customers with the same id. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = dept.id );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "amount", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12842
train
v3
Schema: categories (alias: catg)(salary, level, amount, code) employees(status, code, value, level) Task: Find amount from categories where amount exceeds the average value from employees for the same code. SQL:
SELECT amount FROM categories AS catg WHERE amount > ( SELECT AVG(value) FROM employees AS emp WHERE emp.code = catg.code );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12843
train
v1
Schema: items (alias: lne)(name, salary, code, amount) managers(name, amount, code, level) Task: Find name from items where level appears in managers entries with matching id. SQL:
SELECT name FROM items AS lne WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.id = lne.id );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12844
train
v1
Schema: staff (alias: empl)(code, status, value, date) sales(code, date, status, amount) Task: Retrieve value from staff whose id is found in sales rows where code matches the outer record. SQL:
SELECT value FROM staff AS empl WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.code = empl.code );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12845
train
v2
Schema: customers (alias: cust)(type, id, level, status) shipments(name, value, salary, level) Task: Find code from customers where a matching record exists in shipments with the same level. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = cust.level );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "code", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12846
train
v2
Schema: products (alias: prod)(level, date, status, name) accounts(name, salary, date, amount) Task: Find id from products where a matching record exists in accounts with the same status. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = prod.status );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12847
train
v3
Schema: shipments (alias: shp)(id, salary, level, code) customers(id, code, name, amount) Task: Find value from shipments where salary exceeds the minimum amount from customers for the same code. SQL:
SELECT value FROM shipments AS shp WHERE salary > ( SELECT MIN(amount) FROM customers AS cust WHERE cust.code = shp.code );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_12848
train
v2
Schema: products (alias: prod)(salary, id, status, date) items(date, value, name, id) Task: Retrieve amount from products that have at least one corresponding entry in items sharing the same type. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = prod.type );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "amount", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12849
train
v1
Schema: customers (alias: cust)(id, name, status, date) sales(salary, date, type, name) Task: Find name from customers where status appears in sales entries with matching type. SQL:
SELECT name FROM customers AS cust WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.type = cust.type );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12850
train
v2
Schema: departments (alias: dept)(value, amount, code, status) invoices(type, name, code, id) Task: Find salary from departments where a matching record exists in invoices with the same id. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = dept.id );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "salary", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12851
train
v1
Schema: staff (alias: empl)(salary, value, status, amount) orders(level, code, value, id) Task: Retrieve value from staff whose level is found in orders rows where code matches the outer record. SQL:
SELECT value FROM staff AS empl WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.code = empl.code );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12852
train
v3
Schema: categories (alias: catg)(code, value, id, level) accounts(code, type, salary, date) Task: Find name from categories where salary exceeds the total amount from accounts for the same level. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT SUM(amount) FROM accounts AS acct WHERE acct.level = catg.level );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12853
train
v3
Schema: transactions (alias: txn)(amount, status, date, name) sales(status, salary, date, level) Task: Retrieve id from transactions with amount above the AVG(amount) of sales rows sharing the same type. SQL:
SELECT id FROM transactions AS txn WHERE amount > ( SELECT AVG(amount) FROM sales AS sale WHERE sale.type = txn.type );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12854
train
v1
Schema: branches (alias: brc)(amount, name, level, status) sales(value, status, id, code) Task: Find id from branches where level appears in sales entries with matching id. SQL:
SELECT id FROM branches AS brc WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.id = brc.id );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12855
train
v3
Schema: products (alias: prod)(amount, name, salary, level) tasks(code, level, salary, name) Task: Retrieve code from products with salary above the AVG(value) of tasks rows sharing the same type. SQL:
SELECT code FROM products AS prod WHERE salary > ( SELECT AVG(value) FROM tasks AS tsk WHERE tsk.type = prod.type );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12856
train
v2
Schema: accounts (alias: acct)(level, value, name, id) projects(id, level, name, salary) Task: Retrieve name from accounts that have at least one corresponding entry in projects sharing the same status. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = acct.status );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "name", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12857
train
v3
Schema: schedules (alias: schd)(code, value, id, salary) managers(value, salary, name, type) Task: Find value from schedules where salary exceeds the minimum value from managers for the same id. SQL:
SELECT value FROM schedules AS schd WHERE salary > ( SELECT MIN(value) FROM managers AS mgr WHERE mgr.id = schd.id );
{ "outer_table": "schedules", "inner_table": "managers", "outer_alias": "schd", "inner_alias": "mgr", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12858
train
v2
Schema: sales (alias: sale)(value, status, level, salary) projects(type, id, name, salary) Task: Retrieve code from sales that have at least one corresponding entry in projects sharing the same id. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = sale.id );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "code", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12859
train
v1
Schema: managers (alias: mgr)(code, status, date, name) employees(status, level, amount, code) Task: Select salary from managers where status exists in employees for the same type. SQL:
SELECT salary FROM managers AS mgr WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.type = mgr.type );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12860
train
v3
Schema: transactions (alias: txn)(value, id, code, amount) departments(type, amount, status, name) Task: Retrieve amount from transactions with amount above the SUM(value) of departments rows sharing the same id. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT SUM(value) FROM departments AS dept WHERE dept.id = txn.id );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12861
train
v2
Schema: requests (alias: ordr)(amount, type, name, code) products(salary, level, type, value) Task: Find amount from requests where a matching record exists in products with the same id. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = ordr.id );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "amount", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12862
train
v1
Schema: departments (alias: dept)(code, salary, date, name) accounts(type, level, amount, salary) Task: Find amount from departments where code appears in accounts entries with matching level. SQL:
SELECT amount FROM departments AS dept WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.level = dept.level );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12863
train
v2
Schema: branches (alias: brc)(type, status, id, amount) regions(type, code, value, status) Task: Retrieve id from branches that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = brc.status );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "brc", "inner_alias": "rgn", "proj_col": "id", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12864
train
v3
Schema: branches (alias: brc)(status, salary, type, value) customers(value, name, status, type) Task: Find amount from branches where salary exceeds the average amount from customers for the same type. SQL:
SELECT amount FROM branches AS brc WHERE salary > ( SELECT AVG(amount) FROM customers AS cust WHERE cust.type = brc.type );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12865
train
v3
Schema: departments (alias: dept)(code, salary, value, amount) transactions(status, amount, id, code) Task: Retrieve name from departments with value above the SUM(amount) of transactions rows sharing the same status. SQL:
SELECT name FROM departments AS dept WHERE value > ( SELECT SUM(amount) FROM transactions AS txn WHERE txn.status = dept.status );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12866
train
v2
Schema: branches (alias: brc)(type, id, date, salary) staff(amount, salary, id, date) Task: Retrieve id from branches that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = brc.type );
{ "outer_table": "branches", "inner_table": "staff", "outer_alias": "brc", "inner_alias": "empl", "proj_col": "id", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12867
train
v2
Schema: staff (alias: empl)(status, code, name, value) departments(salary, value, status, id) Task: Find name from staff where a matching record exists in departments with the same level. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = empl.level );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "name", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12868
train
v3
Schema: sales (alias: sale)(code, level, date, value) tasks(date, name, status, level) Task: Retrieve name from sales with salary above the AVG(salary) of tasks rows sharing the same id. SQL:
SELECT name FROM sales AS sale WHERE salary > ( SELECT AVG(salary) FROM tasks AS tsk WHERE tsk.id = sale.id );
{ "outer_table": "sales", "inner_table": "tasks", "outer_alias": "sale", "inner_alias": "tsk", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12869
train
v1
Schema: schedules (alias: schd)(name, status, amount, salary) items(id, value, status, amount) Task: Retrieve id from schedules whose id is found in items rows where level matches the outer record. SQL:
SELECT id FROM schedules AS schd WHERE id IN ( SELECT id FROM items AS lne WHERE lne.level = schd.level );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12870
train
v1
Schema: items (alias: lne)(type, value, amount, date) products(salary, value, date, id) Task: Select name from items where id exists in products for the same type. SQL:
SELECT name FROM items AS lne WHERE id IN ( SELECT id FROM products AS prod WHERE prod.type = lne.type );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12871
train
v3
Schema: invoices (alias: inv)(value, type, status, amount) customers(salary, code, id, level) Task: Find salary from invoices where amount exceeds the maximum value from customers for the same type. SQL:
SELECT salary FROM invoices AS inv WHERE amount > ( SELECT MAX(value) FROM customers AS cust WHERE cust.type = inv.type );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12872
train
v2
Schema: categories (alias: catg)(amount, status, salary, code) schedules(amount, date, level, salary) Task: Retrieve code from categories that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = catg.code );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12873
train
v1
Schema: departments (alias: dept)(type, value, salary, date) projects(level, code, id, type) Task: Retrieve amount from departments whose type is found in projects rows where id matches the outer record. SQL:
SELECT amount FROM departments AS dept WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.id = dept.id );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12874
train
v2
Schema: sales (alias: sale)(salary, code, amount, date) invoices(amount, date, id, salary) Task: Retrieve amount from sales that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = sale.code );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "amount", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12875
train
v3
Schema: regions (alias: rgn)(amount, date, salary, level) shipments(code, type, value, salary) Task: Find value from regions where amount exceeds the average salary from shipments for the same code. SQL:
SELECT value FROM regions AS rgn WHERE amount > ( SELECT AVG(salary) FROM shipments AS shp WHERE shp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12876
train
v2
Schema: sales (alias: sale)(id, type, level, status) transactions(code, id, value, status) Task: Retrieve value from sales that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = sale.level );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "value", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12877
train
v3
Schema: categories (alias: catg)(salary, status, code, level) employees(level, value, amount, type) Task: Retrieve name from categories with salary above the SUM(amount) of employees rows sharing the same id. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT SUM(amount) FROM employees AS emp WHERE emp.id = catg.id );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12878
train
v3
Schema: staff (alias: empl)(status, salary, id, amount) schedules(value, date, code, name) Task: Find amount from staff where value exceeds the maximum salary from schedules for the same status. SQL:
SELECT amount FROM staff AS empl WHERE value > ( SELECT MAX(salary) FROM schedules AS schd WHERE schd.status = empl.status );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12879
train
v3
Schema: sales (alias: sale)(code, date, type, salary) regions(value, salary, name, amount) Task: Retrieve code from sales with value above the COUNT(value) of regions rows sharing the same id. SQL:
SELECT code FROM sales AS sale WHERE value > ( SELECT COUNT(value) FROM regions AS rgn WHERE rgn.id = sale.id );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12880
train
v1
Schema: schedules (alias: schd)(salary, id, level, status) customers(value, date, status, salary) Task: Retrieve salary from schedules whose id is found in customers rows where id matches the outer record. SQL:
SELECT salary FROM schedules AS schd WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.id = schd.id );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12881
train
v1
Schema: projects (alias: prj)(id, salary, name, status) regions(code, value, id, type) Task: Retrieve id from projects whose id is found in regions rows where type matches the outer record. SQL:
SELECT id FROM projects AS prj WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.type = prj.type );
{ "outer_table": "projects", "inner_table": "regions", "outer_alias": "prj", "inner_alias": "rgn", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12882
train
v3
Schema: accounts (alias: acct)(value, status, id, type) managers(name, code, status, level) Task: Find name from accounts where value exceeds the minimum salary from managers for the same status. SQL:
SELECT name FROM accounts AS acct WHERE value > ( SELECT MIN(salary) FROM managers AS mgr WHERE mgr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12883
train
v3
Schema: schedules (alias: schd)(status, name, level, value) categories(value, salary, name, id) Task: Retrieve code from schedules with value above the AVG(value) of categories rows sharing the same level. SQL:
SELECT code FROM schedules AS schd WHERE value > ( SELECT AVG(value) FROM categories AS catg WHERE catg.level = schd.level );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12884
train
v1
Schema: managers (alias: mgr)(status, level, value, date) tasks(level, date, type, salary) Task: Retrieve value from managers whose code is found in tasks rows where code matches the outer record. SQL:
SELECT value FROM managers AS mgr WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.code = mgr.code );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12885
train
v2
Schema: customers (alias: cust)(amount, level, salary, code) transactions(amount, value, name, date) Task: Retrieve id from customers that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = cust.status );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "id", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12886
train
v1
Schema: sales (alias: sale)(status, id, level, value) projects(id, amount, type, value) Task: Find id from sales where type appears in projects entries with matching id. SQL:
SELECT id FROM sales AS sale WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.id = sale.id );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12887
train
v3
Schema: managers (alias: mgr)(date, code, status, value) branches(date, value, salary, amount) Task: Find amount from managers where value exceeds the count of amount from branches for the same code. SQL:
SELECT amount FROM managers AS mgr WHERE value > ( SELECT COUNT(amount) FROM branches AS brc WHERE brc.code = mgr.code );
{ "outer_table": "managers", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12888
train
v3
Schema: staff (alias: empl)(level, code, salary, date) shipments(level, id, status, name) Task: Retrieve id from staff with value above the MIN(value) of shipments rows sharing the same level. SQL:
SELECT id FROM staff AS empl WHERE value > ( SELECT MIN(value) FROM shipments AS shp WHERE shp.level = empl.level );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12889
train
v1
Schema: schedules (alias: schd)(id, code, value, salary) invoices(code, salary, date, level) Task: Find amount from schedules where id appears in invoices entries with matching type. SQL:
SELECT amount FROM schedules AS schd WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.type = schd.type );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12890
train
v2
Schema: invoices (alias: inv)(type, code, amount, level) projects(salary, level, status, id) Task: Find code from invoices where a matching record exists in projects with the same type. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = inv.type );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12891
train
v3
Schema: accounts (alias: acct)(id, level, salary, type) products(id, status, amount, level) Task: Retrieve name from accounts with salary above the MAX(value) of products rows sharing the same status. SQL:
SELECT name FROM accounts AS acct WHERE salary > ( SELECT MAX(value) FROM products AS prod WHERE prod.status = acct.status );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12892
train
v3
Schema: schedules (alias: schd)(name, level, code, status) sales(status, level, id, date) Task: Retrieve id from schedules with value above the MIN(value) of sales rows sharing the same type. SQL:
SELECT id FROM schedules AS schd WHERE value > ( SELECT MIN(value) FROM sales AS sale WHERE sale.type = schd.type );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12893
train
v3
Schema: requests (alias: ordr)(amount, date, status, type) managers(value, amount, id, type) Task: Find salary from requests where value exceeds the maximum amount from managers for the same level. SQL:
SELECT salary FROM requests AS ordr WHERE value > ( SELECT MAX(amount) FROM managers AS mgr WHERE mgr.level = ordr.level );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12894
train
v3
Schema: requests (alias: ordr)(salary, status, id, date) items(id, value, salary, name) Task: Retrieve amount from requests with value above the MAX(amount) of items rows sharing the same level. SQL:
SELECT amount FROM requests AS ordr WHERE value > ( SELECT MAX(amount) FROM items AS lne WHERE lne.level = ordr.level );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12895
train
v1
Schema: invoices (alias: inv)(name, salary, type, value) regions(name, id, level, amount) Task: Retrieve id from invoices whose level is found in regions rows where status matches the outer record. SQL:
SELECT id FROM invoices AS inv WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.status = inv.status );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12896
train
v2
Schema: regions (alias: rgn)(type, id, salary, level) branches(status, id, level, name) Task: Find salary from regions where a matching record exists in branches with the same level. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = rgn.level );
{ "outer_table": "regions", "inner_table": "branches", "outer_alias": "rgn", "inner_alias": "brc", "proj_col": "salary", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12897
train
v2
Schema: schedules (alias: schd)(status, value, salary, id) sales(type, id, salary, code) Task: Retrieve salary from schedules that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = schd.type );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "salary", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12898
train
v3
Schema: shipments (alias: shp)(name, salary, type, code) departments(name, code, status, salary) Task: Find value from shipments where salary exceeds the average value from departments for the same type. SQL:
SELECT value FROM shipments AS shp WHERE salary > ( SELECT AVG(value) FROM departments AS dept WHERE dept.type = shp.type );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_12899
train