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
v1
Schema: projects (alias: prj)(date, code, type, status) requests(salary, type, level, date) Task: Select salary from projects where code exists in requests for the same type. SQL:
SELECT salary FROM projects AS prj WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.type = prj.type );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18300
train
v1
Schema: sales (alias: sale)(amount, code, salary, id) shipments(salary, id, value, name) Task: Find amount from sales where type appears in shipments entries with matching level. SQL:
SELECT amount FROM sales AS sale WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.level = sale.level );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18301
train
v2
Schema: categories (alias: catg)(type, id, level, code) branches(status, level, type, name) Task: Find name from categories where a matching record exists in branches with the same status. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = catg.status );
{ "outer_table": "categories", "inner_table": "branches", "outer_alias": "catg", "inner_alias": "brc", "proj_col": "name", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18302
train
v3
Schema: sales (alias: sale)(amount, salary, date, name) shipments(code, value, name, level) Task: Retrieve code from sales with amount above the COUNT(salary) of shipments rows sharing the same type. SQL:
SELECT code FROM sales AS sale WHERE amount > ( SELECT COUNT(salary) FROM shipments AS shp WHERE shp.type = sale.type );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18303
train
v1
Schema: categories (alias: catg)(status, level, salary, code) requests(level, name, date, salary) Task: Retrieve id from categories whose code is found in requests rows where status matches the outer record. SQL:
SELECT id FROM categories AS catg WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.status = catg.status );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18304
train
v1
Schema: products (alias: prod)(salary, id, code, name) accounts(amount, value, code, salary) Task: Retrieve amount from products whose id is found in accounts rows where id matches the outer record. SQL:
SELECT amount FROM products AS prod WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.id = prod.id );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18305
train
v1
Schema: orders (alias: ord)(amount, status, salary, name) requests(status, level, amount, id) Task: Select name from orders where id exists in requests for the same level. SQL:
SELECT name FROM orders AS ord WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.level = ord.level );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18306
train
v3
Schema: staff (alias: empl)(value, salary, level, date) projects(amount, value, level, date) Task: Find salary from staff where value exceeds the count of amount from projects for the same type. SQL:
SELECT salary FROM staff AS empl WHERE value > ( SELECT COUNT(amount) FROM projects AS prj WHERE prj.type = empl.type );
{ "outer_table": "staff", "inner_table": "projects", "outer_alias": "empl", "inner_alias": "prj", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18307
train
v3
Schema: managers (alias: mgr)(code, type, amount, status) staff(value, name, salary, type) Task: Find code from managers where value exceeds the total amount from staff for the same id. SQL:
SELECT code FROM managers AS mgr WHERE value > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.id = mgr.id );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18308
train
v3
Schema: shipments (alias: shp)(level, amount, value, status) requests(status, id, type, amount) Task: Find value from shipments where value exceeds the minimum value from requests for the same type. SQL:
SELECT value FROM shipments AS shp WHERE value > ( SELECT MIN(value) FROM requests AS ordr WHERE ordr.type = shp.type );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18309
train
v1
Schema: managers (alias: mgr)(name, code, level, amount) staff(date, amount, type, status) Task: Retrieve salary from managers whose code is found in staff rows where level matches the outer record. SQL:
SELECT salary FROM managers AS mgr WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.level = mgr.level );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18310
train
v3
Schema: items (alias: lne)(amount, status, level, date) invoices(level, name, type, code) Task: Find amount from items where value exceeds the total value from invoices for the same level. SQL:
SELECT amount FROM items AS lne WHERE value > ( SELECT SUM(value) FROM invoices AS inv WHERE inv.level = lne.level );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18311
train
v3
Schema: schedules (alias: schd)(salary, id, name, status) products(date, type, value, level) Task: Find salary from schedules where salary exceeds the count of value from products for the same status. SQL:
SELECT salary FROM schedules AS schd WHERE salary > ( SELECT COUNT(value) FROM products AS prod WHERE prod.status = schd.status );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18312
train
v2
Schema: employees (alias: emp)(date, amount, type, salary) orders(amount, name, level, date) Task: Find value from employees where a matching record exists in orders with the same level. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = emp.level );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "value", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18313
train
v3
Schema: schedules (alias: schd)(id, value, level, name) shipments(salary, type, name, value) Task: Retrieve code from schedules with salary above the SUM(amount) of shipments rows sharing the same level. SQL:
SELECT code FROM schedules AS schd WHERE salary > ( SELECT SUM(amount) FROM shipments AS shp WHERE shp.level = schd.level );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18314
train
v2
Schema: tasks (alias: tsk)(name, id, level, amount) employees(id, level, type, value) Task: Find amount from tasks where a matching record exists in employees with the same code. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "amount", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18315
train
v2
Schema: products (alias: prod)(value, type, amount, name) departments(amount, date, code, status) Task: Retrieve id from products that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = prod.status );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18316
train
v1
Schema: accounts (alias: acct)(date, value, status, level) branches(date, code, level, id) Task: Retrieve salary from accounts whose code is found in branches rows where status matches the outer record. SQL:
SELECT salary FROM accounts AS acct WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.status = acct.status );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18317
train
v3
Schema: employees (alias: emp)(level, type, name, code) schedules(value, type, id, status) Task: Retrieve id from employees with amount above the MAX(value) of schedules rows sharing the same level. SQL:
SELECT id FROM employees AS emp WHERE amount > ( SELECT MAX(value) FROM schedules AS schd WHERE schd.level = emp.level );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18318
train
v1
Schema: orders (alias: ord)(salary, type, amount, code) categories(code, id, status, type) Task: Select value from orders where type exists in categories for the same type. SQL:
SELECT value FROM orders AS ord WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.type = ord.type );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18319
train
v2
Schema: requests (alias: ordr)(type, level, status, date) departments(value, code, level, date) Task: Retrieve name from requests that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = ordr.status );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "name", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18320
train
v3
Schema: projects (alias: prj)(code, amount, date, name) products(salary, date, name, status) Task: Retrieve value from projects with salary above the AVG(value) of products rows sharing the same level. SQL:
SELECT value FROM projects AS prj WHERE salary > ( SELECT AVG(value) FROM products AS prod WHERE prod.level = prj.level );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "prj", "inner_alias": "prod", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18321
train
v3
Schema: sales (alias: sale)(amount, salary, value, name) invoices(code, name, level, salary) Task: Retrieve salary from sales with value above the AVG(amount) of invoices rows sharing the same id. SQL:
SELECT salary FROM sales AS sale WHERE value > ( SELECT AVG(amount) FROM invoices AS inv WHERE inv.id = sale.id );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18322
train
v2
Schema: orders (alias: ord)(type, status, code, date) sales(id, type, status, date) Task: Find value from orders where a matching record exists in sales with the same id. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = ord.id );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "value", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18323
train
v3
Schema: schedules (alias: schd)(name, status, value, code) items(level, code, date, salary) Task: Find value from schedules where value exceeds the count of value from items for the same code. SQL:
SELECT value FROM schedules AS schd WHERE value > ( SELECT COUNT(value) FROM items AS lne WHERE lne.code = schd.code );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18324
train
v1
Schema: sales (alias: sale)(type, code, value, id) invoices(amount, value, code, date) Task: Retrieve amount from sales whose type is found in invoices rows where type matches the outer record. SQL:
SELECT amount FROM sales AS sale WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.type = sale.type );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18325
train
v3
Schema: customers (alias: cust)(value, amount, date, salary) accounts(status, id, type, code) Task: Find value from customers where value exceeds the average amount from accounts for the same status. SQL:
SELECT value FROM customers AS cust WHERE value > ( SELECT AVG(amount) FROM accounts AS acct WHERE acct.status = cust.status );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18326
train
v3
Schema: invoices (alias: inv)(code, salary, name, value) regions(salary, code, id, status) Task: Find code from invoices where amount exceeds the minimum salary from regions for the same id. SQL:
SELECT code FROM invoices AS inv WHERE amount > ( SELECT MIN(salary) FROM regions AS rgn WHERE rgn.id = inv.id );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18327
train
v1
Schema: staff (alias: empl)(type, code, name, amount) schedules(code, status, name, value) Task: Select amount from staff where code exists in schedules for the same code. SQL:
SELECT amount FROM staff AS empl WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.code = empl.code );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18328
train
v1
Schema: categories (alias: catg)(salary, amount, level, code) accounts(salary, date, value, name) Task: Select name from categories where id exists in accounts for the same id. SQL:
SELECT name FROM categories AS catg WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.id = catg.id );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18329
train
v2
Schema: regions (alias: rgn)(amount, value, status, code) managers(name, code, amount, id) Task: Retrieve name from regions that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = rgn.id );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "name", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18330
train
v3
Schema: categories (alias: catg)(salary, amount, level, code) items(id, code, salary, date) Task: Find code from categories where salary exceeds the average amount from items for the same id. SQL:
SELECT code FROM categories AS catg WHERE salary > ( SELECT AVG(amount) FROM items AS lne WHERE lne.id = catg.id );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18331
train
v2
Schema: customers (alias: cust)(level, value, code, amount) shipments(status, level, type, date) Task: Find value from customers where a matching record exists in shipments with the same level. SQL:
SELECT value 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": "value", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18332
train
v3
Schema: invoices (alias: inv)(status, salary, date, level) categories(code, name, salary, type) Task: Retrieve amount from invoices with amount above the COUNT(amount) of categories rows sharing the same type. SQL:
SELECT amount FROM invoices AS inv WHERE amount > ( SELECT COUNT(amount) FROM categories AS catg WHERE catg.type = inv.type );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18333
train
v1
Schema: projects (alias: prj)(status, amount, code, type) requests(salary, date, code, status) Task: Find id from projects where type appears in requests entries with matching code. SQL:
SELECT id FROM projects AS prj WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.code = prj.code );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18334
train
v3
Schema: staff (alias: empl)(salary, type, amount, value) branches(salary, amount, id, level) Task: Find code from staff where salary exceeds the count of salary from branches for the same id. SQL:
SELECT code FROM staff AS empl WHERE salary > ( SELECT COUNT(salary) FROM branches AS brc WHERE brc.id = empl.id );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18335
train
v2
Schema: schedules (alias: schd)(type, code, status, value) shipments(amount, name, code, status) Task: Retrieve name from schedules that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = schd.status );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "name", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18336
train
v1
Schema: employees (alias: emp)(id, amount, date, salary) projects(id, amount, value, status) Task: Retrieve id from employees whose id is found in projects rows where id matches the outer record. SQL:
SELECT id FROM employees AS emp WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.id = emp.id );
{ "outer_table": "employees", "inner_table": "projects", "outer_alias": "emp", "inner_alias": "prj", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18337
train
v2
Schema: categories (alias: catg)(date, level, id, name) schedules(value, salary, status, date) Task: Find amount from categories where a matching record exists in schedules with the same status. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = catg.status );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "amount", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18338
train
v3
Schema: items (alias: lne)(amount, value, status, id) requests(date, value, amount, id) Task: Find amount from items where amount exceeds the minimum value from requests for the same status. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT MIN(value) FROM requests AS ordr WHERE ordr.status = lne.status );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18339
train
v3
Schema: managers (alias: mgr)(amount, type, date, level) schedules(status, amount, salary, name) Task: Find salary from managers where value exceeds the total salary from schedules for the same type. SQL:
SELECT salary FROM managers AS mgr WHERE value > ( SELECT SUM(salary) FROM schedules AS schd WHERE schd.type = mgr.type );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18340
train
v1
Schema: branches (alias: brc)(salary, level, amount, type) sales(amount, type, id, salary) Task: Find amount from branches where id appears in sales entries with matching type. SQL:
SELECT amount FROM branches AS brc WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.type = brc.type );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18341
train
v2
Schema: accounts (alias: acct)(amount, name, date, value) schedules(date, status, salary, level) Task: Retrieve id from accounts that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = acct.code );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "id", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18342
train
v3
Schema: tasks (alias: tsk)(code, type, level, status) items(name, amount, value, status) Task: Retrieve name from tasks with amount above the AVG(value) of items rows sharing the same id. SQL:
SELECT name FROM tasks AS tsk WHERE amount > ( SELECT AVG(value) FROM items AS lne WHERE lne.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18343
train
v1
Schema: managers (alias: mgr)(code, salary, value, amount) schedules(type, id, level, code) Task: Find code from managers where status appears in schedules entries with matching id. SQL:
SELECT code FROM managers AS mgr WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.id = mgr.id );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18344
train
v2
Schema: staff (alias: empl)(name, type, level, status) managers(amount, type, status, code) Task: Retrieve code from staff that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT code 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": "code", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18345
train
v1
Schema: invoices (alias: inv)(level, date, id, name) products(status, salary, id, type) Task: Find code from invoices where type appears in products entries with matching code. SQL:
SELECT code FROM invoices AS inv WHERE type IN ( SELECT type FROM products AS prod WHERE prod.code = inv.code );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18346
train
v3
Schema: schedules (alias: schd)(level, amount, value, id) regions(level, amount, name, type) Task: Find amount from schedules where value exceeds the minimum salary from regions for the same type. SQL:
SELECT amount FROM schedules AS schd WHERE value > ( SELECT MIN(salary) FROM regions AS rgn WHERE rgn.type = schd.type );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18347
train
v3
Schema: items (alias: lne)(type, id, value, date) employees(salary, name, status, id) Task: Retrieve salary from items with salary above the AVG(amount) of employees rows sharing the same code. SQL:
SELECT salary FROM items AS lne WHERE salary > ( SELECT AVG(amount) FROM employees AS emp WHERE emp.code = lne.code );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18348
train
v3
Schema: sales (alias: sale)(status, amount, level, code) customers(salary, date, type, level) Task: Retrieve code from sales with amount above the MIN(amount) of customers rows sharing the same status. SQL:
SELECT code FROM sales AS sale WHERE amount > ( SELECT MIN(amount) FROM customers AS cust WHERE cust.status = sale.status );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18349
train
v3
Schema: requests (alias: ordr)(level, salary, date, name) accounts(id, amount, name, date) Task: Find value from requests where salary exceeds the maximum salary from accounts for the same status. SQL:
SELECT value FROM requests AS ordr WHERE salary > ( SELECT MAX(salary) FROM accounts AS acct WHERE acct.status = ordr.status );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18350
train
v1
Schema: projects (alias: prj)(status, date, name, level) schedules(status, name, level, type) Task: Retrieve salary from projects whose id is found in schedules rows where type matches the outer record. SQL:
SELECT salary FROM projects AS prj WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.type = prj.type );
{ "outer_table": "projects", "inner_table": "schedules", "outer_alias": "prj", "inner_alias": "schd", "proj_col": "salary", "filter_col": "id", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18351
train
v1
Schema: branches (alias: brc)(date, type, salary, name) accounts(salary, type, id, status) Task: Find value from branches where status appears in accounts entries with matching code. SQL:
SELECT value FROM branches AS brc WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.code = brc.code );
{ "outer_table": "branches", "inner_table": "accounts", "outer_alias": "brc", "inner_alias": "acct", "proj_col": "value", "filter_col": "status", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18352
train
v2
Schema: products (alias: prod)(level, type, value, status) accounts(date, amount, salary, type) Task: Find name from products where a matching record exists in accounts with the same id. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = prod.id );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "name", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18353
train
v2
Schema: managers (alias: mgr)(date, salary, name, code) categories(id, name, salary, date) Task: Find amount from managers where a matching record exists in categories with the same code. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = mgr.code );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "amount", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18354
train
v3
Schema: tasks (alias: tsk)(value, status, date, salary) departments(date, name, code, value) Task: Retrieve name from tasks with amount above the MAX(amount) of departments rows sharing the same level. SQL:
SELECT name FROM tasks AS tsk WHERE amount > ( SELECT MAX(amount) FROM departments AS dept WHERE dept.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "tsk", "inner_alias": "dept", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18355
train
v2
Schema: branches (alias: brc)(status, salary, id, date) shipments(salary, name, status, amount) Task: Retrieve code from branches that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = brc.code );
{ "outer_table": "branches", "inner_table": "shipments", "outer_alias": "brc", "inner_alias": "shp", "proj_col": "code", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18356
train
v3
Schema: items (alias: lne)(date, salary, code, level) categories(date, code, id, name) Task: Find id from items where salary exceeds the total value from categories for the same id. SQL:
SELECT id FROM items AS lne WHERE salary > ( SELECT SUM(value) FROM categories AS catg WHERE catg.id = lne.id );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18357
train
v3
Schema: branches (alias: brc)(date, code, salary, amount) orders(type, code, date, name) Task: Retrieve amount from branches with salary above the SUM(amount) of orders rows sharing the same type. SQL:
SELECT amount FROM branches AS brc WHERE salary > ( SELECT SUM(amount) FROM orders AS ord WHERE ord.type = brc.type );
{ "outer_table": "branches", "inner_table": "orders", "outer_alias": "brc", "inner_alias": "ord", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18358
train
v1
Schema: requests (alias: ordr)(name, level, code, type) branches(name, status, salary, level) Task: Retrieve id from requests whose id is found in branches rows where id matches the outer record. SQL:
SELECT id FROM requests AS ordr WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.id = ordr.id );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18359
train
v1
Schema: managers (alias: mgr)(amount, status, salary, code) categories(id, salary, value, level) Task: Select id from managers where status exists in categories for the same level. SQL:
SELECT id FROM managers AS mgr WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.level = mgr.level );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18360
train
v3
Schema: requests (alias: ordr)(code, salary, status, id) categories(amount, code, type, salary) Task: Retrieve value from requests with value above the COUNT(amount) of categories rows sharing the same status. SQL:
SELECT value FROM requests AS ordr WHERE value > ( SELECT COUNT(amount) FROM categories AS catg WHERE catg.status = ordr.status );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18361
train
v3
Schema: projects (alias: prj)(level, value, salary, name) items(salary, id, code, level) Task: Find salary from projects where value exceeds the total salary from items for the same type. SQL:
SELECT salary FROM projects AS prj WHERE value > ( SELECT SUM(salary) FROM items AS lne WHERE lne.type = prj.type );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18362
train
v1
Schema: customers (alias: cust)(level, id, date, value) requests(name, id, date, type) Task: Select amount from customers where type exists in requests for the same id. SQL:
SELECT amount FROM customers AS cust WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.id = cust.id );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18363
train
v2
Schema: sales (alias: sale)(id, date, type, salary) branches(amount, date, type, name) Task: Find amount from sales where a matching record exists in branches with the same type. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = sale.type );
{ "outer_table": "sales", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "brc", "proj_col": "amount", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18364
train
v1
Schema: staff (alias: empl)(type, level, code, name) requests(date, id, code, salary) Task: Select amount from staff where type exists in requests for the same status. SQL:
SELECT amount FROM staff AS empl WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.status = empl.status );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18365
train
v3
Schema: categories (alias: catg)(code, date, type, amount) staff(name, amount, status, level) Task: Retrieve amount from categories with amount above the SUM(value) of staff rows sharing the same level. SQL:
SELECT amount FROM categories AS catg WHERE amount > ( SELECT SUM(value) FROM staff AS empl WHERE empl.level = catg.level );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18366
train
v1
Schema: requests (alias: ordr)(level, value, name, amount) categories(level, type, amount, name) Task: Retrieve amount from requests whose level is found in categories rows where status matches the outer record. SQL:
SELECT amount FROM requests AS ordr WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.status = ordr.status );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18367
train
v3
Schema: products (alias: prod)(level, value, code, date) customers(type, name, level, salary) Task: Find code from products where salary exceeds the minimum salary from customers for the same status. SQL:
SELECT code FROM products AS prod WHERE salary > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.status = prod.status );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18368
train
v2
Schema: invoices (alias: inv)(status, amount, salary, name) requests(type, id, status, code) Task: Find id from invoices where a matching record exists in requests with the same status. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = inv.status );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "id", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18369
train
v1
Schema: sales (alias: sale)(level, id, salary, amount) items(name, type, salary, level) Task: Select value from sales where type exists in items for the same level. SQL:
SELECT value FROM sales AS sale WHERE type IN ( SELECT type FROM items AS lne WHERE lne.level = sale.level );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18370
train
v3
Schema: employees (alias: emp)(level, value, amount, code) orders(code, name, type, level) Task: Find code from employees where value exceeds the average value from orders for the same status. SQL:
SELECT code FROM employees AS emp WHERE value > ( SELECT AVG(value) FROM orders AS ord WHERE ord.status = emp.status );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18371
train
v3
Schema: shipments (alias: shp)(salary, code, level, value) accounts(code, name, amount, value) Task: Retrieve id from shipments with amount above the MAX(salary) of accounts rows sharing the same code. SQL:
SELECT id FROM shipments AS shp WHERE amount > ( SELECT MAX(salary) FROM accounts AS acct WHERE acct.code = shp.code );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18372
train
v1
Schema: managers (alias: mgr)(amount, salary, id, level) orders(amount, code, name, type) Task: Find salary from managers where code appears in orders entries with matching status. SQL:
SELECT salary FROM managers AS mgr WHERE code IN ( SELECT code 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": "code", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18373
train
v3
Schema: employees (alias: emp)(date, type, amount, value) invoices(id, value, level, name) Task: Retrieve name from employees with salary above the COUNT(amount) of invoices rows sharing the same status. SQL:
SELECT name FROM employees AS emp WHERE salary > ( SELECT COUNT(amount) FROM invoices AS inv WHERE inv.status = emp.status );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18374
train
v2
Schema: accounts (alias: acct)(type, code, name, salary) shipments(status, code, level, amount) Task: Find amount from accounts where a matching record exists in shipments with the same id. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = acct.id );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "amount", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18375
train
v1
Schema: shipments (alias: shp)(amount, level, date, id) requests(date, status, code, amount) Task: Find name from shipments where status appears in requests entries with matching status. SQL:
SELECT name FROM shipments AS shp WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.status = shp.status );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18376
train
v3
Schema: projects (alias: prj)(status, name, salary, id) orders(salary, name, status, level) Task: Retrieve id from projects with amount above the COUNT(salary) of orders rows sharing the same level. SQL:
SELECT id FROM projects AS prj WHERE amount > ( SELECT COUNT(salary) FROM orders AS ord WHERE ord.level = prj.level );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "ord", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18377
train
v2
Schema: invoices (alias: inv)(type, date, name, status) managers(type, amount, value, date) Task: Retrieve value from invoices that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = inv.status );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "value", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18378
train
v3
Schema: transactions (alias: txn)(code, level, id, value) requests(id, status, amount, type) Task: Retrieve code from transactions with salary above the MAX(salary) of requests rows sharing the same status. SQL:
SELECT code FROM transactions AS txn WHERE salary > ( SELECT MAX(salary) FROM requests AS ordr WHERE ordr.status = txn.status );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18379
train
v3
Schema: projects (alias: prj)(amount, name, level, date) invoices(status, amount, date, salary) Task: Retrieve salary from projects with value above the COUNT(value) of invoices rows sharing the same status. SQL:
SELECT salary FROM projects AS prj WHERE value > ( SELECT COUNT(value) FROM invoices AS inv WHERE inv.status = prj.status );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "prj", "inner_alias": "inv", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18380
train
v3
Schema: requests (alias: ordr)(salary, level, value, amount) transactions(value, status, date, id) Task: Find amount from requests where amount exceeds the count of value from transactions for the same status. SQL:
SELECT amount FROM requests AS ordr WHERE amount > ( SELECT COUNT(value) FROM transactions AS txn WHERE txn.status = ordr.status );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18381
train
v2
Schema: schedules (alias: schd)(id, date, level, salary) regions(code, salary, name, level) Task: Find id from schedules where a matching record exists in regions with the same type. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = schd.type );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "id", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18382
train
v1
Schema: categories (alias: catg)(status, type, name, amount) requests(amount, value, name, date) Task: Select code from categories where code exists in requests for the same code. SQL:
SELECT code FROM categories AS catg WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.code = catg.code );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18383
train
v1
Schema: sales (alias: sale)(amount, type, code, level) shipments(salary, type, level, id) Task: Retrieve amount from sales whose id is found in shipments rows where type matches the outer record. SQL:
SELECT amount FROM sales AS sale WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.type = sale.type );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18384
train
v3
Schema: items (alias: lne)(id, type, status, amount) employees(date, type, value, amount) Task: Find salary from items where amount exceeds the count of amount from employees for the same status. SQL:
SELECT salary FROM items AS lne WHERE amount > ( SELECT COUNT(amount) FROM employees AS emp WHERE emp.status = lne.status );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18385
train
v2
Schema: tasks (alias: tsk)(level, type, value, date) orders(level, amount, type, value) Task: Retrieve id from tasks that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "id", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18386
train
v3
Schema: staff (alias: empl)(name, level, amount, id) orders(date, id, amount, name) Task: Find amount from staff where salary exceeds the total value from orders for the same level. SQL:
SELECT amount FROM staff AS empl WHERE salary > ( SELECT SUM(value) FROM orders AS ord WHERE ord.level = empl.level );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18387
train
v1
Schema: orders (alias: ord)(code, value, amount, id) invoices(value, amount, code, salary) Task: Retrieve salary from orders whose code is found in invoices rows where level matches the outer record. SQL:
SELECT salary FROM orders AS ord WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.level = ord.level );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18388
train
v3
Schema: projects (alias: prj)(value, amount, status, code) departments(status, amount, code, date) Task: Retrieve amount from projects with amount above the MAX(amount) of departments rows sharing the same code. SQL:
SELECT amount FROM projects AS prj WHERE amount > ( SELECT MAX(amount) FROM departments AS dept WHERE dept.code = prj.code );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18389
train
v3
Schema: sales (alias: sale)(status, value, salary, id) managers(date, value, salary, amount) Task: Retrieve value from sales with salary above the SUM(amount) of managers rows sharing the same code. SQL:
SELECT value FROM sales AS sale WHERE salary > ( SELECT SUM(amount) FROM managers AS mgr WHERE mgr.code = sale.code );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18390
train
v2
Schema: tasks (alias: tsk)(level, date, salary, status) managers(code, value, amount, level) Task: Find value from tasks where a matching record exists in managers with the same status. SQL:
SELECT value FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "value", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18391
train
v2
Schema: products (alias: prod)(value, salary, id, type) items(amount, type, value, salary) Task: Retrieve id from products that have at least one corresponding entry in items sharing the same level. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = prod.level );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "id", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18392
train
v1
Schema: transactions (alias: txn)(level, name, type, value) schedules(status, amount, name, date) Task: Select amount from transactions where code exists in schedules for the same code. SQL:
SELECT amount FROM transactions AS txn WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.code = txn.code );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18393
train
v3
Schema: shipments (alias: shp)(amount, level, type, name) sales(amount, salary, code, level) Task: Find id from shipments where salary exceeds the average value from sales for the same id. SQL:
SELECT id FROM shipments AS shp WHERE salary > ( SELECT AVG(value) FROM sales AS sale WHERE sale.id = shp.id );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18394
train
v3
Schema: orders (alias: ord)(id, code, name, salary) invoices(code, type, salary, name) Task: Find code from orders where amount exceeds the average amount from invoices for the same status. SQL:
SELECT code FROM orders AS ord WHERE amount > ( SELECT AVG(amount) FROM invoices AS inv WHERE inv.status = ord.status );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18395
train
v1
Schema: sales (alias: sale)(status, type, date, amount) transactions(amount, salary, level, type) Task: Find name from sales where code appears in transactions entries with matching id. SQL:
SELECT name FROM sales AS sale WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.id = sale.id );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18396
train
v1
Schema: products (alias: prod)(type, value, salary, amount) managers(amount, name, level, salary) Task: Retrieve salary from products whose id is found in managers rows where id matches the outer record. SQL:
SELECT salary FROM products AS prod WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.id = prod.id );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18397
train
v3
Schema: departments (alias: dept)(id, type, salary, level) shipments(type, code, level, id) Task: Find code from departments where amount exceeds the minimum salary from shipments for the same id. SQL:
SELECT code FROM departments AS dept WHERE amount > ( SELECT MIN(salary) FROM shipments AS shp WHERE shp.id = dept.id );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18398
train
v2
Schema: schedules (alias: schd)(value, amount, status, code) items(type, date, code, name) Task: Retrieve id from schedules that have at least one corresponding entry in items sharing the same status. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = schd.status );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "id", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18399
train