Dataset Viewer
Auto-converted to Parquet Duplicate
variant
stringclasses
3 values
prompt
stringlengths
160
234
sql
stringlengths
102
143
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
23
23
split
stringclasses
1 value
v2
Schema: employees (alias: emp)(amount, date, status, salary) tasks(amount, type, value, date) Task: Find id from employees where a matching record exists in tasks with the same code. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM tasks AS dept WHERE dept.code = emp.code );
{ "outer_table": "employees", "inner_table": "tasks", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "id", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00000
train
v1
Schema: accounts (alias: acct)(amount, salary, type, value) schedules(id, salary, type, status) Task: Retrieve value from accounts whose status is found in schedules rows where level matches the outer record. SQL:
SELECT value FROM accounts AS acct WHERE status IN ( SELECT status FROM schedules AS inv WHERE inv.level = acct.level );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00001
train
v3
Schema: regions (alias: rgn)(date, value, amount, level) transactions(date, status, name, value) Task: Retrieve value from regions with amount above the SUM(value) of transactions rows sharing the same code. SQL:
SELECT value FROM regions AS rgn WHERE amount > ( SELECT SUM(value) FROM transactions AS inv WHERE inv.code = rgn.code );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_rand_v4_train_00002
train
v2
Schema: sales (alias: sale)(value, level, id, amount) schedules(name, level, amount, status) Task: Retrieve value from sales that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM schedules AS inv WHERE inv.code = sale.code );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "value", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00003
train
v1
Schema: departments (alias: dept)(value, level, code, type) categories(amount, status, code, id) Task: Find name from departments where type appears in categories entries with matching code. SQL:
SELECT name FROM departments AS dept WHERE type IN ( SELECT type FROM categories AS prj WHERE prj.code = dept.code );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00004
train
v3
Schema: staff (alias: empl)(amount, code, level, date) tasks(value, type, code, status) Task: Retrieve amount from staff with amount above the AVG(value) of tasks rows sharing the same id. SQL:
SELECT amount FROM staff AS empl WHERE amount > ( SELECT AVG(value) FROM tasks AS txn WHERE txn.id = empl.id );
{ "outer_table": "staff", "inner_table": "tasks", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_rand_v4_train_00005
train
v2
Schema: invoices (alias: inv)(code, id, level, value) items(amount, name, date, id) Task: Retrieve id from invoices that have at least one corresponding entry in items sharing the same code. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM items AS prod WHERE prod.code = inv.code );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00006
train
v2
Schema: categories (alias: catg)(level, status, type, value) departments(id, amount, level, type) Task: Retrieve code from categories that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM departments AS prod WHERE prod.status = catg.status );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "code", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_rand_v4_train_00007
train
v2
Schema: departments (alias: dept)(value, amount, type, salary) accounts(value, status, salary, amount) Task: Retrieve amount from departments that have at least one corresponding entry in accounts sharing the same level. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM accounts AS dept WHERE dept.level = dept.level );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "dept", "proj_col": "amount", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00008
train
v3
Schema: branches (alias: brc)(value, type, date, code) managers(value, level, code, status) Task: Find code from branches where value exceeds the maximum amount from managers for the same code. SQL:
SELECT code FROM branches AS brc WHERE value > ( SELECT MAX(amount) FROM managers AS shp WHERE shp.code = brc.code );
{ "outer_table": "branches", "inner_table": "managers", "outer_alias": "brc", "inner_alias": "shp", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_rand_v4_train_00009
train
v1
Schema: orders (alias: ord)(date, type, id, value) tasks(status, date, name, salary) Task: Retrieve id from orders whose id is found in tasks rows where status matches the outer record. SQL:
SELECT id FROM orders AS ord WHERE id IN ( SELECT id FROM tasks AS txn WHERE txn.status = ord.status );
{ "outer_table": "orders", "inner_table": "tasks", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00010
train
v3
Schema: employees (alias: emp)(value, type, id, amount) invoices(name, value, type, status) Task: Find id from employees where salary exceeds the minimum salary from invoices for the same code. SQL:
SELECT id FROM employees AS emp WHERE salary > ( SELECT MIN(salary) FROM invoices AS ordr WHERE ordr.code = emp.code );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00011
train
v2
Schema: projects (alias: prj)(type, name, code, status) items(level, id, value, amount) Task: Retrieve salary from projects that have at least one corresponding entry in items sharing the same id. SQL:
SELECT salary FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM items AS txn WHERE txn.id = prj.id );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "salary", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_rand_v4_train_00012
train
v1
Schema: items (alias: lne)(amount, code, name, type) regions(date, salary, amount, id) Task: Select salary from items where code exists in regions for the same id. SQL:
SELECT salary FROM items AS lne WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.id = lne.id );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_rand_v4_train_00013
train
v1
Schema: transactions (alias: txn)(type, level, name, id) schedules(id, value, level, date) Task: Retrieve name from transactions whose status is found in schedules rows where status matches the outer record. SQL:
SELECT name FROM transactions AS txn WHERE status IN ( SELECT status FROM schedules AS acct WHERE acct.status = txn.status );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00014
train
v2
Schema: managers (alias: mgr)(code, type, level, amount) regions(type, name, date, salary) Task: Find name from managers where a matching record exists in regions with the same code. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM regions AS empl WHERE empl.code = mgr.code );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "name", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00015
train
v2
Schema: tasks (alias: tsk)(salary, id, amount, value) accounts(salary, name, date, type) Task: Retrieve salary from tasks that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT salary FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "tsk", "inner_alias": "acct", "proj_col": "salary", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_rand_v4_train_00016
train
v3
Schema: schedules (alias: schd)(code, level, amount, status) orders(level, status, code, type) Task: Find value from schedules where salary exceeds the maximum amount from orders for the same code. SQL:
SELECT value FROM schedules AS schd WHERE salary > ( SELECT MAX(amount) FROM orders AS sale WHERE sale.code = schd.code );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_rand_v4_train_00017
train
v2
Schema: branches (alias: brc)(id, status, value, type) orders(id, date, status, type) Task: Retrieve amount from branches that have at least one corresponding entry in orders sharing the same status. SQL:
SELECT amount FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM orders AS sale WHERE sale.status = brc.status );
{ "outer_table": "branches", "inner_table": "orders", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "amount", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_rand_v4_train_00018
train
v2
Schema: employees (alias: emp)(type, value, id, status) tasks(salary, value, type, date) Task: Find amount from employees where a matching record exists in tasks with the same code. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM tasks AS ordr WHERE ordr.code = emp.code );
{ "outer_table": "employees", "inner_table": "tasks", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "amount", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00019
train
v2
Schema: categories (alias: catg)(salary, date, status, name) branches(value, amount, status, code) Task: Find id from categories where a matching record exists in branches with the same code. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM branches AS shp WHERE shp.code = catg.code );
{ "outer_table": "categories", "inner_table": "branches", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "id", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_rand_v4_train_00020
train
v1
Schema: invoices (alias: inv)(id, amount, name, code) categories(code, date, name, salary) Task: Find value from invoices where type appears in categories entries with matching type. SQL:
SELECT value FROM invoices AS inv WHERE type IN ( SELECT type FROM categories AS lne WHERE lne.type = inv.type );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00021
train
v3
Schema: schedules (alias: schd)(level, salary, status, value) shipments(level, type, code, amount) Task: Find name from schedules where value exceeds the average salary from shipments for the same level. SQL:
SELECT name FROM schedules AS schd WHERE value > ( SELECT AVG(salary) FROM shipments AS sale WHERE sale.level = schd.level );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_rand_v4_train_00022
train
v3
Schema: products (alias: prod)(status, id, name, amount) invoices(code, level, name, salary) Task: Find code from products where salary exceeds the minimum salary from invoices for the same level. SQL:
SELECT code FROM products AS prod WHERE salary > ( SELECT MIN(salary) FROM invoices AS txn WHERE txn.level = prod.level );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00023
train
v3
Schema: schedules (alias: schd)(level, type, salary, name) regions(value, code, salary, type) Task: Find amount from schedules where value exceeds the count of value from regions for the same id. SQL:
SELECT amount FROM schedules AS schd WHERE value > ( SELECT COUNT(value) FROM regions AS shp WHERE shp.id = schd.id );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_rand_v4_train_00024
train
v3
Schema: sales (alias: sale)(name, value, level, date) transactions(code, amount, level, name) Task: Find id from sales where salary exceeds the average salary from transactions for the same code. SQL:
SELECT id FROM sales AS sale WHERE salary > ( SELECT AVG(salary) FROM transactions AS prj WHERE prj.code = sale.code );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00025
train
v3
Schema: items (alias: lne)(amount, salary, type, date) projects(name, id, salary, value) Task: Find value from items where value exceeds the total amount from projects for the same type. SQL:
SELECT value FROM items AS lne WHERE value > ( SELECT SUM(amount) FROM projects AS prod WHERE prod.type = lne.type );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_rand_v4_train_00026
train
v2
Schema: transactions (alias: txn)(amount, date, status, level) employees(salary, amount, date, code) Task: Find name from transactions where a matching record exists in employees with the same id. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM employees AS lne WHERE lne.id = txn.id );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "name", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00027
train
v3
Schema: staff (alias: empl)(id, salary, value, type) transactions(salary, type, date, name) Task: Find id from staff where amount exceeds the average salary from transactions for the same id. SQL:
SELECT id FROM staff AS empl WHERE amount > ( SELECT AVG(salary) FROM transactions AS empl WHERE empl.id = empl.id );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "empl", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_rand_v4_train_00028
train
v1
Schema: regions (alias: rgn)(code, amount, salary, level) shipments(date, code, type, level) Task: Find name from regions where status appears in shipments entries with matching code. SQL:
SELECT name FROM regions AS rgn WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_rand_v4_train_00029
train
v1
Schema: transactions (alias: txn)(value, date, salary, level) schedules(type, level, value, status) Task: Select value from transactions where level exists in schedules for the same level. SQL:
SELECT value FROM transactions AS txn WHERE level IN ( SELECT level FROM schedules AS catg WHERE catg.level = txn.level );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00030
train
v3
Schema: schedules (alias: schd)(salary, amount, id, name) customers(date, salary, status, type) Task: Find salary from schedules where value exceeds the count of value from customers for the same type. SQL:
SELECT salary FROM schedules AS schd WHERE value > ( SELECT COUNT(value) FROM customers AS ord WHERE ord.type = schd.type );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_rand_v4_train_00031
train
v3
Schema: accounts (alias: acct)(date, code, status, id) products(code, id, value, status) Task: Retrieve name from accounts with amount above the MAX(salary) of products rows sharing the same id. SQL:
SELECT name FROM accounts AS acct WHERE amount > ( SELECT MAX(salary) FROM products AS prj WHERE prj.id = acct.id );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00032
train
v1
Schema: products (alias: prod)(amount, salary, code, id) staff(status, amount, name, salary) Task: Select amount from products where code exists in staff for the same id. SQL:
SELECT amount FROM products AS prod WHERE code IN ( SELECT code FROM staff AS schd WHERE schd.id = prod.id );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00033
train
v2
Schema: accounts (alias: acct)(type, level, date, amount) schedules(level, code, value, date) Task: Retrieve amount from accounts that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM schedules AS brc WHERE brc.code = acct.code );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "amount", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00034
train
v1
Schema: sales (alias: sale)(id, code, value, name) products(value, type, level, status) Task: Retrieve name from sales whose code is found in products rows where id matches the outer record. SQL:
SELECT name FROM sales AS sale WHERE code IN ( SELECT code FROM products AS inv WHERE inv.id = sale.id );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00035
train
v3
Schema: regions (alias: rgn)(name, id, value, salary) transactions(value, status, type, level) Task: Find id from regions where amount exceeds the total value from transactions for the same code. SQL:
SELECT id FROM regions AS rgn WHERE amount > ( SELECT SUM(value) FROM transactions AS schd WHERE schd.code = rgn.code );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_rand_v4_train_00036
train
v2
Schema: customers (alias: cust)(status, name, value, code) managers(name, code, level, amount) Task: Retrieve code from customers that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM managers AS catg WHERE catg.code = cust.code );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00037
train
v2
Schema: orders (alias: ord)(level, code, amount, id) departments(date, type, level, value) Task: Retrieve amount from orders that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM departments AS emp WHERE emp.status = ord.status );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "amount", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00038
train
v1
Schema: sales (alias: sale)(type, status, amount, date) schedules(value, amount, type, id) Task: Retrieve code from sales whose id is found in schedules rows where level matches the outer record. SQL:
SELECT code FROM sales AS sale WHERE id IN ( SELECT id FROM schedules AS sale WHERE sale.level = sale.level );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "sale", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00039
train
v3
Schema: shipments (alias: shp)(type, id, name, date) items(name, salary, type, amount) Task: Retrieve code from shipments with value above the MIN(salary) of items rows sharing the same status. SQL:
SELECT code FROM shipments AS shp WHERE value > ( SELECT MIN(salary) FROM items AS schd WHERE schd.status = shp.status );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_rand_v4_train_00040
train
v3
Schema: requests (alias: ordr)(amount, date, level, status) invoices(type, amount, id, date) Task: Find amount from requests where salary exceeds the minimum value from invoices for the same level. SQL:
SELECT amount FROM requests AS ordr WHERE salary > ( SELECT MIN(value) FROM invoices AS schd WHERE schd.level = ordr.level );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_rand_v4_train_00041
train
v1
Schema: items (alias: lne)(amount, level, salary, value) transactions(type, status, salary, name) Task: Retrieve code from items whose id is found in transactions rows where level matches the outer record. SQL:
SELECT code FROM items AS lne WHERE id IN ( SELECT id FROM transactions AS prod WHERE prod.level = lne.level );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_rand_v4_train_00042
train
v1
Schema: categories (alias: catg)(id, type, level, date) employees(level, type, id, amount) Task: Retrieve code from categories whose level is found in employees rows where status matches the outer record. SQL:
SELECT code FROM categories AS catg WHERE level IN ( SELECT level FROM employees AS schd WHERE schd.status = catg.status );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_rand_v4_train_00043
train
v3
Schema: employees (alias: emp)(name, type, value, code) invoices(id, salary, value, date) Task: Find amount from employees where amount exceeds the average value from invoices for the same code. SQL:
SELECT amount FROM employees AS emp WHERE amount > ( SELECT AVG(value) FROM invoices AS rgn WHERE rgn.code = emp.code );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00044
train
v1
Schema: branches (alias: brc)(id, date, value, amount) shipments(salary, code, id, type) Task: Retrieve value from branches whose code is found in shipments rows where id matches the outer record. SQL:
SELECT value FROM branches AS brc WHERE code IN ( SELECT code FROM shipments AS catg WHERE catg.id = brc.id );
{ "outer_table": "branches", "inner_table": "shipments", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_rand_v4_train_00045
train
v2
Schema: orders (alias: ord)(type, name, code, salary) departments(date, type, salary, amount) Task: Retrieve salary from orders that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM departments AS prod WHERE prod.type = ord.type );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "salary", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00046
train
v1
Schema: products (alias: prod)(name, level, status, salary) accounts(value, salary, id, status) Task: Select id from products where id exists in accounts for the same status. SQL:
SELECT id FROM products AS prod WHERE id IN ( SELECT id FROM accounts AS cust WHERE cust.status = prod.status );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00047
train
v3
Schema: managers (alias: mgr)(id, level, value, type) regions(status, name, level, value) Task: Find id from managers where value exceeds the minimum value from regions for the same code. SQL:
SELECT id FROM managers AS mgr WHERE value > ( SELECT MIN(value) FROM regions AS brc WHERE brc.code = mgr.code );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00048
train
v1
Schema: requests (alias: ordr)(code, date, amount, value) regions(date, level, value, type) Task: Find name from requests where level appears in regions entries with matching code. SQL:
SELECT name FROM requests AS ordr WHERE level IN ( SELECT level FROM regions AS inv WHERE inv.code = ordr.code );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_rand_v4_train_00049
train
v1
Schema: accounts (alias: acct)(name, code, date, amount) shipments(amount, status, code, value) Task: Find value from accounts where status appears in shipments entries with matching id. SQL:
SELECT value FROM accounts AS acct WHERE status IN ( SELECT status FROM shipments AS inv WHERE inv.id = acct.id );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00050
train
v3
Schema: employees (alias: emp)(code, date, type, status) regions(id, name, amount, type) Task: Retrieve id from employees with amount above the MIN(salary) of regions rows sharing the same type. SQL:
SELECT id FROM employees AS emp WHERE amount > ( SELECT MIN(salary) FROM regions AS acct WHERE acct.type = emp.type );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00051
train
v3
Schema: invoices (alias: inv)(name, status, id, date) categories(name, status, level, date) Task: Retrieve amount from invoices with salary above the MIN(salary) of categories rows sharing the same status. SQL:
SELECT amount FROM invoices AS inv WHERE salary > ( SELECT MIN(salary) FROM categories AS catg WHERE catg.status = inv.status );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00052
train
v3
Schema: invoices (alias: inv)(name, salary, date, amount) employees(id, code, name, salary) Task: Retrieve code from invoices with amount above the AVG(salary) of employees rows sharing the same status. SQL:
SELECT code FROM invoices AS inv WHERE amount > ( SELECT AVG(salary) FROM employees AS lne WHERE lne.status = inv.status );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00053
train
v2
Schema: shipments (alias: shp)(date, amount, type, id) orders(value, type, status, date) Task: Retrieve salary from shipments that have at least one corresponding entry in orders sharing the same type. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM orders AS catg WHERE catg.type = shp.type );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "salary", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_rand_v4_train_00054
train
v3
Schema: staff (alias: empl)(type, name, amount, value) regions(salary, value, date, amount) Task: Retrieve id from staff with salary above the MAX(amount) of regions rows sharing the same status. SQL:
SELECT id FROM staff AS empl WHERE salary > ( SELECT MAX(amount) FROM regions AS mgr WHERE mgr.status = empl.status );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_rand_v4_train_00055
train
v3
Schema: customers (alias: cust)(value, type, id, salary) managers(date, level, status, id) Task: Find name from customers where value exceeds the total value from managers for the same level. SQL:
SELECT name FROM customers AS cust WHERE value > ( SELECT SUM(value) FROM managers AS catg WHERE catg.level = cust.level );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00056
train
v3
Schema: shipments (alias: shp)(type, value, date, id) projects(status, type, salary, date) Task: Retrieve amount from shipments with amount above the SUM(salary) of projects rows sharing the same id. SQL:
SELECT amount FROM shipments AS shp WHERE amount > ( SELECT SUM(salary) FROM projects AS shp WHERE shp.id = shp.id );
{ "outer_table": "shipments", "inner_table": "projects", "outer_alias": "shp", "inner_alias": "shp", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_rand_v4_train_00057
train
v2
Schema: staff (alias: empl)(name, status, amount, code) products(status, date, type, id) Task: Retrieve value from staff that have at least one corresponding entry in products sharing the same code. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM products AS tsk WHERE tsk.code = empl.code );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "tsk", "proj_col": "value", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_rand_v4_train_00058
train
v2
Schema: items (alias: lne)(status, type, salary, amount) invoices(name, code, status, level) Task: Retrieve value from items that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM invoices AS txn WHERE txn.id = lne.id );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "value", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_rand_v4_train_00059
train
v3
Schema: branches (alias: brc)(name, id, level, amount) requests(salary, type, status, name) Task: Retrieve id from branches with salary above the AVG(salary) of requests rows sharing the same level. SQL:
SELECT id FROM branches AS brc WHERE salary > ( SELECT AVG(salary) FROM requests AS lne WHERE lne.level = brc.level );
{ "outer_table": "branches", "inner_table": "requests", "outer_alias": "brc", "inner_alias": "lne", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_rand_v4_train_00060
train
v1
Schema: projects (alias: prj)(amount, level, value, salary) employees(code, date, name, id) Task: Select amount from projects where status exists in employees for the same code. SQL:
SELECT amount FROM projects AS prj WHERE status IN ( SELECT status FROM employees AS acct WHERE acct.code = prj.code );
{ "outer_table": "projects", "inner_table": "employees", "outer_alias": "prj", "inner_alias": "acct", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_rand_v4_train_00061
train
v3
Schema: sales (alias: sale)(type, status, level, date) projects(amount, value, status, level) Task: Find salary from sales where salary exceeds the count of value from projects for the same id. SQL:
SELECT salary FROM sales AS sale WHERE salary > ( SELECT COUNT(value) FROM projects AS shp WHERE shp.id = sale.id );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00062
train
v2
Schema: products (alias: prod)(name, salary, status, type) accounts(code, salary, amount, id) Task: Find name from products where a matching record exists in accounts with the same code. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM accounts AS schd WHERE schd.code = prod.code );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "name", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00063
train
v3
Schema: categories (alias: catg)(level, value, salary, type) items(level, code, status, amount) Task: Retrieve id from categories with amount above the MIN(value) of items rows sharing the same level. SQL:
SELECT id FROM categories AS catg WHERE amount > ( SELECT MIN(value) FROM items AS ord WHERE ord.level = catg.level );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_rand_v4_train_00064
train
v1
Schema: sales (alias: sale)(code, name, type, date) schedules(type, name, value, level) Task: Find name from sales where type appears in schedules entries with matching status. SQL:
SELECT name FROM sales AS sale WHERE type IN ( SELECT type FROM schedules AS lne WHERE lne.status = sale.status );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00065
train
v3
Schema: items (alias: lne)(id, level, name, value) staff(name, salary, date, status) Task: Retrieve id from items with salary above the COUNT(salary) of staff rows sharing the same id. SQL:
SELECT id FROM items AS lne WHERE salary > ( SELECT COUNT(salary) FROM staff AS rgn WHERE rgn.id = lne.id );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_rand_v4_train_00066
train
v2
Schema: regions (alias: rgn)(level, amount, code, date) categories(status, name, type, level) Task: Find value from regions where a matching record exists in categories with the same code. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM categories AS ordr WHERE ordr.code = rgn.code );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "value", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_rand_v4_train_00067
train
v3
Schema: customers (alias: cust)(date, salary, value, type) categories(salary, id, level, name) Task: Find value from customers where salary exceeds the count of amount from categories for the same level. SQL:
SELECT value FROM customers AS cust WHERE salary > ( SELECT COUNT(amount) FROM categories AS cust WHERE cust.level = cust.level );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "cust", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00068
train
v1
Schema: departments (alias: dept)(name, id, value, date) sales(type, date, status, amount) Task: Retrieve salary from departments whose status is found in sales rows where code matches the outer record. SQL:
SELECT salary FROM departments AS dept WHERE status IN ( SELECT status FROM sales AS prj WHERE prj.code = dept.code );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00069
train
v3
Schema: items (alias: lne)(level, status, salary, name) employees(name, value, id, date) Task: Find name from items where amount exceeds the maximum salary from employees for the same level. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT MAX(salary) FROM employees AS lne WHERE lne.level = lne.level );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "lne", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_rand_v4_train_00070
train
v2
Schema: managers (alias: mgr)(level, status, id, code) requests(amount, date, level, value) Task: Retrieve salary from managers that have at least one corresponding entry in requests sharing the same id. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM requests AS dept WHERE dept.id = mgr.id );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "salary", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00071
train
v1
Schema: staff (alias: empl)(salary, date, amount, type) employees(amount, type, code, salary) Task: Select amount from staff where code exists in employees for the same type. SQL:
SELECT amount FROM staff AS empl WHERE code IN ( SELECT code FROM employees AS cust WHERE cust.type = empl.type );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_rand_v4_train_00072
train
v2
Schema: projects (alias: prj)(level, type, status, date) shipments(status, value, type, id) Task: Find amount from projects where a matching record exists in shipments with the same code. SQL:
SELECT amount FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM shipments AS prj WHERE prj.code = prj.code );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "prj", "proj_col": "amount", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_rand_v4_train_00073
train
v2
Schema: departments (alias: dept)(name, type, code, date) regions(level, code, id, value) Task: Find value from departments where a matching record exists in regions with the same level. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM regions AS shp WHERE shp.level = dept.level );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "value", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00074
train
v2
Schema: transactions (alias: txn)(value, level, name, date) branches(value, date, amount, id) Task: Find name from transactions where a matching record exists in branches with the same status. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM branches AS rgn WHERE rgn.status = txn.status );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "name", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00075
train
v3
Schema: shipments (alias: shp)(name, amount, value, type) sales(name, amount, code, status) Task: Find name from shipments where salary exceeds the average amount from sales for the same type. SQL:
SELECT name FROM shipments AS shp WHERE salary > ( SELECT AVG(amount) FROM sales AS txn WHERE txn.type = shp.type );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_rand_v4_train_00076
train
v3
Schema: employees (alias: emp)(level, code, value, type) accounts(code, type, value, level) Task: Find code from employees where salary exceeds the maximum value from accounts for the same code. SQL:
SELECT code FROM employees AS emp WHERE salary > ( SELECT MAX(value) FROM accounts AS prj WHERE prj.code = emp.code );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "prj", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00077
train
v1
Schema: shipments (alias: shp)(type, date, code, id) invoices(amount, code, salary, name) Task: Retrieve id from shipments whose code is found in invoices rows where code matches the outer record. SQL:
SELECT id FROM shipments AS shp WHERE code IN ( SELECT code FROM invoices AS brc WHERE brc.code = shp.code );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "brc", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_rand_v4_train_00078
train
v1
Schema: departments (alias: dept)(value, status, code, id) projects(id, level, salary, status) Task: Select value from departments where code exists in projects for the same code. SQL:
SELECT value FROM departments AS dept WHERE code IN ( SELECT code FROM projects AS sale WHERE sale.code = dept.code );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00079
train
v1
Schema: accounts (alias: acct)(date, status, code, id) regions(level, date, id, salary) Task: Find code from accounts where code appears in regions entries with matching id. SQL:
SELECT code FROM accounts AS acct WHERE code IN ( SELECT code FROM regions AS acct WHERE acct.id = acct.id );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "acct", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00080
train
v3
Schema: orders (alias: ord)(salary, name, date, level) staff(level, amount, salary, name) Task: Find value from orders where salary exceeds the average amount from staff for the same code. SQL:
SELECT value FROM orders AS ord WHERE salary > ( SELECT AVG(amount) FROM staff AS prj WHERE prj.code = ord.code );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00081
train
v3
Schema: projects (alias: prj)(value, name, amount, salary) shipments(id, salary, amount, level) Task: Find code from projects where amount exceeds the average amount from shipments for the same id. SQL:
SELECT code FROM projects AS prj WHERE amount > ( SELECT AVG(amount) FROM shipments AS prod WHERE prod.id = prj.id );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "prod", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_rand_v4_train_00082
train
v1
Schema: staff (alias: empl)(code, status, id, name) branches(amount, code, name, status) Task: Find name from staff where type appears in branches entries with matching status. SQL:
SELECT name FROM staff AS empl WHERE type IN ( SELECT type FROM branches AS prj WHERE prj.status = empl.status );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "prj", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_rand_v4_train_00083
train
v1
Schema: orders (alias: ord)(status, name, type, amount) tasks(name, id, amount, value) Task: Find salary from orders where type appears in tasks entries with matching type. SQL:
SELECT salary FROM orders AS ord WHERE type IN ( SELECT type FROM tasks AS schd WHERE schd.type = ord.type );
{ "outer_table": "orders", "inner_table": "tasks", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00084
train
v3
Schema: schedules (alias: schd)(status, name, id, date) items(level, salary, amount, type) Task: Retrieve code from schedules with salary above the COUNT(salary) of items rows sharing the same status. SQL:
SELECT code FROM schedules AS schd WHERE salary > ( SELECT COUNT(salary) FROM items AS txn WHERE txn.status = schd.status );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_rand_v4_train_00085
train
v3
Schema: schedules (alias: schd)(date, code, status, salary) tasks(status, amount, salary, name) Task: Retrieve amount from schedules with value above the MAX(salary) of tasks rows sharing the same id. SQL:
SELECT amount FROM schedules AS schd WHERE value > ( SELECT MAX(salary) FROM tasks AS acct WHERE acct.id = schd.id );
{ "outer_table": "schedules", "inner_table": "tasks", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_rand_v4_train_00086
train
v1
Schema: invoices (alias: inv)(name, date, type, status) requests(date, level, name, salary) Task: Retrieve amount from invoices whose type is found in requests rows where id matches the outer record. SQL:
SELECT amount FROM invoices AS inv WHERE type IN ( SELECT type FROM requests AS prod WHERE prod.id = inv.id );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00087
train
v1
Schema: categories (alias: catg)(name, code, salary, status) requests(level, value, name, type) Task: Select code from categories where id exists in requests for the same type. SQL:
SELECT code FROM categories AS catg WHERE id IN ( SELECT id FROM requests AS empl WHERE empl.type = catg.type );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_rand_v4_train_00088
train
v1
Schema: sales (alias: sale)(amount, status, salary, id) schedules(amount, id, date, code) Task: Find value from sales where code appears in schedules entries with matching status. SQL:
SELECT value FROM sales AS sale WHERE code IN ( SELECT code FROM schedules AS prj WHERE prj.status = sale.status );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00089
train
v2
Schema: schedules (alias: schd)(status, salary, date, level) orders(name, type, date, value) Task: Retrieve id from schedules that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM orders AS mgr WHERE mgr.id = schd.id );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "mgr", "proj_col": "id", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_rand_v4_train_00090
train
v1
Schema: transactions (alias: txn)(type, value, date, amount) orders(status, level, code, salary) Task: Retrieve amount from transactions whose id is found in orders rows where type matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE id IN ( SELECT id FROM orders AS txn WHERE txn.type = txn.type );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "txn", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00091
train
v3
Schema: projects (alias: prj)(status, id, amount, value) customers(level, id, type, status) Task: Retrieve name from projects with salary above the MAX(value) of customers rows sharing the same code. SQL:
SELECT name FROM projects AS prj WHERE salary > ( SELECT MAX(value) FROM customers AS acct WHERE acct.code = prj.code );
{ "outer_table": "projects", "inner_table": "customers", "outer_alias": "prj", "inner_alias": "acct", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_rand_v4_train_00092
train
v3
Schema: customers (alias: cust)(type, id, date, name) orders(date, id, value, status) Task: Retrieve name from customers with amount above the SUM(value) of orders rows sharing the same type. SQL:
SELECT name FROM customers AS cust WHERE amount > ( SELECT SUM(value) FROM orders AS lne WHERE lne.type = cust.type );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00093
train
v2
Schema: branches (alias: brc)(level, id, salary, code) staff(value, status, id, type) Task: Find amount from branches where a matching record exists in staff with the same status. SQL:
SELECT amount FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM staff AS schd WHERE schd.status = brc.status );
{ "outer_table": "branches", "inner_table": "staff", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "amount", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_rand_v4_train_00094
train
v3
Schema: schedules (alias: schd)(id, amount, level, salary) tasks(value, status, code, id) Task: Find name from schedules where value exceeds the total amount from tasks for the same level. SQL:
SELECT name FROM schedules AS schd WHERE value > ( SELECT SUM(amount) FROM tasks AS empl WHERE empl.level = schd.level );
{ "outer_table": "schedules", "inner_table": "tasks", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_rand_v4_train_00095
train
v1
Schema: managers (alias: mgr)(level, name, code, type) invoices(status, amount, level, id) Task: Retrieve id from managers whose code is found in invoices rows where level matches the outer record. SQL:
SELECT id FROM managers AS mgr WHERE code IN ( SELECT code FROM invoices AS ord WHERE ord.level = mgr.level );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00096
train
v1
Schema: projects (alias: prj)(salary, amount, level, type) orders(status, value, id, type) Task: Find name from projects where level appears in orders entries with matching code. SQL:
SELECT name FROM projects AS prj WHERE level IN ( SELECT level FROM orders AS txn WHERE txn.code = prj.code );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_rand_v4_train_00097
train
v1
Schema: products (alias: prod)(date, salary, name, status) branches(amount, code, value, status) Task: Retrieve salary from products whose status is found in branches rows where level matches the outer record. SQL:
SELECT salary FROM products AS prod WHERE status IN ( SELECT status FROM branches AS prj WHERE prj.level = prod.level );
{ "outer_table": "products", "inner_table": "branches", "outer_alias": "prod", "inner_alias": "prj", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_rand_v4_train_00098
train
v3
Schema: shipments (alias: shp)(level, value, id, status) accounts(amount, code, id, salary) Task: Find value from shipments where salary exceeds the total amount from accounts for the same level. SQL:
SELECT value FROM shipments AS shp WHERE salary > ( SELECT SUM(amount) FROM accounts AS lne WHERE lne.level = shp.level );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_rand_v4_train_00099
train
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
27