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: accounts (alias: acct)(value, salary, status, date) invoices(name, salary, id, level) Task: Find name from accounts where code appears in invoices entries with matching type. SQL:
SELECT name FROM accounts AS acct WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.type = acct.type );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "name", "filter_col": "code", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13300
train
v3
Schema: staff (alias: empl)(status, id, value, code) customers(code, value, level, name) Task: Find salary from staff where value exceeds the maximum salary from customers for the same level. SQL:
SELECT salary FROM staff AS empl WHERE value > ( SELECT MAX(salary) FROM customers AS cust WHERE cust.level = empl.level );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_13301
train
v3
Schema: requests (alias: ordr)(name, date, level, value) transactions(salary, id, status, type) Task: Find name from requests where amount exceeds the count of salary from transactions for the same id. SQL:
SELECT name FROM requests AS ordr WHERE amount > ( SELECT COUNT(salary) FROM transactions AS txn WHERE txn.id = ordr.id );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_13302
train
v3
Schema: invoices (alias: inv)(status, value, id, level) projects(value, salary, code, level) Task: Retrieve code from invoices with value above the AVG(value) of projects rows sharing the same level. SQL:
SELECT code FROM invoices AS inv WHERE value > ( SELECT AVG(value) FROM projects AS prj WHERE prj.level = inv.level );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13303
train
v3
Schema: customers (alias: cust)(status, id, code, date) managers(id, code, name, date) Task: Find value from customers where value exceeds the total amount from managers for the same status. SQL:
SELECT value FROM customers AS cust WHERE value > ( SELECT SUM(amount) FROM managers AS mgr WHERE mgr.status = cust.status );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13304
train
v3
Schema: requests (alias: ordr)(value, amount, name, type) departments(value, amount, salary, status) Task: Retrieve code from requests with amount above the AVG(salary) of departments rows sharing the same code. SQL:
SELECT code FROM requests AS ordr WHERE amount > ( SELECT AVG(salary) FROM departments AS dept WHERE dept.code = ordr.code );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_13305
train
v2
Schema: managers (alias: mgr)(amount, level, status, type) regions(date, value, type, level) Task: Find id from managers where a matching record exists in regions with the same status. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "id", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13306
train
v2
Schema: schedules (alias: schd)(id, level, salary, amount) tasks(code, level, date, name) Task: Retrieve name from schedules that have at least one corresponding entry in tasks sharing the same status. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = schd.status );
{ "outer_table": "schedules", "inner_table": "tasks", "outer_alias": "schd", "inner_alias": "tsk", "proj_col": "name", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13307
train
v3
Schema: regions (alias: rgn)(status, code, date, name) schedules(date, name, amount, salary) Task: Find id from regions where salary exceeds the maximum value from schedules for the same level. SQL:
SELECT id FROM regions AS rgn WHERE salary > ( SELECT MAX(value) FROM schedules AS schd WHERE schd.level = rgn.level );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_13308
train
v1
Schema: projects (alias: prj)(status, level, name, code) transactions(date, code, amount, salary) Task: Find id from projects where level appears in transactions entries with matching type. SQL:
SELECT id FROM projects AS prj WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.type = prj.type );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_13309
train
v3
Schema: regions (alias: rgn)(code, amount, date, type) branches(id, name, level, value) Task: Retrieve value from regions with salary above the AVG(salary) of branches rows sharing the same type. SQL:
SELECT value FROM regions AS rgn WHERE salary > ( SELECT AVG(salary) FROM branches AS brc WHERE brc.type = rgn.type );
{ "outer_table": "regions", "inner_table": "branches", "outer_alias": "rgn", "inner_alias": "brc", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_13310
train
v1
Schema: orders (alias: ord)(amount, salary, level, name) departments(type, salary, amount, code) Task: Select name from orders where status exists in departments for the same id. SQL:
SELECT name FROM orders AS ord WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.id = ord.id );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13311
train
v1
Schema: requests (alias: ordr)(date, name, level, amount) staff(type, level, salary, date) Task: Find code from requests where code appears in staff entries with matching code. SQL:
SELECT code FROM requests AS ordr WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.code = ordr.code );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_13312
train
v2
Schema: categories (alias: catg)(amount, code, status, salary) items(level, name, type, id) Task: Find value from categories where a matching record exists in items with the same status. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = catg.status );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "value", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13313
train
v2
Schema: regions (alias: rgn)(name, amount, date, code) accounts(code, amount, value, date) Task: Find id from regions where a matching record exists in accounts with the same code. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = rgn.code );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_13314
train
v1
Schema: transactions (alias: txn)(value, amount, code, level) branches(name, type, code, amount) Task: Find code from transactions where id appears in branches entries with matching id. SQL:
SELECT code FROM transactions AS txn WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.id = txn.id );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13315
train
v2
Schema: employees (alias: emp)(salary, name, value, code) regions(date, code, salary, value) Task: Find id from employees where a matching record exists in regions with the same status. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = emp.status );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13316
train
v3
Schema: shipments (alias: shp)(amount, salary, code, date) regions(level, status, type, date) Task: Find value from shipments where salary exceeds the total amount from regions for the same type. SQL:
SELECT value FROM shipments AS shp WHERE salary > ( SELECT SUM(amount) FROM regions AS rgn WHERE rgn.type = shp.type );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_13317
train
v3
Schema: transactions (alias: txn)(salary, level, value, status) customers(code, name, level, value) Task: Retrieve value from transactions with value above the MAX(value) of customers rows sharing the same code. SQL:
SELECT value FROM transactions AS txn WHERE value > ( SELECT MAX(value) FROM customers AS cust WHERE cust.code = txn.code );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13318
train
v3
Schema: shipments (alias: shp)(type, salary, amount, date) orders(value, status, type, salary) Task: Retrieve code from shipments with amount above the COUNT(salary) of orders rows sharing the same level. SQL:
SELECT code FROM shipments AS shp WHERE amount > ( SELECT COUNT(salary) FROM orders AS ord WHERE ord.level = shp.level );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_13319
train
v3
Schema: departments (alias: dept)(name, date, salary, status) categories(amount, code, status, salary) Task: Find salary from departments where amount exceeds the maximum amount from categories for the same level. SQL:
SELECT salary FROM departments AS dept WHERE amount > ( SELECT MAX(amount) FROM categories AS catg WHERE catg.level = dept.level );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13320
train
v3
Schema: accounts (alias: acct)(type, name, amount, status) schedules(salary, type, status, date) Task: Retrieve amount from accounts with value above the SUM(amount) of schedules rows sharing the same type. SQL:
SELECT amount FROM accounts AS acct WHERE value > ( SELECT SUM(amount) FROM schedules AS schd WHERE schd.type = acct.type );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13321
train
v1
Schema: tasks (alias: tsk)(level, code, type, value) invoices(salary, level, value, status) Task: Select value from tasks where type exists in invoices for the same type. SQL:
SELECT value FROM tasks AS tsk WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "invoices", "outer_alias": "tsk", "inner_alias": "inv", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13322
train
v1
Schema: staff (alias: empl)(id, amount, value, level) items(name, status, amount, type) Task: Retrieve salary from staff whose id is found in items rows where level matches the outer record. SQL:
SELECT salary FROM staff AS empl WHERE id IN ( SELECT id FROM items AS lne WHERE lne.level = empl.level );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_13323
train
v1
Schema: customers (alias: cust)(value, type, amount, name) shipments(salary, name, type, code) Task: Retrieve amount from customers whose level is found in shipments rows where type matches the outer record. SQL:
SELECT amount FROM customers AS cust WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.type = cust.type );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13324
train
v3
Schema: requests (alias: ordr)(value, code, date, salary) staff(value, salary, name, date) Task: Retrieve name from requests with salary above the MIN(value) of staff rows sharing the same code. SQL:
SELECT name FROM requests AS ordr WHERE salary > ( SELECT MIN(value) FROM staff AS empl WHERE empl.code = ordr.code );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_13325
train
v2
Schema: departments (alias: dept)(salary, status, level, name) sales(level, amount, value, date) Task: Find code from departments where a matching record exists in sales with the same level. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = dept.level );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13326
train
v2
Schema: schedules (alias: schd)(name, salary, type, date) invoices(salary, level, status, amount) Task: Retrieve code from schedules that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = schd.type );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13327
train
v3
Schema: customers (alias: cust)(salary, amount, date, id) tasks(id, level, status, code) Task: Find id from customers where amount exceeds the maximum amount from tasks for the same type. SQL:
SELECT id FROM customers AS cust WHERE amount > ( SELECT MAX(amount) FROM tasks AS tsk WHERE tsk.type = cust.type );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "cust", "inner_alias": "tsk", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13328
train
v1
Schema: shipments (alias: shp)(value, amount, id, salary) employees(date, code, level, salary) Task: Find amount from shipments where type appears in employees entries with matching type. SQL:
SELECT amount FROM shipments AS shp WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.type = shp.type );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_13329
train
v1
Schema: tasks (alias: tsk)(amount, status, name, date) employees(salary, type, code, value) Task: Select amount from tasks where status exists in employees for the same code. SQL:
SELECT amount FROM tasks AS tsk WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13330
train
v2
Schema: orders (alias: ord)(salary, name, amount, status) employees(id, date, amount, name) Task: Retrieve name from orders that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = ord.status );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "name", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13331
train
v1
Schema: staff (alias: empl)(value, salary, amount, id) items(name, id, value, date) Task: Select salary from staff where id exists in items for the same code. SQL:
SELECT salary FROM staff AS empl WHERE id IN ( SELECT id FROM items AS lne WHERE lne.code = empl.code );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_13332
train
v3
Schema: orders (alias: ord)(level, salary, type, status) departments(id, name, level, type) Task: Retrieve value from orders with value above the MAX(value) of departments rows sharing the same code. SQL:
SELECT value FROM orders AS ord WHERE value > ( SELECT MAX(value) FROM departments AS dept WHERE dept.code = ord.code );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13333
train
v1
Schema: branches (alias: brc)(value, code, date, level) categories(date, salary, name, value) Task: Retrieve name from branches whose id is found in categories rows where level matches the outer record. SQL:
SELECT name FROM branches AS brc WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.level = brc.level );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_13334
train
v2
Schema: products (alias: prod)(code, date, level, name) orders(date, status, salary, id) Task: Find value from products where a matching record exists in orders with the same type. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = prod.type );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "value", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13335
train
v2
Schema: products (alias: prod)(amount, type, status, salary) items(value, status, amount, type) Task: Retrieve amount from products that have at least one corresponding entry in items sharing the same id. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = prod.id );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "amount", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13336
train
v3
Schema: managers (alias: mgr)(level, status, id, code) accounts(salary, level, id, amount) Task: Find value from managers where amount exceeds the total value from accounts for the same code. SQL:
SELECT value FROM managers AS mgr WHERE amount > ( SELECT SUM(value) FROM accounts AS acct WHERE acct.code = mgr.code );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13337
train
v3
Schema: products (alias: prod)(salary, date, status, level) orders(amount, id, name, date) Task: Retrieve salary from products with value above the MAX(value) of orders rows sharing the same status. SQL:
SELECT salary FROM products AS prod WHERE value > ( SELECT MAX(value) FROM orders AS ord WHERE ord.status = prod.status );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13338
train
v3
Schema: transactions (alias: txn)(name, value, code, status) shipments(date, value, name, type) Task: Retrieve id from transactions with amount above the SUM(salary) of shipments rows sharing the same code. SQL:
SELECT id FROM transactions AS txn WHERE amount > ( SELECT SUM(salary) FROM shipments AS shp WHERE shp.code = txn.code );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13339
train
v2
Schema: invoices (alias: inv)(date, code, status, level) categories(id, level, date, status) Task: Find id from invoices where a matching record exists in categories with the same level. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = inv.level );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "id", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13340
train
v1
Schema: invoices (alias: inv)(code, id, value, type) items(status, date, salary, type) Task: Find salary from invoices where type appears in items entries with matching type. SQL:
SELECT salary FROM invoices AS inv WHERE type IN ( SELECT type FROM items AS lne WHERE lne.type = inv.type );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13341
train
v3
Schema: customers (alias: cust)(type, salary, value, status) employees(status, level, code, date) Task: Find id from customers where amount exceeds the total salary from employees for the same id. SQL:
SELECT id FROM customers AS cust WHERE amount > ( SELECT SUM(salary) FROM employees AS emp WHERE emp.id = cust.id );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13342
train
v3
Schema: sales (alias: sale)(level, salary, code, date) schedules(amount, id, salary, code) Task: Retrieve id from sales with amount above the MIN(value) of schedules rows sharing the same level. SQL:
SELECT id FROM sales AS sale WHERE amount > ( SELECT MIN(value) FROM schedules AS schd WHERE schd.level = sale.level );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13343
train
v2
Schema: tasks (alias: tsk)(salary, status, name, id) orders(value, amount, id, status) Task: Retrieve id from tasks that have at least one corresponding entry in orders sharing the same status. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "id", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13344
train
v3
Schema: tasks (alias: tsk)(status, amount, code, name) projects(level, id, amount, type) Task: Retrieve salary from tasks with value above the AVG(value) of projects rows sharing the same level. SQL:
SELECT salary FROM tasks AS tsk WHERE value > ( SELECT AVG(value) FROM projects AS prj WHERE prj.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13345
train
v1
Schema: departments (alias: dept)(id, salary, value, name) categories(date, value, amount, code) Task: Retrieve name from departments whose status is found in categories rows where level matches the outer record. SQL:
SELECT name FROM departments AS dept WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.level = dept.level );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13346
train
v3
Schema: products (alias: prod)(salary, status, level, value) employees(date, salary, code, amount) Task: Find value from products where salary exceeds the minimum value from employees for the same id. SQL:
SELECT value FROM products AS prod WHERE salary > ( SELECT MIN(value) FROM employees AS emp WHERE emp.id = prod.id );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13347
train
v1
Schema: staff (alias: empl)(status, type, id, code) customers(name, level, code, id) Task: Select value from staff where type exists in customers for the same type. SQL:
SELECT value FROM staff AS empl WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.type = empl.type );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_13348
train
v3
Schema: staff (alias: empl)(code, salary, type, date) accounts(id, type, level, name) Task: Retrieve id from staff with value above the MAX(amount) of accounts rows sharing the same level. SQL:
SELECT id FROM staff AS empl WHERE value > ( SELECT MAX(amount) FROM accounts AS acct WHERE acct.level = empl.level );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_13349
train
v3
Schema: transactions (alias: txn)(amount, level, value, type) products(salary, amount, name, status) Task: Retrieve amount from transactions with salary above the COUNT(value) of products rows sharing the same id. SQL:
SELECT amount FROM transactions AS txn WHERE salary > ( SELECT COUNT(value) FROM products AS prod WHERE prod.id = txn.id );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13350
train
v2
Schema: transactions (alias: txn)(amount, status, value, code) branches(level, type, value, code) Task: Retrieve id from transactions that have at least one corresponding entry in branches sharing the same status. SQL:
SELECT id 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": "id", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13351
train
v3
Schema: tasks (alias: tsk)(date, id, value, status) departments(amount, code, status, salary) Task: Find id from tasks where amount exceeds the total value from departments for the same id. SQL:
SELECT id FROM tasks AS tsk WHERE amount > ( SELECT SUM(value) FROM departments AS dept WHERE dept.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "tsk", "inner_alias": "dept", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13352
train
v3
Schema: staff (alias: empl)(status, date, amount, type) categories(date, level, type, status) Task: Retrieve name from staff with amount above the MAX(amount) of categories rows sharing the same id. SQL:
SELECT name FROM staff AS empl WHERE amount > ( SELECT MAX(amount) FROM categories AS catg WHERE catg.id = empl.id );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_13353
train
v3
Schema: categories (alias: catg)(date, level, amount, id) schedules(date, salary, type, amount) Task: Find id from categories where value exceeds the maximum salary from schedules for the same code. SQL:
SELECT id FROM categories AS catg WHERE value > ( SELECT MAX(salary) FROM schedules AS schd WHERE schd.code = catg.code );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13354
train
v3
Schema: projects (alias: prj)(type, date, name, value) orders(amount, code, salary, status) Task: Retrieve id from projects with value above the MAX(salary) of orders rows sharing the same level. SQL:
SELECT id FROM projects AS prj WHERE value > ( SELECT MAX(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": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_13355
train
v2
Schema: customers (alias: cust)(value, amount, salary, id) branches(name, type, id, value) Task: Find amount from customers where a matching record exists in branches with the same level. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = cust.level );
{ "outer_table": "customers", "inner_table": "branches", "outer_alias": "cust", "inner_alias": "brc", "proj_col": "amount", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13356
train
v2
Schema: invoices (alias: inv)(value, date, amount, type) orders(id, type, status, level) Task: Retrieve amount from invoices that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = inv.code );
{ "outer_table": "invoices", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "amount", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13357
train
v2
Schema: departments (alias: dept)(status, name, id, salary) items(value, name, date, type) Task: Retrieve amount from departments that have at least one corresponding entry in items sharing the same type. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = dept.type );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "amount", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13358
train
v2
Schema: regions (alias: rgn)(amount, status, code, level) staff(code, name, value, amount) Task: Retrieve value from regions that have at least one corresponding entry in staff sharing the same id. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = rgn.id );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "value", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_13359
train
v2
Schema: projects (alias: prj)(type, name, id, status) categories(id, amount, code, date) Task: Find salary from projects where a matching record exists in categories with the same code. SQL:
SELECT salary FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = prj.code );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "salary", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_13360
train
v1
Schema: accounts (alias: acct)(level, code, salary, date) transactions(value, salary, name, type) Task: Find id from accounts where id appears in transactions entries with matching status. SQL:
SELECT id FROM accounts AS acct WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.status = acct.status );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13361
train
v3
Schema: accounts (alias: acct)(salary, status, name, level) branches(name, code, value, amount) Task: Retrieve name from accounts with salary above the MAX(salary) of branches rows sharing the same type. SQL:
SELECT name FROM accounts AS acct WHERE salary > ( SELECT MAX(salary) FROM branches AS brc WHERE brc.type = acct.type );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13362
train
v3
Schema: shipments (alias: shp)(salary, id, name, type) managers(name, status, id, type) Task: Find code from shipments where value exceeds the count of value from managers for the same id. SQL:
SELECT code FROM shipments AS shp WHERE value > ( SELECT COUNT(value) FROM managers AS mgr WHERE mgr.id = shp.id );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_13363
train
v2
Schema: products (alias: prod)(amount, salary, level, date) invoices(id, salary, date, level) Task: Find salary from products where a matching record exists in invoices with the same code. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = prod.code );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "salary", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13364
train
v1
Schema: staff (alias: empl)(level, id, code, name) accounts(id, amount, code, name) Task: Select id from staff where type exists in accounts for the same code. SQL:
SELECT id FROM staff AS empl WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.code = empl.code );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_13365
train
v3
Schema: orders (alias: ord)(type, status, salary, amount) regions(date, level, name, amount) Task: Find name from orders where amount exceeds the minimum amount from regions for the same id. SQL:
SELECT name FROM orders AS ord WHERE amount > ( SELECT MIN(amount) FROM regions AS rgn WHERE rgn.id = ord.id );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13366
train
v3
Schema: requests (alias: ordr)(type, status, code, name) customers(salary, date, level, id) Task: Retrieve code from requests with amount above the AVG(amount) of customers rows sharing the same status. SQL:
SELECT code FROM requests AS ordr WHERE amount > ( SELECT AVG(amount) FROM customers AS cust WHERE cust.status = ordr.status );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_13367
train
v3
Schema: transactions (alias: txn)(name, level, value, code) schedules(date, status, value, id) Task: Retrieve id from transactions with amount above the AVG(value) of schedules rows sharing the same type. SQL:
SELECT id FROM transactions AS txn WHERE amount > ( SELECT AVG(value) FROM schedules AS schd WHERE schd.type = txn.type );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13368
train
v1
Schema: sales (alias: sale)(date, id, level, amount) projects(value, salary, code, name) Task: Find name from sales where level appears in projects entries with matching type. SQL:
SELECT name FROM sales AS sale WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.type = sale.type );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13369
train
v1
Schema: branches (alias: brc)(amount, value, code, date) tasks(value, salary, id, amount) Task: Find amount from branches where code appears in tasks entries with matching id. SQL:
SELECT amount FROM branches AS brc WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.id = brc.id );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_13370
train
v1
Schema: branches (alias: brc)(amount, code, status, id) regions(value, status, amount, type) Task: Retrieve id from branches whose type is found in regions rows where id matches the outer record. SQL:
SELECT id FROM branches AS brc WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.id = brc.id );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "brc", "inner_alias": "rgn", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_13371
train
v3
Schema: requests (alias: ordr)(salary, id, code, level) employees(type, code, id, date) Task: Retrieve name from requests with value above the MAX(amount) of employees rows sharing the same type. SQL:
SELECT name FROM requests AS ordr WHERE value > ( SELECT MAX(amount) FROM employees AS emp WHERE emp.type = ordr.type );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_13372
train
v3
Schema: sales (alias: sale)(amount, code, level, date) transactions(date, level, salary, code) Task: Find amount from sales where amount exceeds the total value from transactions for the same code. SQL:
SELECT amount FROM sales AS sale WHERE amount > ( SELECT SUM(value) FROM transactions AS txn WHERE txn.code = sale.code );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13373
train
v2
Schema: managers (alias: mgr)(code, value, status, level) departments(value, salary, id, code) Task: Find value from managers where a matching record exists in departments with the same level. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = mgr.level );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "value", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13374
train
v2
Schema: tasks (alias: tsk)(id, name, salary, date) transactions(code, status, level, type) Task: Find amount from tasks where a matching record exists in transactions with the same level. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "transactions", "outer_alias": "tsk", "inner_alias": "txn", "proj_col": "amount", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13375
train
v3
Schema: projects (alias: prj)(level, name, date, code) invoices(code, level, value, status) Task: Find id from projects where amount exceeds the average salary from invoices for the same status. SQL:
SELECT id FROM projects AS prj WHERE amount > ( SELECT AVG(salary) FROM invoices AS inv WHERE inv.status = prj.status );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "prj", "inner_alias": "inv", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_13376
train
v3
Schema: products (alias: prod)(salary, id, type, date) employees(salary, value, type, amount) Task: Find name from products where salary exceeds the maximum value from employees for the same status. SQL:
SELECT name FROM products AS prod WHERE salary > ( SELECT MAX(value) FROM employees AS emp WHERE emp.status = prod.status );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13377
train
v3
Schema: shipments (alias: shp)(code, type, name, status) customers(type, name, id, date) Task: Find code from shipments where salary exceeds the minimum amount from customers for the same id. SQL:
SELECT code FROM shipments AS shp WHERE salary > ( SELECT MIN(amount) FROM customers AS cust WHERE cust.id = shp.id );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_13378
train
v1
Schema: departments (alias: dept)(date, id, salary, code) customers(date, code, status, name) Task: Select code from departments where id exists in customers for the same id. SQL:
SELECT code FROM departments AS dept WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.id = dept.id );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13379
train
v2
Schema: employees (alias: emp)(value, id, status, name) requests(id, value, level, code) Task: Retrieve id from employees that have at least one corresponding entry in requests sharing the same level. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = emp.level );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "id", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13380
train
v3
Schema: products (alias: prod)(value, status, amount, name) regions(id, value, status, code) Task: Retrieve amount from products with value above the AVG(value) of regions rows sharing the same code. SQL:
SELECT amount FROM products AS prod WHERE value > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.code = prod.code );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13381
train
v1
Schema: staff (alias: empl)(status, id, name, level) shipments(id, type, amount, status) Task: Retrieve name from staff whose type is found in shipments rows where code matches the outer record. SQL:
SELECT name FROM staff AS empl WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.code = empl.code );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_13382
train
v3
Schema: staff (alias: empl)(name, type, code, date) departments(status, id, level, name) Task: Find amount from staff where amount exceeds the maximum value from departments for the same type. SQL:
SELECT amount FROM staff AS empl WHERE amount > ( SELECT MAX(value) FROM departments AS dept WHERE dept.type = empl.type );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_13383
train
v2
Schema: sales (alias: sale)(salary, type, value, level) accounts(salary, level, date, status) Task: Retrieve value from sales that have at least one corresponding entry in accounts sharing the same level. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = sale.level );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "value", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13384
train
v2
Schema: sales (alias: sale)(name, date, id, value) customers(level, type, salary, code) Task: Find amount from sales where a matching record exists in customers with the same status. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = sale.status );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "amount", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13385
train
v1
Schema: customers (alias: cust)(amount, value, id, level) orders(status, type, code, date) Task: Find id from customers where type appears in orders entries with matching type. SQL:
SELECT id FROM customers AS cust WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.type = cust.type );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "id", "filter_col": "type", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13386
train
v1
Schema: customers (alias: cust)(amount, level, date, id) categories(status, amount, type, value) Task: Find amount from customers where type appears in categories entries with matching level. SQL:
SELECT amount FROM customers AS cust WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.level = cust.level );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13387
train
v2
Schema: orders (alias: ord)(level, value, name, amount) regions(name, level, status, amount) Task: Find id from orders where a matching record exists in regions with the same status. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = ord.status );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "id", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13388
train
v3
Schema: products (alias: prod)(salary, value, name, date) regions(status, salary, type, date) Task: Retrieve amount from products with salary above the MAX(value) of regions rows sharing the same status. SQL:
SELECT amount FROM products AS prod WHERE salary > ( SELECT MAX(value) FROM regions AS rgn WHERE rgn.status = prod.status );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13389
train
v3
Schema: regions (alias: rgn)(type, level, salary, value) requests(level, salary, amount, value) Task: Retrieve code from regions with salary above the MIN(amount) of requests rows sharing the same type. SQL:
SELECT code FROM regions AS rgn WHERE salary > ( SELECT MIN(amount) FROM requests AS ordr WHERE ordr.type = rgn.type );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_13390
train
v3
Schema: departments (alias: dept)(status, amount, code, level) items(type, salary, status, date) Task: Find id from departments where amount exceeds the average amount from items for the same status. SQL:
SELECT id FROM departments AS dept WHERE amount > ( SELECT AVG(amount) FROM items AS lne WHERE lne.status = dept.status );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13391
train
v2
Schema: projects (alias: prj)(level, amount, status, salary) requests(value, salary, amount, id) Task: Retrieve amount from projects that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT amount FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = prj.type );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "amount", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_13392
train
v3
Schema: tasks (alias: tsk)(date, status, salary, value) customers(date, level, name, id) Task: Retrieve code from tasks with value above the AVG(salary) of customers rows sharing the same type. SQL:
SELECT code FROM tasks AS tsk WHERE value > ( SELECT AVG(salary) FROM customers AS cust WHERE cust.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "customers", "outer_alias": "tsk", "inner_alias": "cust", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13393
train
v1
Schema: projects (alias: prj)(level, amount, value, type) departments(date, amount, status, id) Task: Find value from projects where id appears in departments entries with matching code. SQL:
SELECT value FROM projects AS prj WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.code = prj.code );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_13394
train
v2
Schema: staff (alias: empl)(id, type, status, value) shipments(salary, code, type, id) Task: Find amount from staff where a matching record exists in shipments with the same id. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = empl.id );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "amount", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_13395
train
v3
Schema: categories (alias: catg)(value, level, code, salary) products(level, type, code, status) Task: Retrieve salary from categories with salary above the SUM(value) of products rows sharing the same code. SQL:
SELECT salary FROM categories AS catg WHERE salary > ( SELECT SUM(value) FROM products AS prod WHERE prod.code = catg.code );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13396
train
v3
Schema: managers (alias: mgr)(name, status, code, id) branches(status, code, name, value) Task: Find id from managers where value exceeds the count of amount from branches for the same status. SQL:
SELECT id FROM managers AS mgr WHERE value > ( SELECT COUNT(amount) FROM branches AS brc WHERE brc.status = mgr.status );
{ "outer_table": "managers", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13397
train
v1
Schema: invoices (alias: inv)(value, salary, level, status) tasks(date, salary, id, value) Task: Retrieve value from invoices whose type is found in tasks rows where id matches the outer record. SQL:
SELECT value FROM invoices AS inv WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.id = inv.id );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "value", "filter_col": "type", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13398
train
v3
Schema: transactions (alias: txn)(status, value, id, code) customers(amount, id, type, salary) Task: Retrieve name from transactions with salary above the AVG(amount) of customers rows sharing the same status. SQL:
SELECT name FROM transactions AS txn WHERE salary > ( SELECT AVG(amount) FROM customers AS cust WHERE cust.status = txn.status );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13399
train