variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v3
Schema: staff (alias: empl)(salary, status, name, code) sales(date, status, code, salary) Task: Retrieve amount from staff with salary above the MAX(amount) of sales rows sharing the same level. SQL:
SELECT amount FROM staff AS empl WHERE salary > ( SELECT MAX(amount) FROM sales AS sale WHERE sale.level = empl.level );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01800
train
v1
Schema: branches (alias: brc)(type, date, code, level) regions(name, id, type, status) Task: Retrieve amount from branches whose level is found in regions rows where code matches the outer record. SQL:
SELECT amount FROM branches AS brc WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.code = brc.code );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "brc", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01801
train
v2
Schema: customers (alias: cust)(value, id, code, date) projects(value, code, date, name) Task: Find id from customers where a matching record exists in projects with the same type. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = cust.type );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "id", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01802
train
v3
Schema: categories (alias: catg)(level, value, date, name) invoices(id, amount, status, value) Task: Retrieve value from categories with salary above the AVG(amount) of invoices rows sharing the same id. SQL:
SELECT value FROM categories AS catg WHERE salary > ( SELECT AVG(amount) FROM invoices AS inv WHERE inv.id = catg.id );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "value", "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_01803
train
v2
Schema: branches (alias: brc)(level, type, value, salary) sales(type, date, level, salary) Task: Retrieve amount from branches that have at least one corresponding entry in sales sharing the same level. SQL:
SELECT amount FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = brc.level );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "amount", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01804
train
v1
Schema: departments (alias: dept)(code, amount, name, salary) tasks(code, salary, amount, id) Task: Select code from departments where status exists in tasks for the same type. SQL:
SELECT code FROM departments AS dept WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.type = dept.type );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01805
train
v3
Schema: shipments (alias: shp)(date, amount, value, salary) transactions(status, date, name, type) Task: Retrieve salary from shipments with salary above the MIN(salary) of transactions rows sharing the same status. SQL:
SELECT salary FROM shipments AS shp WHERE salary > ( SELECT MIN(salary) FROM transactions AS txn WHERE txn.status = shp.status );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_01806
train
v2
Schema: regions (alias: rgn)(status, value, code, id) departments(date, salary, code, id) Task: Retrieve code from regions that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = rgn.code );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "code", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01807
train
v3
Schema: accounts (alias: acct)(id, value, salary, name) items(amount, type, salary, status) Task: Find amount from accounts where amount exceeds the total salary from items for the same id. SQL:
SELECT amount FROM accounts AS acct WHERE amount > ( SELECT SUM(salary) FROM items AS lne WHERE lne.id = acct.id );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01808
train
v2
Schema: regions (alias: rgn)(code, name, date, amount) invoices(type, amount, date, status) Task: Retrieve id from regions that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = rgn.type );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "id", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01809
train
v1
Schema: products (alias: prod)(id, type, value, status) schedules(salary, amount, level, status) Task: Select code from products where code exists in schedules for the same status. SQL:
SELECT code FROM products AS prod WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.status = prod.status );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01810
train
v3
Schema: orders (alias: ord)(code, amount, status, name) employees(level, type, amount, code) Task: Retrieve code from orders with amount above the MAX(value) of employees rows sharing the same id. SQL:
SELECT code FROM orders AS ord WHERE amount > ( SELECT MAX(value) FROM employees AS emp WHERE emp.id = ord.id );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01811
train
v3
Schema: staff (alias: empl)(id, level, code, type) orders(name, amount, status, id) Task: Retrieve amount from staff with salary above the MAX(value) of orders rows sharing the same id. SQL:
SELECT amount FROM staff AS empl WHERE salary > ( SELECT MAX(value) FROM orders AS ord WHERE ord.id = empl.id );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01812
train
v2
Schema: orders (alias: ord)(level, salary, status, code) items(level, amount, id, date) Task: Find name from orders where a matching record exists in items with the same type. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = ord.type );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "name", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01813
train
v2
Schema: regions (alias: rgn)(salary, value, amount, status) sales(salary, value, amount, level) Task: Retrieve salary from regions that have at least one corresponding entry in sales sharing the same id. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = rgn.id );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "salary", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01814
train
v2
Schema: shipments (alias: shp)(value, amount, salary, level) staff(amount, level, id, date) Task: Retrieve value from shipments that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = shp.type );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "value", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_01815
train
v3
Schema: staff (alias: empl)(code, status, amount, value) invoices(level, status, type, amount) Task: Find value from staff where amount exceeds the count of value from invoices for the same status. SQL:
SELECT value FROM staff AS empl WHERE amount > ( SELECT COUNT(value) FROM invoices AS inv WHERE inv.status = empl.status );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01816
train
v3
Schema: branches (alias: brc)(date, level, id, name) customers(name, salary, level, type) Task: Retrieve amount from branches with amount above the MIN(amount) of customers rows sharing the same id. SQL:
SELECT amount FROM branches AS brc WHERE amount > ( SELECT MIN(amount) FROM customers AS cust WHERE cust.id = brc.id );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01817
train
v1
Schema: orders (alias: ord)(type, value, amount, level) categories(id, amount, status, code) Task: Find value from orders where code appears in categories entries with matching status. SQL:
SELECT value FROM orders AS ord WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.status = ord.status );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01818
train
v3
Schema: tasks (alias: tsk)(amount, type, code, status) customers(id, value, amount, status) Task: Retrieve code from tasks with salary above the SUM(amount) of customers rows sharing the same type. SQL:
SELECT code FROM tasks AS tsk WHERE salary > ( SELECT SUM(amount) 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": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_01819
train
v2
Schema: schedules (alias: schd)(date, level, name, value) products(value, amount, salary, status) Task: Find value from schedules where a matching record exists in products with the same type. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = schd.type );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "value", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01820
train
v1
Schema: regions (alias: rgn)(name, code, level, salary) shipments(amount, date, name, salary) Task: Retrieve code from regions whose code is found in shipments rows where level matches the outer record. SQL:
SELECT code FROM regions AS rgn WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.level = rgn.level );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01821
train
v1
Schema: orders (alias: ord)(name, salary, amount, status) accounts(amount, name, code, salary) Task: Retrieve code from orders whose status is found in accounts rows where type matches the outer record. SQL:
SELECT code FROM orders AS ord WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.type = ord.type );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01822
train
v2
Schema: staff (alias: empl)(date, id, type, status) branches(amount, type, salary, name) Task: Find amount from staff where a matching record exists in branches with the same level. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = empl.level );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "amount", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01823
train
v1
Schema: staff (alias: empl)(salary, level, type, value) branches(code, salary, status, date) Task: Retrieve id from staff whose id is found in branches rows where id matches the outer record. SQL:
SELECT id FROM staff AS empl WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.id = empl.id );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01824
train
v1
Schema: departments (alias: dept)(id, date, amount, code) sales(date, level, amount, id) Task: Find id from departments where id appears in sales entries with matching type. SQL:
SELECT id FROM departments AS dept WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.type = dept.type );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01825
train
v2
Schema: invoices (alias: inv)(type, level, amount, value) staff(date, level, id, name) Task: Retrieve amount from invoices that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = inv.status );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "amount", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01826
train
v3
Schema: departments (alias: dept)(code, value, type, id) categories(amount, salary, level, id) Task: Retrieve code from departments with value above the SUM(amount) of categories rows sharing the same type. SQL:
SELECT code FROM departments AS dept WHERE value > ( SELECT SUM(amount) FROM categories AS catg WHERE catg.type = dept.type );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01827
train
v1
Schema: shipments (alias: shp)(name, date, id, amount) accounts(id, amount, status, level) Task: Select id from shipments where id exists in accounts for the same status. SQL:
SELECT id FROM shipments AS shp WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.status = shp.status );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_01828
train
v3
Schema: managers (alias: mgr)(salary, id, name, code) regions(code, type, salary, status) Task: Find value from managers where salary exceeds the average value from regions for the same id. SQL:
SELECT value FROM managers AS mgr WHERE salary > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.id = mgr.id );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01829
train
v2
Schema: customers (alias: cust)(salary, amount, date, code) products(status, value, date, code) Task: Find id from customers where a matching record exists in products with the same code. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = cust.code );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "id", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01830
train
v3
Schema: categories (alias: catg)(amount, name, type, code) products(date, salary, value, amount) Task: Retrieve id from categories with value above the AVG(amount) of products rows sharing the same id. SQL:
SELECT id FROM categories AS catg WHERE value > ( SELECT AVG(amount) FROM products AS prod WHERE prod.id = catg.id );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01831
train
v1
Schema: tasks (alias: tsk)(name, level, code, type) products(id, code, date, status) Task: Find code from tasks where level appears in products entries with matching type. SQL:
SELECT code FROM tasks AS tsk WHERE level IN ( SELECT level FROM products AS prod WHERE prod.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_01832
train
v1
Schema: accounts (alias: acct)(date, level, code, id) branches(level, type, amount, code) Task: Retrieve id from accounts whose level is found in branches rows where level matches the outer record. SQL:
SELECT id FROM accounts AS acct WHERE level IN ( SELECT level FROM branches AS brc WHERE brc.level = acct.level );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01833
train
v2
Schema: projects (alias: prj)(status, id, code, salary) regions(amount, value, date, salary) Task: Retrieve code from projects that have at least one corresponding entry in regions sharing the same type. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = prj.type );
{ "outer_table": "projects", "inner_table": "regions", "outer_alias": "prj", "inner_alias": "rgn", "proj_col": "code", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_01834
train
v1
Schema: invoices (alias: inv)(level, salary, type, code) products(level, code, value, type) Task: Select code from invoices where level exists in products for the same id. SQL:
SELECT code FROM invoices AS inv WHERE level IN ( SELECT level FROM products AS prod WHERE prod.id = inv.id );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01835
train
v2
Schema: items (alias: lne)(name, amount, salary, status) tasks(amount, name, level, id) Task: Retrieve salary from items that have at least one corresponding entry in tasks sharing the same type. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = lne.type );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "salary", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_01836
train
v2
Schema: branches (alias: brc)(date, level, amount, salary) tasks(status, type, code, id) Task: Retrieve name from branches that have at least one corresponding entry in tasks sharing the same code. SQL:
SELECT name FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = brc.code );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "name", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01837
train
v3
Schema: orders (alias: ord)(status, salary, amount, code) products(level, code, date, type) Task: Find salary from orders where value exceeds the total salary from products for the same type. SQL:
SELECT salary FROM orders AS ord WHERE value > ( SELECT SUM(salary) FROM products AS prod WHERE prod.type = ord.type );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01838
train
v2
Schema: orders (alias: ord)(amount, date, salary, value) categories(amount, salary, type, value) Task: Find value from orders where a matching record exists in categories with the same type. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = ord.type );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "value", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01839
train
v2
Schema: departments (alias: dept)(type, status, value, salary) tasks(name, date, status, code) Task: Find value from departments where a matching record exists in tasks with the same id. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = dept.id );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "value", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01840
train
v3
Schema: schedules (alias: schd)(name, date, status, level) customers(amount, code, salary, type) Task: Retrieve salary from schedules with value above the COUNT(value) of customers rows sharing the same level. SQL:
SELECT salary FROM schedules AS schd WHERE value > ( SELECT COUNT(value) FROM customers AS cust WHERE cust.level = schd.level );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01841
train
v1
Schema: sales (alias: sale)(type, status, amount, code) invoices(value, id, type, code) Task: Find code from sales where code appears in invoices entries with matching code. SQL:
SELECT code FROM sales AS sale WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.code = sale.code );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01842
train
v2
Schema: managers (alias: mgr)(amount, name, salary, type) categories(level, date, status, code) Task: Find salary from managers where a matching record exists in categories with the same level. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = mgr.level );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "salary", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01843
train
v3
Schema: transactions (alias: txn)(level, value, salary, name) orders(amount, level, date, status) Task: Retrieve salary from transactions with salary above the COUNT(value) of orders rows sharing the same status. SQL:
SELECT salary FROM transactions AS txn WHERE salary > ( SELECT COUNT(value) FROM orders AS ord WHERE ord.status = txn.status );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01844
train
v3
Schema: products (alias: prod)(salary, name, date, level) items(salary, code, date, id) Task: Retrieve salary from products with value above the MIN(amount) of items rows sharing the same code. SQL:
SELECT salary FROM products AS prod WHERE value > ( SELECT MIN(amount) FROM items AS lne WHERE lne.code = prod.code );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01845
train
v2
Schema: tasks (alias: tsk)(type, date, amount, value) categories(id, salary, name, code) Task: Retrieve amount from tasks that have at least one corresponding entry in categories sharing the same level. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "tsk", "inner_alias": "catg", "proj_col": "amount", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_01846
train
v1
Schema: departments (alias: dept)(name, salary, amount, code) branches(amount, id, value, salary) Task: Select id from departments where code exists in branches for the same code. SQL:
SELECT id FROM departments AS dept WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.code = dept.code );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01847
train
v1
Schema: products (alias: prod)(date, id, value, code) requests(amount, code, type, status) Task: Find name from products where level appears in requests entries with matching code. SQL:
SELECT name FROM products AS prod WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.code = prod.code );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01848
train
v1
Schema: managers (alias: mgr)(type, amount, date, code) items(type, date, status, id) Task: Retrieve amount from managers whose status is found in items rows where code matches the outer record. SQL:
SELECT amount FROM managers AS mgr WHERE status IN ( SELECT status FROM items AS lne WHERE lne.code = mgr.code );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01849
train
v1
Schema: categories (alias: catg)(value, code, level, salary) invoices(type, code, amount, status) Task: Retrieve amount from categories whose level is found in invoices rows where type matches the outer record. SQL:
SELECT amount FROM categories AS catg WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.type = catg.type );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01850
train
v2
Schema: orders (alias: ord)(status, id, code, type) customers(salary, amount, date, id) Task: Retrieve name from orders that have at least one corresponding entry in customers sharing the same id. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = ord.id );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "name", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01851
train
v1
Schema: invoices (alias: inv)(salary, date, id, level) staff(salary, level, type, name) Task: Retrieve name from invoices whose level is found in staff rows where level matches the outer record. SQL:
SELECT name FROM invoices AS inv WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.level = inv.level );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01852
train
v2
Schema: sales (alias: sale)(date, status, name, value) accounts(date, name, level, id) Task: Find value from sales where a matching record exists in accounts with the same code. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = sale.code );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "value", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01853
train
v3
Schema: departments (alias: dept)(type, name, id, level) tasks(salary, name, status, code) Task: Retrieve code from departments with salary above the MAX(amount) of tasks rows sharing the same code. SQL:
SELECT code FROM departments AS dept WHERE salary > ( SELECT MAX(amount) FROM tasks AS tsk WHERE tsk.code = dept.code );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01854
train
v2
Schema: projects (alias: prj)(salary, date, value, id) categories(level, type, amount, date) Task: Find id from projects where a matching record exists in categories with the same code. SQL:
SELECT id 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": "id", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_01855
train
v3
Schema: projects (alias: prj)(id, amount, type, code) customers(salary, value, code, date) Task: Find salary from projects where amount exceeds the maximum salary from customers for the same code. SQL:
SELECT salary FROM projects AS prj WHERE amount > ( SELECT MAX(salary) FROM customers AS cust WHERE cust.code = prj.code );
{ "outer_table": "projects", "inner_table": "customers", "outer_alias": "prj", "inner_alias": "cust", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_01856
train
v1
Schema: departments (alias: dept)(level, code, amount, date) managers(status, level, type, amount) Task: Select name from departments where type exists in managers for the same code. SQL:
SELECT name FROM departments AS dept WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.code = dept.code );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01857
train
v3
Schema: managers (alias: mgr)(id, salary, name, level) regions(status, name, value, date) Task: Find id from managers where amount exceeds the count of value from regions for the same status. SQL:
SELECT id FROM managers AS mgr WHERE amount > ( SELECT COUNT(value) FROM regions AS rgn WHERE rgn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01858
train
v1
Schema: sales (alias: sale)(type, name, code, level) customers(value, salary, type, date) Task: Find code from sales where level appears in customers entries with matching id. SQL:
SELECT code FROM sales AS sale WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.id = sale.id );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01859
train
v1
Schema: requests (alias: ordr)(amount, date, level, name) regions(amount, code, name, salary) Task: Retrieve name from requests whose status is found in regions rows where code matches the outer record. SQL:
SELECT name FROM requests AS ordr WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.code = ordr.code );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_01860
train
v3
Schema: requests (alias: ordr)(date, id, code, status) sales(amount, salary, name, date) Task: Retrieve value from requests with salary above the AVG(amount) of sales rows sharing the same status. SQL:
SELECT value FROM requests AS ordr WHERE salary > ( SELECT AVG(amount) FROM sales AS sale WHERE sale.status = ordr.status );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_01861
train
v3
Schema: categories (alias: catg)(salary, type, value, name) employees(type, level, date, salary) Task: Find value from categories where salary exceeds the minimum value from employees for the same status. SQL:
SELECT value FROM categories AS catg WHERE salary > ( SELECT MIN(value) FROM employees AS emp WHERE emp.status = catg.status );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01862
train
v2
Schema: regions (alias: rgn)(salary, amount, name, value) products(salary, status, amount, name) Task: Retrieve name from regions that have at least one corresponding entry in products sharing the same type. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = rgn.type );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "name", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01863
train
v1
Schema: invoices (alias: inv)(date, amount, status, type) regions(level, date, status, code) Task: Find salary from invoices where level appears in regions entries with matching level. SQL:
SELECT salary FROM invoices AS inv WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.level = inv.level );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "level", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01864
train
v3
Schema: employees (alias: emp)(salary, value, name, code) tasks(amount, name, id, level) Task: Find name from employees where salary exceeds the average amount from tasks for the same status. SQL:
SELECT name FROM employees AS emp WHERE salary > ( SELECT AVG(amount) FROM tasks AS tsk WHERE tsk.status = emp.status );
{ "outer_table": "employees", "inner_table": "tasks", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01865
train
v2
Schema: tasks (alias: tsk)(type, level, name, amount) shipments(salary, code, amount, value) Task: Find amount from tasks where a matching record exists in shipments with the same code. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "shipments", "outer_alias": "tsk", "inner_alias": "shp", "proj_col": "amount", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_01866
train
v3
Schema: staff (alias: empl)(date, name, id, amount) orders(status, id, value, salary) Task: Find name from staff where salary exceeds the count of value from orders for the same level. SQL:
SELECT name FROM staff AS empl WHERE salary > ( SELECT COUNT(value) FROM orders AS ord WHERE ord.level = empl.level );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01867
train
v3
Schema: categories (alias: catg)(id, status, date, type) invoices(level, status, type, amount) Task: Retrieve code from categories with salary above the COUNT(salary) of invoices rows sharing the same status. SQL:
SELECT code FROM categories AS catg WHERE salary > ( SELECT COUNT(salary) FROM invoices AS inv WHERE inv.status = catg.status );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01868
train
v1
Schema: requests (alias: ordr)(salary, date, value, name) orders(status, type, date, salary) Task: Select name from requests where type exists in orders for the same code. SQL:
SELECT name FROM requests AS ordr WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.code = ordr.code );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_01869
train
v3
Schema: products (alias: prod)(value, salary, date, status) managers(id, salary, type, level) Task: Retrieve amount from products with amount above the COUNT(amount) of managers rows sharing the same id. SQL:
SELECT amount FROM products AS prod WHERE amount > ( SELECT COUNT(amount) FROM managers AS mgr WHERE mgr.id = prod.id );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01870
train
v1
Schema: schedules (alias: schd)(type, level, value, name) transactions(id, code, status, date) Task: Retrieve code from schedules whose level is found in transactions rows where status matches the outer record. SQL:
SELECT code FROM schedules AS schd WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.status = schd.status );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01871
train
v3
Schema: accounts (alias: acct)(status, id, type, date) regions(code, date, type, id) Task: Retrieve salary from accounts with salary above the MAX(amount) of regions rows sharing the same type. SQL:
SELECT salary FROM accounts AS acct WHERE salary > ( SELECT MAX(amount) FROM regions AS rgn WHERE rgn.type = acct.type );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01872
train
v2
Schema: tasks (alias: tsk)(status, date, salary, name) shipments(amount, level, code, type) Task: Retrieve amount from tasks that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "shipments", "outer_alias": "tsk", "inner_alias": "shp", "proj_col": "amount", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_01873
train
v1
Schema: regions (alias: rgn)(value, status, code, salary) schedules(level, type, salary, code) Task: Retrieve code from regions whose status is found in schedules rows where id matches the outer record. SQL:
SELECT code FROM regions AS rgn WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.id = rgn.id );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01874
train
v3
Schema: departments (alias: dept)(type, name, status, id) orders(salary, value, level, name) Task: Retrieve salary from departments with value above the MAX(value) of orders rows sharing the same type. SQL:
SELECT salary FROM departments AS dept WHERE value > ( SELECT MAX(value) FROM orders AS ord WHERE ord.type = dept.type );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01875
train
v2
Schema: tasks (alias: tsk)(level, code, date, type) categories(amount, id, date, status) Task: Find name from tasks where a matching record exists in categories with the same status. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "tsk", "inner_alias": "catg", "proj_col": "name", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_01876
train
v3
Schema: tasks (alias: tsk)(date, status, code, level) requests(value, type, id, date) Task: Find salary from tasks where value exceeds the count of amount from requests for the same level. SQL:
SELECT salary FROM tasks AS tsk WHERE value > ( SELECT COUNT(amount) FROM requests AS ordr WHERE ordr.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "requests", "outer_alias": "tsk", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_01877
train
v3
Schema: regions (alias: rgn)(date, type, salary, level) staff(salary, name, status, code) Task: Find id from regions where amount exceeds the minimum value from staff for the same type. SQL:
SELECT id FROM regions AS rgn WHERE amount > ( SELECT MIN(value) FROM staff AS empl WHERE empl.type = rgn.type );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01878
train
v2
Schema: managers (alias: mgr)(date, type, level, salary) employees(code, type, amount, status) Task: Retrieve code from managers that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = mgr.type );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "code", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01879
train
v2
Schema: categories (alias: catg)(salary, value, code, status) customers(amount, status, level, date) Task: Find name from categories where a matching record exists in customers with the same type. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = catg.type );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "name", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01880
train
v1
Schema: customers (alias: cust)(salary, status, name, code) staff(status, name, value, code) Task: Select amount from customers where level exists in staff for the same id. SQL:
SELECT amount FROM customers AS cust WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.id = cust.id );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01881
train
v3
Schema: schedules (alias: schd)(status, type, id, date) managers(code, id, value, name) Task: Retrieve name from schedules with salary above the SUM(salary) of managers rows sharing the same status. SQL:
SELECT name FROM schedules AS schd WHERE salary > ( SELECT SUM(salary) FROM managers AS mgr WHERE mgr.status = schd.status );
{ "outer_table": "schedules", "inner_table": "managers", "outer_alias": "schd", "inner_alias": "mgr", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01882
train
v3
Schema: products (alias: prod)(status, date, salary, amount) departments(value, level, salary, id) Task: Retrieve name from products with salary above the AVG(salary) of departments rows sharing the same level. SQL:
SELECT name FROM products AS prod WHERE salary > ( SELECT AVG(salary) FROM departments AS dept WHERE dept.level = prod.level );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01883
train
v1
Schema: branches (alias: brc)(level, name, value, type) orders(salary, id, amount, type) Task: Find amount from branches where type appears in orders entries with matching level. SQL:
SELECT amount FROM branches AS brc WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.level = brc.level );
{ "outer_table": "branches", "inner_table": "orders", "outer_alias": "brc", "inner_alias": "ord", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01884
train
v1
Schema: requests (alias: ordr)(amount, level, name, id) managers(value, level, type, code) Task: Retrieve value from requests whose level is found in managers rows where code matches the outer record. SQL:
SELECT value FROM requests AS ordr WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.code = ordr.code );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_01885
train
v1
Schema: orders (alias: ord)(level, salary, type, amount) products(date, salary, status, amount) Task: Retrieve id from orders whose status is found in products rows where level matches the outer record. SQL:
SELECT id FROM orders AS ord WHERE status IN ( SELECT status FROM products AS prod WHERE prod.level = ord.level );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01886
train
v1
Schema: staff (alias: empl)(name, date, status, code) branches(name, status, salary, type) Task: Retrieve value from staff whose id is found in branches rows where code matches the outer record. SQL:
SELECT value FROM staff AS empl WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.code = empl.code );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01887
train
v3
Schema: customers (alias: cust)(type, status, date, id) schedules(code, name, type, status) Task: Retrieve id from customers with salary above the AVG(amount) of schedules rows sharing the same type. SQL:
SELECT id FROM customers AS cust WHERE salary > ( SELECT AVG(amount) FROM schedules AS schd WHERE schd.type = cust.type );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01888
train
v2
Schema: schedules (alias: schd)(status, id, level, date) departments(level, type, status, code) Task: Find amount from schedules where a matching record exists in departments with the same status. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = schd.status );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "amount", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01889
train
v1
Schema: invoices (alias: inv)(type, salary, value, name) managers(value, date, code, level) Task: Select salary from invoices where code exists in managers for the same type. SQL:
SELECT salary FROM invoices AS inv WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.type = inv.type );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01890
train
v2
Schema: managers (alias: mgr)(status, name, id, salary) requests(level, code, amount, salary) Task: Retrieve value from managers that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = mgr.type );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "value", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01891
train
v3
Schema: products (alias: prod)(level, value, id, status) transactions(type, id, date, name) Task: Retrieve code from products with amount above the MIN(value) of transactions rows sharing the same type. SQL:
SELECT code FROM products AS prod WHERE amount > ( SELECT MIN(value) FROM transactions AS txn WHERE txn.type = prod.type );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01892
train
v1
Schema: tasks (alias: tsk)(id, amount, status, date) staff(date, status, value, amount) Task: Retrieve name from tasks whose type is found in staff rows where level matches the outer record. SQL:
SELECT name FROM tasks AS tsk WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_01893
train
v2
Schema: transactions (alias: txn)(name, level, code, date) products(date, amount, value, salary) Task: Find code from transactions where a matching record exists in products with the same code. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = txn.code );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01894
train
v2
Schema: sales (alias: sale)(value, id, name, amount) staff(id, amount, type, salary) Task: Find amount from sales where a matching record exists in staff with the same status. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = sale.status );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "amount", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01895
train
v1
Schema: shipments (alias: shp)(name, salary, status, code) employees(id, name, status, date) Task: Select amount from shipments where id exists in employees for the same level. SQL:
SELECT amount FROM shipments AS shp WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.level = shp.level );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_01896
train
v3
Schema: requests (alias: ordr)(date, level, id, status) projects(amount, value, id, name) Task: Retrieve name from requests with amount above the MIN(amount) of projects rows sharing the same code. SQL:
SELECT name FROM requests AS ordr WHERE amount > ( SELECT MIN(amount) FROM projects AS prj WHERE prj.code = ordr.code );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_01897
train
v2
Schema: orders (alias: ord)(amount, level, id, value) transactions(status, type, level, id) Task: Find code from orders where a matching record exists in transactions with the same status. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = ord.status );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01898
train
v1
Schema: projects (alias: prj)(level, type, date, id) schedules(status, level, value, code) Task: Find name from projects where id appears in schedules entries with matching id. SQL:
SELECT name FROM projects AS prj WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.id = prj.id );
{ "outer_table": "projects", "inner_table": "schedules", "outer_alias": "prj", "inner_alias": "schd", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_01899
train