variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v3
Schema: employees (alias: emp)(id, code, status, value) schedules(type, date, name, value) Task: Retrieve id from employees with value above the SUM(salary) of schedules rows sharing the same code. SQL:
SELECT id FROM employees AS emp WHERE value > ( SELECT SUM(salary) FROM schedules AS schd WHERE schd.code = emp.code );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04800
train
v3
Schema: customers (alias: cust)(date, amount, id, code) managers(amount, code, value, salary) Task: Retrieve value from customers with value above the AVG(amount) of managers rows sharing the same code. SQL:
SELECT value FROM customers AS cust WHERE value > ( SELECT AVG(amount) FROM managers AS mgr WHERE mgr.code = cust.code );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04801
train
v1
Schema: invoices (alias: inv)(level, code, amount, status) categories(name, level, value, type) Task: Select salary from invoices where level exists in categories for the same level. SQL:
SELECT salary FROM invoices AS inv WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.level = inv.level );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "salary", "filter_col": "level", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04802
train
v2
Schema: products (alias: prod)(salary, amount, value, level) managers(salary, type, status, code) Task: Find amount from products where a matching record exists in managers with the same level. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = prod.level );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "amount", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04803
train
v1
Schema: orders (alias: ord)(type, value, status, id) regions(salary, id, status, value) Task: Retrieve salary from orders whose id is found in regions rows where type matches the outer record. SQL:
SELECT salary FROM orders AS ord WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.type = ord.type );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "id", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04804
train
v3
Schema: sales (alias: sale)(code, level, amount, value) schedules(id, name, salary, type) Task: Retrieve id from sales with value above the SUM(salary) of schedules rows sharing the same id. SQL:
SELECT id FROM sales AS sale WHERE value > ( SELECT SUM(salary) FROM schedules AS schd WHERE schd.id = sale.id );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04805
train
v3
Schema: accounts (alias: acct)(code, level, status, name) items(type, status, id, level) Task: Retrieve value from accounts with value above the MAX(value) of items rows sharing the same status. SQL:
SELECT value FROM accounts AS acct WHERE value > ( SELECT MAX(value) FROM items AS lne WHERE lne.status = acct.status );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04806
train
v1
Schema: categories (alias: catg)(level, name, date, code) departments(code, status, name, amount) Task: Select id from categories where code exists in departments for the same id. SQL:
SELECT id FROM categories AS catg WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.id = catg.id );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04807
train
v1
Schema: departments (alias: dept)(level, id, date, code) transactions(value, date, status, salary) Task: Retrieve amount from departments whose status is found in transactions rows where status matches the outer record. SQL:
SELECT amount FROM departments AS dept WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.status = dept.status );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04808
train
v1
Schema: staff (alias: empl)(date, id, level, name) products(code, amount, status, value) Task: Select code from staff where code exists in products for the same code. SQL:
SELECT code FROM staff AS empl WHERE code IN ( SELECT code FROM products AS prod WHERE prod.code = empl.code );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04809
train
v3
Schema: customers (alias: cust)(date, level, type, value) products(amount, type, code, status) Task: Retrieve id from customers with amount above the MAX(salary) of products rows sharing the same id. SQL:
SELECT id FROM customers AS cust WHERE amount > ( SELECT MAX(salary) FROM products AS prod WHERE prod.id = cust.id );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04810
train
v3
Schema: invoices (alias: inv)(code, date, amount, status) requests(salary, name, level, value) Task: Find name from invoices where salary exceeds the total salary from requests for the same code. SQL:
SELECT name FROM invoices AS inv WHERE salary > ( SELECT SUM(salary) FROM requests AS ordr WHERE ordr.code = inv.code );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04811
train
v3
Schema: requests (alias: ordr)(value, type, date, name) orders(level, name, value, code) Task: Retrieve id from requests with salary above the AVG(amount) of orders rows sharing the same level. SQL:
SELECT id FROM requests AS ordr WHERE salary > ( SELECT AVG(amount) FROM orders AS ord WHERE ord.level = ordr.level );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04812
train
v1
Schema: departments (alias: dept)(code, type, level, id) staff(date, value, type, code) Task: Retrieve name from departments whose id is found in staff rows where code matches the outer record. SQL:
SELECT name FROM departments AS dept WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.code = dept.code );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04813
train
v3
Schema: items (alias: lne)(type, name, status, amount) projects(status, value, amount, code) Task: Find id from items where salary exceeds the minimum amount from projects for the same status. SQL:
SELECT id FROM items AS lne WHERE salary > ( SELECT MIN(amount) FROM projects AS prj WHERE prj.status = lne.status );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04814
train
v3
Schema: categories (alias: catg)(date, salary, name, id) schedules(type, salary, value, amount) Task: Find name from categories where salary exceeds the count of amount from schedules for the same type. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT COUNT(amount) FROM schedules AS schd WHERE schd.type = catg.type );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04815
train
v3
Schema: requests (alias: ordr)(salary, code, status, value) products(salary, value, name, amount) Task: Find name from requests where value exceeds the average salary from products for the same type. SQL:
SELECT name FROM requests AS ordr WHERE value > ( SELECT AVG(salary) FROM products AS prod WHERE prod.type = ordr.type );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04816
train
v2
Schema: regions (alias: rgn)(type, date, name, salary) requests(level, type, id, amount) Task: Retrieve salary from regions that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = rgn.status );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "salary", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04817
train
v1
Schema: customers (alias: cust)(level, code, name, type) branches(status, name, id, value) Task: Find value from customers where level appears in branches entries with matching level. SQL:
SELECT value FROM customers AS cust WHERE level IN ( SELECT level FROM branches AS brc WHERE brc.level = cust.level );
{ "outer_table": "customers", "inner_table": "branches", "outer_alias": "cust", "inner_alias": "brc", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04818
train
v2
Schema: invoices (alias: inv)(status, salary, type, code) tasks(type, level, id, code) Task: Find code from invoices where a matching record exists in tasks with the same type. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = inv.type );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04819
train
v2
Schema: items (alias: lne)(date, type, id, status) shipments(type, salary, value, level) Task: Retrieve id from items that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = lne.code );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "id", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04820
train
v1
Schema: shipments (alias: shp)(amount, value, level, name) requests(value, amount, status, name) Task: Retrieve amount from shipments whose type is found in requests rows where code matches the outer record. SQL:
SELECT amount FROM shipments AS shp WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.code = shp.code );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04821
train
v3
Schema: employees (alias: emp)(amount, name, id, type) branches(salary, name, value, date) Task: Find salary from employees where salary exceeds the average value from branches for the same level. SQL:
SELECT salary FROM employees AS emp WHERE salary > ( SELECT AVG(value) FROM branches AS brc WHERE brc.level = emp.level );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04822
train
v2
Schema: branches (alias: brc)(date, value, level, salary) departments(amount, date, value, level) Task: Retrieve salary from branches that have at least one corresponding entry in departments sharing the same id. SQL:
SELECT salary FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = brc.id );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "brc", "inner_alias": "dept", "proj_col": "salary", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04823
train
v2
Schema: items (alias: lne)(date, code, id, status) managers(salary, value, date, name) Task: Find amount from items where a matching record exists in managers with the same level. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = lne.level );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "amount", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04824
train
v1
Schema: products (alias: prod)(date, code, type, status) branches(value, amount, name, status) Task: Select amount from products where code exists in branches for the same code. SQL:
SELECT amount FROM products AS prod WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.code = prod.code );
{ "outer_table": "products", "inner_table": "branches", "outer_alias": "prod", "inner_alias": "brc", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04825
train
v1
Schema: tasks (alias: tsk)(level, amount, value, id) managers(code, amount, level, id) Task: Retrieve salary from tasks whose code is found in managers rows where type matches the outer record. SQL:
SELECT salary FROM tasks AS tsk WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04826
train
v3
Schema: tasks (alias: tsk)(type, id, code, level) categories(value, code, status, name) Task: Retrieve value from tasks with salary above the MIN(salary) of categories rows sharing the same code. SQL:
SELECT value FROM tasks AS tsk WHERE salary > ( SELECT MIN(salary) FROM categories AS catg WHERE catg.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "tsk", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04827
train
v1
Schema: tasks (alias: tsk)(value, type, level, salary) regions(type, status, amount, name) Task: Select salary from tasks where id exists in regions for the same code. SQL:
SELECT salary FROM tasks AS tsk WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "tsk", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04828
train
v3
Schema: categories (alias: catg)(value, code, date, name) tasks(level, status, name, date) Task: Find salary from categories where value exceeds the minimum salary from tasks for the same type. SQL:
SELECT salary FROM categories AS catg WHERE value > ( SELECT MIN(salary) FROM tasks AS tsk WHERE tsk.type = catg.type );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "catg", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04829
train
v2
Schema: projects (alias: prj)(salary, status, amount, code) accounts(code, date, value, salary) Task: Find name from projects where a matching record exists in accounts with the same id. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = prj.id );
{ "outer_table": "projects", "inner_table": "accounts", "outer_alias": "prj", "inner_alias": "acct", "proj_col": "name", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04830
train
v3
Schema: products (alias: prod)(id, type, name, date) orders(value, salary, name, date) Task: Retrieve name from products with amount above the SUM(value) of orders rows sharing the same code. SQL:
SELECT name FROM products AS prod WHERE amount > ( SELECT SUM(value) FROM orders AS ord WHERE ord.code = prod.code );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04831
train
v1
Schema: requests (alias: ordr)(status, level, date, value) products(amount, name, code, value) Task: Retrieve value from requests whose type is found in products rows where status matches the outer record. SQL:
SELECT value FROM requests AS ordr WHERE type IN ( SELECT type FROM products AS prod WHERE prod.status = ordr.status );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04832
train
v2
Schema: branches (alias: brc)(value, status, level, id) projects(date, salary, type, id) Task: Find id from branches where a matching record exists in projects with the same code. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = brc.code );
{ "outer_table": "branches", "inner_table": "projects", "outer_alias": "brc", "inner_alias": "prj", "proj_col": "id", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04833
train
v2
Schema: accounts (alias: acct)(value, id, level, date) sales(salary, status, id, name) Task: Find code from accounts where a matching record exists in sales with the same id. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = acct.id );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04834
train
v3
Schema: invoices (alias: inv)(type, status, salary, date) staff(amount, salary, id, name) Task: Find value from invoices where salary exceeds the total salary from staff for the same level. SQL:
SELECT value FROM invoices AS inv WHERE salary > ( SELECT SUM(salary) FROM staff AS empl WHERE empl.level = inv.level );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04835
train
v2
Schema: items (alias: lne)(level, date, code, name) products(salary, status, name, date) Task: Retrieve amount from items that have at least one corresponding entry in products sharing the same type. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = lne.type );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "amount", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04836
train
v2
Schema: shipments (alias: shp)(value, code, id, name) customers(code, status, amount, name) Task: Retrieve value from shipments that have at least one corresponding entry in customers sharing the same code. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = shp.code );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "value", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04837
train
v3
Schema: employees (alias: emp)(status, level, code, date) customers(level, status, amount, salary) Task: Retrieve value from employees with salary above the MIN(amount) of customers rows sharing the same status. SQL:
SELECT value FROM employees AS emp WHERE salary > ( SELECT MIN(amount) FROM customers AS cust WHERE cust.status = emp.status );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04838
train
v3
Schema: accounts (alias: acct)(amount, code, status, name) categories(status, id, name, type) Task: Retrieve name from accounts with salary above the COUNT(value) of categories rows sharing the same type. SQL:
SELECT name FROM accounts AS acct WHERE salary > ( SELECT COUNT(value) FROM categories AS catg WHERE catg.type = acct.type );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04839
train
v3
Schema: items (alias: lne)(code, id, name, status) requests(date, value, status, level) Task: Retrieve name from items with amount above the SUM(value) of requests rows sharing the same level. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT SUM(value) FROM requests AS ordr WHERE ordr.level = lne.level );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04840
train
v1
Schema: requests (alias: ordr)(status, id, name, value) shipments(salary, value, type, code) Task: Find id from requests where code appears in shipments entries with matching id. SQL:
SELECT id FROM requests AS ordr WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.id = ordr.id );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04841
train
v2
Schema: projects (alias: prj)(value, date, name, salary) departments(name, salary, value, level) Task: Retrieve value from projects that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = prj.status );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "value", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04842
train
v1
Schema: orders (alias: ord)(id, amount, status, value) staff(id, amount, code, name) Task: Find value from orders where level appears in staff entries with matching type. SQL:
SELECT value FROM orders AS ord WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.type = ord.type );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04843
train
v3
Schema: products (alias: prod)(code, id, name, amount) items(salary, value, type, name) Task: Retrieve code from products with salary above the AVG(salary) of items rows sharing the same status. SQL:
SELECT code FROM products AS prod WHERE salary > ( SELECT AVG(salary) FROM items AS lne WHERE lne.status = prod.status );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04844
train
v3
Schema: managers (alias: mgr)(code, amount, level, id) schedules(name, salary, code, amount) Task: Find name from managers where value exceeds the maximum value from schedules for the same level. SQL:
SELECT name FROM managers AS mgr WHERE value > ( SELECT MAX(value) FROM schedules AS schd WHERE schd.level = mgr.level );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04845
train
v3
Schema: accounts (alias: acct)(date, type, salary, level) employees(value, code, id, amount) Task: Retrieve amount from accounts with amount above the SUM(amount) of employees rows sharing the same level. SQL:
SELECT amount FROM accounts AS acct WHERE amount > ( SELECT SUM(amount) FROM employees AS emp WHERE emp.level = acct.level );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04846
train
v3
Schema: schedules (alias: schd)(status, salary, value, name) requests(salary, type, status, amount) Task: Retrieve amount from schedules with amount above the SUM(amount) of requests rows sharing the same id. SQL:
SELECT amount FROM schedules AS schd WHERE amount > ( SELECT SUM(amount) FROM requests AS ordr WHERE ordr.id = schd.id );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04847
train
v1
Schema: schedules (alias: schd)(date, name, id, level) products(amount, status, value, salary) Task: Select code from schedules where code exists in products for the same level. SQL:
SELECT code FROM schedules AS schd WHERE code IN ( SELECT code FROM products AS prod WHERE prod.level = schd.level );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04848
train
v2
Schema: products (alias: prod)(value, code, status, id) categories(amount, type, level, code) Task: Retrieve value from products that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = prod.code );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "value", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04849
train
v2
Schema: sales (alias: sale)(amount, salary, id, value) regions(amount, date, name, value) Task: Find value from sales where a matching record exists in regions with the same status. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = sale.status );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "value", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04850
train
v3
Schema: customers (alias: cust)(type, id, value, date) transactions(level, name, status, date) Task: Retrieve code from customers with value above the COUNT(salary) of transactions rows sharing the same level. SQL:
SELECT code FROM customers AS cust WHERE value > ( SELECT COUNT(salary) FROM transactions AS txn WHERE txn.level = cust.level );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04851
train
v1
Schema: tasks (alias: tsk)(amount, date, value, type) schedules(value, amount, id, status) Task: Find code from tasks where level appears in schedules entries with matching id. SQL:
SELECT code FROM tasks AS tsk WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "schedules", "outer_alias": "tsk", "inner_alias": "schd", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04852
train
v3
Schema: shipments (alias: shp)(status, amount, id, level) customers(status, type, date, level) Task: Find code from shipments where amount exceeds the average value from customers for the same level. SQL:
SELECT code FROM shipments AS shp WHERE amount > ( SELECT AVG(value) FROM customers AS cust WHERE cust.level = shp.level );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04853
train
v2
Schema: products (alias: prod)(code, name, date, amount) orders(date, code, type, salary) Task: Retrieve amount from products that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = prod.code );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "amount", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04854
train
v3
Schema: accounts (alias: acct)(date, amount, level, name) customers(amount, code, salary, date) Task: Find id from accounts where value exceeds the maximum amount from customers for the same id. SQL:
SELECT id FROM accounts AS acct WHERE value > ( SELECT MAX(amount) FROM customers AS cust WHERE cust.id = acct.id );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04855
train
v2
Schema: shipments (alias: shp)(name, date, level, type) accounts(value, type, level, amount) Task: Retrieve code from shipments that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = shp.status );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04856
train
v1
Schema: branches (alias: brc)(value, type, id, name) departments(value, level, status, type) Task: Retrieve amount from branches whose id is found in departments rows where id matches the outer record. SQL:
SELECT amount FROM branches AS brc WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.id = brc.id );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "brc", "inner_alias": "dept", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04857
train
v1
Schema: branches (alias: brc)(code, id, level, date) items(level, type, amount, name) Task: Retrieve code from branches whose type is found in items rows where level matches the outer record. SQL:
SELECT code FROM branches AS brc WHERE type IN ( SELECT type FROM items AS lne WHERE lne.level = brc.level );
{ "outer_table": "branches", "inner_table": "items", "outer_alias": "brc", "inner_alias": "lne", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04858
train
v2
Schema: departments (alias: dept)(id, amount, code, type) staff(code, name, value, level) Task: Retrieve name from departments that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = dept.type );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "name", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04859
train
v3
Schema: branches (alias: brc)(level, id, amount, code) tasks(date, code, level, amount) Task: Find amount from branches where salary exceeds the count of value from tasks for the same code. SQL:
SELECT amount FROM branches AS brc WHERE salary > ( SELECT COUNT(value) FROM tasks AS tsk WHERE tsk.code = brc.code );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04860
train
v2
Schema: invoices (alias: inv)(level, code, date, status) departments(code, name, value, type) Task: Retrieve salary from invoices that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = inv.status );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "salary", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04861
train
v2
Schema: orders (alias: ord)(date, status, amount, value) items(salary, id, type, value) Task: Find value from orders where a matching record exists in items with the same type. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = ord.type );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "value", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04862
train
v3
Schema: items (alias: lne)(name, type, code, salary) staff(id, date, level, amount) Task: Find value from items where amount exceeds the count of salary from staff for the same code. SQL:
SELECT value FROM items AS lne WHERE amount > ( SELECT COUNT(salary) FROM staff AS empl WHERE empl.code = lne.code );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04863
train
v2
Schema: employees (alias: emp)(amount, value, code, salary) projects(value, type, id, level) Task: Retrieve id from employees that have at least one corresponding entry in projects sharing the same level. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = emp.level );
{ "outer_table": "employees", "inner_table": "projects", "outer_alias": "emp", "inner_alias": "prj", "proj_col": "id", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04864
train
v1
Schema: categories (alias: catg)(level, value, name, status) projects(status, value, type, name) Task: Retrieve salary from categories whose type is found in projects rows where level matches the outer record. SQL:
SELECT salary FROM categories AS catg WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.level = catg.level );
{ "outer_table": "categories", "inner_table": "projects", "outer_alias": "catg", "inner_alias": "prj", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04865
train
v2
Schema: invoices (alias: inv)(name, value, id, type) categories(value, salary, code, level) Task: Retrieve id from invoices that have at least one corresponding entry in categories sharing the same type. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = inv.type );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04866
train
v3
Schema: accounts (alias: acct)(id, level, value, salary) employees(amount, level, salary, status) Task: Retrieve amount from accounts with amount above the COUNT(amount) of employees rows sharing the same type. SQL:
SELECT amount FROM accounts AS acct WHERE amount > ( SELECT COUNT(amount) FROM employees AS emp WHERE emp.type = acct.type );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04867
train
v3
Schema: branches (alias: brc)(name, id, amount, value) shipments(code, name, date, status) Task: Find salary from branches where value exceeds the maximum amount from shipments for the same code. SQL:
SELECT salary FROM branches AS brc WHERE value > ( SELECT MAX(amount) FROM shipments AS shp WHERE shp.code = brc.code );
{ "outer_table": "branches", "inner_table": "shipments", "outer_alias": "brc", "inner_alias": "shp", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04868
train
v3
Schema: invoices (alias: inv)(name, level, id, salary) branches(value, salary, type, amount) Task: Retrieve salary from invoices with value above the AVG(value) of branches rows sharing the same type. SQL:
SELECT salary FROM invoices AS inv WHERE value > ( SELECT AVG(value) FROM branches AS brc WHERE brc.type = inv.type );
{ "outer_table": "invoices", "inner_table": "branches", "outer_alias": "inv", "inner_alias": "brc", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04869
train
v2
Schema: projects (alias: prj)(name, date, id, type) transactions(name, code, salary, id) Task: Find code from projects where a matching record exists in transactions with the same level. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = prj.level );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "code", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04870
train
v1
Schema: invoices (alias: inv)(status, amount, name, date) managers(id, date, amount, status) Task: Find value from invoices where code appears in managers entries with matching id. SQL:
SELECT value FROM invoices AS inv WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.id = inv.id );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04871
train
v2
Schema: transactions (alias: txn)(value, id, level, name) departments(level, date, name, status) Task: Find amount from transactions where a matching record exists in departments with the same id. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = txn.id );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "amount", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04872
train
v1
Schema: staff (alias: empl)(name, type, date, code) employees(status, level, date, salary) Task: Select salary from staff where status exists in employees for the same type. SQL:
SELECT salary FROM staff AS empl WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.type = empl.type );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04873
train
v3
Schema: branches (alias: brc)(status, id, value, date) categories(code, level, type, amount) Task: Find salary from branches where value exceeds the total salary from categories for the same status. SQL:
SELECT salary FROM branches AS brc WHERE value > ( SELECT SUM(salary) FROM categories AS catg WHERE catg.status = brc.status );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "salary", "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_04874
train
v3
Schema: customers (alias: cust)(id, name, salary, date) requests(salary, amount, type, value) Task: Find salary from customers where amount exceeds the total amount from requests for the same level. SQL:
SELECT salary FROM customers AS cust WHERE amount > ( SELECT SUM(amount) FROM requests AS ordr WHERE ordr.level = cust.level );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04875
train
v2
Schema: regions (alias: rgn)(code, type, date, amount) staff(name, id, value, code) Task: Retrieve name from regions that have at least one corresponding entry in staff sharing the same code. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = rgn.code );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "name", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04876
train
v1
Schema: regions (alias: rgn)(type, date, id, level) schedules(type, level, status, id) Task: Retrieve salary from regions whose status is found in schedules rows where level matches the outer record. SQL:
SELECT salary FROM regions AS rgn WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.level = rgn.level );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04877
train
v3
Schema: shipments (alias: shp)(name, id, level, status) sales(level, name, amount, value) Task: Retrieve value from shipments with amount above the COUNT(value) of sales rows sharing the same code. SQL:
SELECT value FROM shipments AS shp WHERE amount > ( SELECT COUNT(value) FROM sales AS sale WHERE sale.code = shp.code );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04878
train
v2
Schema: products (alias: prod)(status, amount, date, id) sales(level, date, amount, id) Task: Retrieve id from products that have at least one corresponding entry in sales sharing the same status. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = prod.status );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04879
train
v1
Schema: orders (alias: ord)(code, level, status, date) items(salary, amount, id, type) Task: Find value from orders where status appears in items entries with matching id. SQL:
SELECT value FROM orders AS ord WHERE status IN ( SELECT status FROM items AS lne WHERE lne.id = ord.id );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04880
train
v1
Schema: accounts (alias: acct)(salary, status, type, id) schedules(value, date, name, status) Task: Select amount from accounts where status exists in schedules for the same code. SQL:
SELECT amount FROM accounts AS acct WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.code = acct.code );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04881
train
v2
Schema: transactions (alias: txn)(status, salary, level, type) branches(date, status, value, level) Task: Retrieve name from transactions that have at least one corresponding entry in branches sharing the same status. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = txn.status );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "name", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04882
train
v1
Schema: regions (alias: rgn)(name, type, id, salary) customers(type, code, amount, name) Task: Retrieve id from regions whose code is found in customers rows where status matches the outer record. SQL:
SELECT id FROM regions AS rgn WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.status = rgn.status );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04883
train
v2
Schema: invoices (alias: inv)(level, type, code, amount) projects(code, value, name, salary) Task: Retrieve value from invoices that have at least one corresponding entry in projects sharing the same level. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = inv.level );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "value", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04884
train
v1
Schema: branches (alias: brc)(type, status, id, value) schedules(id, code, level, status) Task: Find value from branches where status appears in schedules entries with matching level. SQL:
SELECT value FROM branches AS brc WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.level = brc.level );
{ "outer_table": "branches", "inner_table": "schedules", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04885
train
v3
Schema: schedules (alias: schd)(id, value, code, status) departments(level, status, name, amount) Task: Find salary from schedules where amount exceeds the average value from departments for the same type. SQL:
SELECT salary FROM schedules AS schd WHERE amount > ( SELECT AVG(value) FROM departments AS dept WHERE dept.type = schd.type );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04886
train
v1
Schema: projects (alias: prj)(id, salary, date, value) managers(value, amount, level, status) Task: Select amount from projects where code exists in managers for the same level. SQL:
SELECT amount FROM projects AS prj WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.level = prj.level );
{ "outer_table": "projects", "inner_table": "managers", "outer_alias": "prj", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04887
train
v2
Schema: customers (alias: cust)(name, id, salary, date) regions(status, code, salary, amount) Task: Find salary from customers where a matching record exists in regions with the same code. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = cust.code );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "salary", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04888
train
v2
Schema: accounts (alias: acct)(type, level, code, amount) employees(status, id, name, code) Task: Retrieve amount from accounts that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = acct.type );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "amount", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04889
train
v2
Schema: schedules (alias: schd)(type, salary, status, code) sales(status, date, id, code) Task: Find salary from schedules where a matching record exists in sales with the same id. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = schd.id );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "salary", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04890
train
v1
Schema: branches (alias: brc)(id, amount, name, date) orders(level, salary, name, amount) Task: Select code from branches where level exists in orders for the same status. SQL:
SELECT code FROM branches AS brc WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.status = brc.status );
{ "outer_table": "branches", "inner_table": "orders", "outer_alias": "brc", "inner_alias": "ord", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04891
train
v3
Schema: managers (alias: mgr)(id, value, level, salary) customers(amount, name, date, type) Task: Retrieve amount from managers with amount above the COUNT(salary) of customers rows sharing the same code. SQL:
SELECT amount FROM managers AS mgr WHERE amount > ( SELECT COUNT(salary) FROM customers AS cust WHERE cust.code = mgr.code );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04892
train
v3
Schema: invoices (alias: inv)(date, type, name, status) accounts(date, salary, status, level) Task: Retrieve amount from invoices with value above the MAX(salary) of accounts rows sharing the same type. SQL:
SELECT amount FROM invoices AS inv WHERE value > ( SELECT MAX(salary) FROM accounts AS acct WHERE acct.type = inv.type );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04893
train
v1
Schema: products (alias: prod)(code, amount, value, type) schedules(amount, status, date, code) Task: Retrieve name from products whose level is found in schedules rows where status matches the outer record. SQL:
SELECT name FROM products AS prod WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.status = prod.status );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04894
train
v2
Schema: accounts (alias: acct)(salary, amount, level, type) customers(id, name, code, date) Task: Find amount from accounts where a matching record exists in customers with the same type. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = acct.type );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "amount", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04895
train
v3
Schema: regions (alias: rgn)(id, name, type, date) accounts(level, id, status, salary) Task: Find value from regions where salary exceeds the count of salary from accounts for the same status. SQL:
SELECT value FROM regions AS rgn WHERE salary > ( SELECT COUNT(salary) FROM accounts AS acct WHERE acct.status = rgn.status );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04896
train
v3
Schema: regions (alias: rgn)(salary, value, date, level) customers(id, value, status, salary) Task: Find salary from regions where amount exceeds the maximum value from customers for the same type. SQL:
SELECT salary FROM regions AS rgn WHERE amount > ( SELECT MAX(value) FROM customers AS cust WHERE cust.type = rgn.type );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04897
train
v3
Schema: products (alias: prod)(date, amount, id, level) staff(salary, date, id, level) Task: Retrieve value from products with salary above the COUNT(amount) of staff rows sharing the same level. SQL:
SELECT value FROM products AS prod WHERE salary > ( SELECT COUNT(amount) FROM staff AS empl WHERE empl.level = prod.level );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04898
train
v2
Schema: requests (alias: ordr)(id, name, date, salary) items(status, level, salary, id) Task: Find value from requests where a matching record exists in items with the same id. SQL:
SELECT value 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": "value", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04899
train