variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v1 | Schema:
items (alias: lne)(type, salary, name, status)
accounts(salary, type, level, id)
Task: Retrieve salary from items whose id is found in accounts rows where type matches the outer record.
SQL: | SELECT salary FROM items AS lne
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.type = lne.type
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00100 | train |
v3 | Schema:
departments (alias: dept)(name, value, date, code)
employees(type, id, salary, name)
Task: Find name from departments where value exceeds the average amount from employees for the same id.
SQL: | SELECT name FROM departments AS dept
WHERE value > (
SELECT AVG(amount) FROM employees AS emp
WHERE emp.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00101 | train |
v3 | Schema:
invoices (alias: inv)(level, amount, code, name)
requests(amount, value, id, date)
Task: Find amount from invoices where value exceeds the maximum value from requests for the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE value > (
SELECT MAX(value) FROM requests AS ordr
WHERE ordr.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00102 | train |
v1 | Schema:
items (alias: lne)(date, code, id, type)
projects(type, value, status, amount)
Task: Retrieve amount from items whose code is found in projects rows where code matches the outer record.
SQL: | SELECT amount FROM items AS lne
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.code = lne.code
); | {
"outer_table": "items",
"inner_table": "projects",
"outer_alias": "lne",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00103 | train |
v2 | Schema:
shipments (alias: shp)(code, level, status, date)
branches(code, name, value, amount)
Task: Retrieve id from shipments that have at least one corresponding entry in branches sharing the same id.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00104 | train |
v3 | Schema:
branches (alias: brc)(level, value, status, id)
managers(code, id, level, amount)
Task: Retrieve amount from branches with salary above the COUNT(amount) of managers rows sharing the same id.
SQL: | SELECT amount FROM branches AS brc
WHERE salary > (
SELECT COUNT(amount) FROM managers AS mgr
WHERE mgr.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "managers",
"outer_alias": "brc",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00105 | train |
v3 | Schema:
managers (alias: mgr)(value, salary, type, level)
branches(level, name, type, value)
Task: Retrieve value from managers with amount above the MIN(salary) of branches rows sharing the same level.
SQL: | SELECT value FROM managers AS mgr
WHERE amount > (
SELECT MIN(salary) FROM branches AS brc
WHERE brc.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00106 | train |
v3 | Schema:
transactions (alias: txn)(status, salary, name, amount)
sales(date, status, name, amount)
Task: Find id from transactions where amount exceeds the maximum value from sales for the same code.
SQL: | SELECT id FROM transactions AS txn
WHERE amount > (
SELECT MAX(value) FROM sales AS sale
WHERE sale.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00107 | train |
v1 | Schema:
categories (alias: catg)(salary, code, value, type)
invoices(type, salary, id, value)
Task: Find value from categories where code appears in invoices entries with matching status.
SQL: | SELECT value FROM categories AS catg
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00108 | train |
v2 | Schema:
shipments (alias: shp)(name, id, code, status)
transactions(date, value, type, level)
Task: Retrieve amount from shipments that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00109 | train |
v1 | Schema:
shipments (alias: shp)(code, level, status, name)
branches(amount, salary, level, name)
Task: Find salary from shipments where level appears in branches entries with matching status.
SQL: | SELECT salary FROM shipments AS shp
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00110 | train |
v1 | Schema:
employees (alias: emp)(level, name, value, status)
orders(type, level, status, name)
Task: Select salary from employees where level exists in orders for the same type.
SQL: | SELECT salary FROM employees AS emp
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00111 | train |
v2 | Schema:
requests (alias: ordr)(level, date, value, name)
branches(name, type, level, value)
Task: Find code from requests where a matching record exists in branches with the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00112 | train |
v2 | Schema:
invoices (alias: inv)(value, code, level, date)
employees(value, name, type, code)
Task: Find name from invoices where a matching record exists in employees with the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00113 | train |
v1 | Schema:
products (alias: prod)(id, code, name, level)
shipments(type, name, code, amount)
Task: Select amount from products where status exists in shipments for the same id.
SQL: | SELECT amount FROM products AS prod
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.id = prod.id
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00114 | train |
v1 | Schema:
orders (alias: ord)(code, date, id, level)
categories(date, level, value, type)
Task: Select amount from orders where id exists in categories for the same type.
SQL: | SELECT amount FROM orders AS ord
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00115 | train |
v3 | Schema:
departments (alias: dept)(code, id, name, date)
managers(id, type, date, name)
Task: Find id from departments where value exceeds the count of value from managers for the same status.
SQL: | SELECT id FROM departments AS dept
WHERE value > (
SELECT COUNT(value) FROM managers AS mgr
WHERE mgr.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00116 | train |
v2 | Schema:
tasks (alias: tsk)(amount, id, level, name)
shipments(value, level, salary, status)
Task: Find amount from tasks where a matching record exists in shipments with the same id.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_00117 | train |
v2 | Schema:
shipments (alias: shp)(name, id, level, date)
items(type, date, salary, name)
Task: Retrieve id from shipments that have at least one corresponding entry in items sharing the same status.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00118 | train |
v2 | Schema:
staff (alias: empl)(level, status, amount, date)
requests(code, date, id, level)
Task: Retrieve value from staff that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_00119 | train |
v1 | Schema:
employees (alias: emp)(name, salary, amount, date)
shipments(amount, id, type, status)
Task: Select amount from employees where type exists in shipments for the same type.
SQL: | SELECT amount FROM employees AS emp
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00120 | train |
v2 | Schema:
schedules (alias: schd)(status, id, code, value)
customers(name, type, level, date)
Task: Retrieve amount from schedules that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00121 | train |
v1 | Schema:
managers (alias: mgr)(level, value, name, date)
shipments(id, type, status, date)
Task: Retrieve id from managers whose code is found in shipments rows where level matches the outer record.
SQL: | SELECT id FROM managers AS mgr
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00122 | train |
v1 | Schema:
schedules (alias: schd)(type, name, date, code)
managers(value, name, id, amount)
Task: Retrieve amount from schedules whose level is found in managers rows where type matches the outer record.
SQL: | SELECT amount FROM schedules AS schd
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00123 | train |
v1 | Schema:
employees (alias: emp)(amount, date, code, type)
accounts(level, status, value, name)
Task: Select id from employees where level exists in accounts for the same type.
SQL: | SELECT id FROM employees AS emp
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00124 | train |
v3 | Schema:
employees (alias: emp)(name, code, date, status)
schedules(amount, level, status, value)
Task: Find id from employees where amount exceeds the count of amount from schedules for the same code.
SQL: | SELECT id FROM employees AS emp
WHERE amount > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00125 | train |
v3 | Schema:
products (alias: prod)(id, amount, type, name)
tasks(salary, level, status, amount)
Task: Find id from products where salary exceeds the average value from tasks for the same type.
SQL: | SELECT id FROM products AS prod
WHERE salary > (
SELECT AVG(value) FROM tasks AS tsk
WHERE tsk.type = prod.type
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00126 | train |
v1 | Schema:
projects (alias: prj)(id, code, level, value)
categories(name, code, id, salary)
Task: Select amount from projects where id exists in categories for the same id.
SQL: | SELECT amount FROM projects AS prj
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00127 | train |
v1 | Schema:
items (alias: lne)(date, status, level, id)
categories(code, salary, type, level)
Task: Find salary from items where type appears in categories entries with matching type.
SQL: | SELECT salary FROM items AS lne
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.type = lne.type
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00128 | train |
v3 | Schema:
tasks (alias: tsk)(id, amount, level, code)
regions(id, level, salary, status)
Task: Find code from tasks where amount exceeds the total amount from regions for the same level.
SQL: | SELECT code FROM tasks AS tsk
WHERE amount > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_00129 | train |
v2 | Schema:
invoices (alias: inv)(date, type, id, amount)
schedules(value, code, salary, date)
Task: Retrieve id from invoices that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00130 | train |
v1 | Schema:
accounts (alias: acct)(id, salary, value, type)
categories(date, salary, code, value)
Task: Select id from accounts where status exists in categories for the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00131 | train |
v1 | Schema:
orders (alias: ord)(code, type, status, level)
items(amount, name, salary, status)
Task: Retrieve code from orders whose level is found in items rows where type matches the outer record.
SQL: | SELECT code FROM orders AS ord
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00132 | train |
v1 | Schema:
orders (alias: ord)(code, type, date, id)
staff(salary, amount, date, status)
Task: Find id from orders where code appears in staff entries with matching status.
SQL: | SELECT id FROM orders AS ord
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00133 | train |
v2 | Schema:
projects (alias: prj)(type, value, id, code)
departments(type, date, level, status)
Task: Retrieve salary from projects that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00134 | train |
v3 | Schema:
schedules (alias: schd)(type, id, status, code)
categories(code, id, name, amount)
Task: Find code from schedules where value exceeds the average value from categories for the same level.
SQL: | SELECT code FROM schedules AS schd
WHERE value > (
SELECT AVG(value) FROM categories AS catg
WHERE catg.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00135 | train |
v1 | Schema:
tasks (alias: tsk)(type, code, level, date)
branches(name, date, amount, code)
Task: Find name from tasks where status appears in branches entries with matching type.
SQL: | SELECT name FROM tasks AS tsk
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_00136 | train |
v3 | Schema:
categories (alias: catg)(salary, name, amount, date)
transactions(id, level, status, salary)
Task: Find code from categories where amount exceeds the minimum value from transactions for the same level.
SQL: | SELECT code FROM categories AS catg
WHERE amount > (
SELECT MIN(value) FROM transactions AS txn
WHERE txn.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00137 | train |
v2 | Schema:
items (alias: lne)(id, salary, date, code)
products(value, name, type, level)
Task: Find name from items where a matching record exists in products with the same id.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = lne.id
); | {
"outer_table": "items",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00138 | train |
v3 | Schema:
employees (alias: emp)(salary, date, type, value)
requests(status, level, amount, value)
Task: Find id from employees where value exceeds the minimum salary from requests for the same level.
SQL: | SELECT id FROM employees AS emp
WHERE value > (
SELECT MIN(salary) FROM requests AS ordr
WHERE ordr.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00139 | train |
v3 | Schema:
managers (alias: mgr)(status, type, code, value)
customers(date, value, amount, salary)
Task: Find code from managers where salary exceeds the count of salary from customers for the same level.
SQL: | SELECT code FROM managers AS mgr
WHERE salary > (
SELECT COUNT(salary) FROM customers AS cust
WHERE cust.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00140 | train |
v3 | Schema:
tasks (alias: tsk)(salary, date, status, id)
managers(code, type, status, level)
Task: Find name from tasks where amount exceeds the total salary from managers for the same type.
SQL: | SELECT name FROM tasks AS tsk
WHERE amount > (
SELECT SUM(salary) FROM managers AS mgr
WHERE mgr.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_00141 | train |
v2 | Schema:
requests (alias: ordr)(code, level, id, amount)
managers(salary, code, type, status)
Task: Find id from requests where a matching record exists in managers with the same type.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00142 | train |
v3 | Schema:
customers (alias: cust)(amount, level, value, type)
projects(code, name, level, salary)
Task: Retrieve code from customers with amount above the MAX(amount) of projects rows sharing the same type.
SQL: | SELECT code FROM customers AS cust
WHERE amount > (
SELECT MAX(amount) FROM projects AS prj
WHERE prj.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00143 | train |
v1 | Schema:
invoices (alias: inv)(date, amount, id, level)
sales(name, status, code, id)
Task: Find id from invoices where type appears in sales entries with matching id.
SQL: | SELECT id FROM invoices AS inv
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00144 | train |
v1 | Schema:
employees (alias: emp)(date, status, amount, type)
orders(amount, type, status, id)
Task: Retrieve salary from employees whose level is found in orders rows where status matches the outer record.
SQL: | SELECT salary FROM employees AS emp
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00145 | train |
v1 | Schema:
tasks (alias: tsk)(type, code, amount, date)
projects(value, salary, amount, id)
Task: Find name from tasks where type appears in projects entries with matching status.
SQL: | SELECT name FROM tasks AS tsk
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_00146 | train |
v2 | Schema:
departments (alias: dept)(code, amount, value, name)
managers(amount, name, type, date)
Task: Find id from departments where a matching record exists in managers with the same id.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00147 | train |
v3 | Schema:
invoices (alias: inv)(level, status, id, amount)
tasks(code, type, name, value)
Task: Retrieve salary from invoices with value above the MIN(salary) of tasks rows sharing the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE value > (
SELECT MIN(salary) FROM tasks AS tsk
WHERE tsk.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00148 | train |
v2 | Schema:
shipments (alias: shp)(id, level, status, code)
regions(level, amount, salary, status)
Task: Retrieve name from shipments that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00149 | train |
v2 | Schema:
branches (alias: brc)(code, status, salary, type)
customers(id, salary, name, amount)
Task: Retrieve id from branches that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00150 | train |
v2 | Schema:
categories (alias: catg)(type, id, level, name)
schedules(date, value, name, status)
Task: Retrieve salary from categories that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00151 | train |
v3 | Schema:
orders (alias: ord)(name, salary, amount, id)
requests(name, status, id, amount)
Task: Retrieve value from orders with salary above the AVG(salary) of requests rows sharing the same level.
SQL: | SELECT value FROM orders AS ord
WHERE salary > (
SELECT AVG(salary) FROM requests AS ordr
WHERE ordr.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00152 | train |
v3 | Schema:
customers (alias: cust)(salary, value, status, date)
invoices(name, type, level, id)
Task: Find name from customers where amount exceeds the average amount from invoices for the same code.
SQL: | SELECT name FROM customers AS cust
WHERE amount > (
SELECT AVG(amount) FROM invoices AS inv
WHERE inv.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00153 | train |
v1 | Schema:
regions (alias: rgn)(level, name, date, amount)
schedules(date, id, value, level)
Task: Select code from regions where code exists in schedules for the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00154 | train |
v1 | Schema:
managers (alias: mgr)(salary, type, name, value)
schedules(type, salary, value, level)
Task: Select name from managers where type exists in schedules for the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00155 | train |
v1 | Schema:
customers (alias: cust)(value, date, status, name)
invoices(level, value, code, amount)
Task: Find id from customers where type appears in invoices entries with matching type.
SQL: | SELECT id FROM customers AS cust
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00156 | train |
v3 | Schema:
shipments (alias: shp)(status, salary, name, value)
orders(salary, level, status, id)
Task: Find value from shipments where value exceeds the maximum value from orders for the same type.
SQL: | SELECT value FROM shipments AS shp
WHERE value > (
SELECT MAX(value) FROM orders AS ord
WHERE ord.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00157 | train |
v2 | Schema:
customers (alias: cust)(value, type, amount, name)
staff(status, name, level, id)
Task: Retrieve code from customers that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00158 | train |
v1 | Schema:
sales (alias: sale)(status, type, id, amount)
projects(id, date, code, level)
Task: Select value from sales where status exists in projects for the same level.
SQL: | SELECT value FROM sales AS sale
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00159 | train |
v1 | Schema:
projects (alias: prj)(id, code, date, type)
customers(id, salary, type, code)
Task: Retrieve code from projects whose status is found in customers rows where id matches the outer record.
SQL: | SELECT code FROM projects AS prj
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "prj",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00160 | train |
v3 | Schema:
products (alias: prod)(code, salary, value, status)
transactions(date, amount, id, salary)
Task: Retrieve value from products with amount above the MIN(value) of transactions rows sharing the same type.
SQL: | SELECT value 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": "value",
"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_00161 | train |
v3 | Schema:
employees (alias: emp)(value, type, amount, salary)
categories(status, date, level, amount)
Task: Retrieve amount from employees with salary above the MIN(amount) of categories rows sharing the same code.
SQL: | SELECT amount FROM employees AS emp
WHERE salary > (
SELECT MIN(amount) FROM categories AS catg
WHERE catg.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00162 | train |
v3 | Schema:
requests (alias: ordr)(value, date, id, code)
tasks(type, id, value, status)
Task: Find value from requests where salary exceeds the average amount from tasks for the same status.
SQL: | SELECT value FROM requests AS ordr
WHERE salary > (
SELECT AVG(amount) FROM tasks AS tsk
WHERE tsk.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"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_00163 | train |
v3 | Schema:
departments (alias: dept)(date, level, amount, id)
staff(amount, date, code, level)
Task: Retrieve code from departments with value above the MAX(value) of staff rows sharing the same id.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT MAX(value) FROM staff AS empl
WHERE empl.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00164 | train |
v2 | Schema:
products (alias: prod)(code, name, level, value)
invoices(value, date, level, amount)
Task: Retrieve value from products that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = prod.status
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00165 | train |
v2 | Schema:
categories (alias: catg)(date, type, name, level)
transactions(salary, code, type, name)
Task: Retrieve name from categories that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00166 | train |
v3 | Schema:
projects (alias: prj)(level, id, date, name)
shipments(name, salary, id, type)
Task: Find code from projects where value exceeds the total salary from shipments for the same status.
SQL: | SELECT code FROM projects AS prj
WHERE value > (
SELECT SUM(salary) FROM shipments AS shp
WHERE shp.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00167 | train |
v3 | Schema:
invoices (alias: inv)(type, id, level, date)
branches(name, status, amount, level)
Task: Retrieve value from invoices with amount above the COUNT(value) of branches rows sharing the same id.
SQL: | SELECT value FROM invoices AS inv
WHERE amount > (
SELECT COUNT(value) FROM branches AS brc
WHERE brc.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00168 | train |
v1 | Schema:
schedules (alias: schd)(value, level, id, salary)
invoices(type, level, salary, status)
Task: Find id from schedules where id appears in invoices entries with matching code.
SQL: | SELECT id FROM schedules AS schd
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00169 | train |
v3 | Schema:
requests (alias: ordr)(amount, type, salary, status)
schedules(id, code, level, date)
Task: Find id from requests where amount exceeds the minimum amount from schedules for the same id.
SQL: | SELECT id FROM requests AS ordr
WHERE amount > (
SELECT MIN(amount) FROM schedules AS schd
WHERE schd.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00170 | train |
v1 | Schema:
items (alias: lne)(name, date, id, value)
departments(level, status, code, type)
Task: Select id from items where id exists in departments for the same id.
SQL: | SELECT id FROM items AS lne
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.id = lne.id
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00171 | train |
v2 | Schema:
employees (alias: emp)(date, level, status, amount)
managers(amount, type, value, salary)
Task: Retrieve salary from employees that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00172 | train |
v2 | Schema:
staff (alias: empl)(amount, date, value, id)
shipments(id, amount, code, level)
Task: Retrieve code from staff that have at least one corresponding entry in shipments sharing the same level.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_00173 | train |
v1 | Schema:
departments (alias: dept)(salary, amount, type, code)
regions(date, id, level, type)
Task: Find value from departments where status appears in regions entries with matching id.
SQL: | SELECT value FROM departments AS dept
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00174 | train |
v3 | Schema:
sales (alias: sale)(level, code, salary, amount)
tasks(code, level, value, name)
Task: Find value from sales where salary exceeds the count of value from tasks for the same status.
SQL: | SELECT value FROM sales AS sale
WHERE salary > (
SELECT COUNT(value) FROM tasks AS tsk
WHERE tsk.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00175 | train |
v3 | Schema:
schedules (alias: schd)(name, salary, code, value)
products(status, level, amount, name)
Task: Retrieve code from schedules with salary above the COUNT(value) of products rows sharing the same level.
SQL: | SELECT code FROM schedules AS schd
WHERE salary > (
SELECT COUNT(value) FROM products AS prod
WHERE prod.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00176 | train |
v3 | Schema:
items (alias: lne)(value, salary, date, status)
managers(salary, name, code, value)
Task: Retrieve name from items with salary above the MIN(salary) of managers rows sharing the same level.
SQL: | SELECT name FROM items AS lne
WHERE salary > (
SELECT MIN(salary) FROM managers AS mgr
WHERE mgr.level = lne.level
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00177 | train |
v2 | Schema:
schedules (alias: schd)(amount, code, name, date)
customers(amount, name, id, level)
Task: Find amount from schedules where a matching record exists in customers with the same type.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00178 | train |
v1 | Schema:
items (alias: lne)(value, date, amount, id)
requests(date, salary, level, value)
Task: Select name from items where code exists in requests for the same status.
SQL: | SELECT name FROM items AS lne
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.status = lne.status
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00179 | train |
v1 | Schema:
departments (alias: dept)(value, date, name, type)
tasks(code, amount, status, date)
Task: Find salary from departments where status appears in tasks entries with matching status.
SQL: | SELECT salary FROM departments AS dept
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00180 | train |
v3 | Schema:
accounts (alias: acct)(amount, salary, status, level)
orders(name, level, code, id)
Task: Find value from accounts where value exceeds the count of amount from orders for the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE value > (
SELECT COUNT(amount) FROM orders AS ord
WHERE ord.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00181 | train |
v1 | Schema:
accounts (alias: acct)(status, type, code, value)
regions(date, id, code, value)
Task: Find value from accounts where id appears in regions entries with matching level.
SQL: | SELECT value FROM accounts AS acct
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00182 | train |
v2 | Schema:
invoices (alias: inv)(level, date, salary, status)
shipments(amount, level, code, name)
Task: Find id from invoices where a matching record exists in shipments with the same code.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00183 | train |
v1 | Schema:
invoices (alias: inv)(level, date, salary, value)
projects(level, type, date, value)
Task: Retrieve amount from invoices whose id is found in projects rows where code matches the outer record.
SQL: | SELECT amount FROM invoices AS inv
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00184 | train |
v1 | Schema:
projects (alias: prj)(date, type, level, name)
invoices(date, amount, salary, type)
Task: Find amount from projects where code appears in invoices entries with matching level.
SQL: | SELECT amount FROM projects AS prj
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00185 | train |
v2 | Schema:
customers (alias: cust)(level, name, salary, value)
accounts(id, level, name, code)
Task: Retrieve id from customers that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00186 | train |
v3 | Schema:
tasks (alias: tsk)(name, value, salary, level)
invoices(id, date, salary, type)
Task: Find name from tasks where amount exceeds the maximum amount from invoices for the same id.
SQL: | SELECT name FROM tasks AS tsk
WHERE amount > (
SELECT MAX(amount) FROM invoices AS inv
WHERE inv.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_00187 | train |
v1 | Schema:
products (alias: prod)(type, date, status, level)
branches(amount, level, value, name)
Task: Select salary from products where level exists in branches for the same code.
SQL: | SELECT salary FROM products AS prod
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.code = prod.code
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00188 | train |
v3 | Schema:
invoices (alias: inv)(salary, value, status, type)
projects(code, name, id, status)
Task: Find id from invoices where amount exceeds the average salary from projects for the same type.
SQL: | SELECT id FROM invoices AS inv
WHERE amount > (
SELECT AVG(salary) FROM projects AS prj
WHERE prj.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00189 | train |
v1 | Schema:
employees (alias: emp)(type, amount, name, date)
shipments(code, amount, status, id)
Task: Retrieve value from employees whose status is found in shipments rows where code matches the outer record.
SQL: | SELECT value FROM employees AS emp
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00190 | train |
v1 | Schema:
schedules (alias: schd)(id, amount, salary, name)
branches(id, amount, level, type)
Task: Find id from schedules where level appears in branches entries with matching type.
SQL: | SELECT id FROM schedules AS schd
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00191 | train |
v3 | Schema:
employees (alias: emp)(code, level, date, amount)
projects(code, level, value, id)
Task: Retrieve code from employees with value above the SUM(amount) of projects rows sharing the same level.
SQL: | SELECT code FROM employees AS emp
WHERE value > (
SELECT SUM(amount) FROM projects AS prj
WHERE prj.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "projects",
"outer_alias": "emp",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00192 | train |
v2 | Schema:
sales (alias: sale)(value, date, salary, level)
shipments(code, status, salary, date)
Task: Retrieve code from sales that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00193 | train |
v1 | Schema:
categories (alias: catg)(date, status, name, code)
employees(status, type, code, amount)
Task: Retrieve id from categories whose status is found in employees rows where code matches the outer record.
SQL: | SELECT id FROM categories AS catg
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00194 | train |
v1 | Schema:
products (alias: prod)(date, type, level, status)
departments(value, date, amount, code)
Task: Select id from products where id exists in departments for the same id.
SQL: | SELECT id FROM products AS prod
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.id = prod.id
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00195 | train |
v1 | Schema:
customers (alias: cust)(amount, salary, date, name)
regions(id, level, status, type)
Task: Find salary from customers where level appears in regions entries with matching id.
SQL: | SELECT salary FROM customers AS cust
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00196 | train |
v3 | Schema:
categories (alias: catg)(name, date, code, amount)
schedules(name, status, salary, id)
Task: Retrieve salary from categories with salary above the MAX(value) of schedules rows sharing the same code.
SQL: | SELECT salary FROM categories AS catg
WHERE salary > (
SELECT MAX(value) FROM schedules AS schd
WHERE schd.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00197 | train |
v1 | Schema:
employees (alias: emp)(amount, salary, status, name)
branches(salary, type, level, amount)
Task: Find amount from employees where status appears in branches entries with matching status.
SQL: | SELECT amount FROM employees AS emp
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00198 | train |
v3 | Schema:
regions (alias: rgn)(amount, date, level, salary)
requests(level, value, date, id)
Task: Retrieve code from regions with value above the MIN(value) of requests rows sharing the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE value > (
SELECT MIN(value) FROM requests AS ordr
WHERE ordr.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00199 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.