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:
employees (alias: emp)(date, amount, id, code)
managers(status, salary, name, value)
Task: Find code from employees where status appears in managers entries with matching type.
SQL: | SELECT code FROM employees AS emp
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17200 | train |
v3 | Schema:
orders (alias: ord)(name, status, id, level)
managers(salary, type, amount, id)
Task: Find code from orders where amount exceeds the maximum value from managers for the same status.
SQL: | SELECT code FROM orders AS ord
WHERE amount > (
SELECT MAX(value) FROM managers AS mgr
WHERE mgr.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17201 | train |
v1 | Schema:
shipments (alias: shp)(amount, name, salary, code)
regions(code, type, value, salary)
Task: Find id from shipments where code appears in regions entries with matching status.
SQL: | SELECT id FROM shipments AS shp
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17202 | train |
v1 | Schema:
requests (alias: ordr)(id, code, value, name)
categories(amount, salary, code, date)
Task: Retrieve value from requests whose id is found in categories rows where code matches the outer record.
SQL: | SELECT value FROM requests AS ordr
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17203 | train |
v1 | Schema:
branches (alias: brc)(salary, date, level, amount)
tasks(status, salary, date, id)
Task: Find id from branches where status appears in tasks entries with matching type.
SQL: | SELECT id FROM branches AS brc
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17204 | train |
v1 | Schema:
projects (alias: prj)(name, id, date, amount)
employees(name, salary, amount, status)
Task: Retrieve amount from projects whose id is found in employees rows where type matches the outer record.
SQL: | SELECT amount FROM projects AS prj
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17205 | train |
v2 | Schema:
managers (alias: mgr)(status, level, id, date)
customers(name, level, value, id)
Task: Retrieve code from managers that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17206 | train |
v3 | Schema:
invoices (alias: inv)(level, date, status, amount)
managers(id, salary, name, amount)
Task: Retrieve value from invoices with salary above the COUNT(amount) of managers rows sharing the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE salary > (
SELECT COUNT(amount) FROM managers AS mgr
WHERE mgr.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17207 | train |
v3 | Schema:
departments (alias: dept)(date, salary, id, type)
managers(salary, value, amount, name)
Task: Find amount from departments where value exceeds the minimum amount from managers for the same level.
SQL: | SELECT amount FROM departments AS dept
WHERE value > (
SELECT MIN(amount) FROM managers AS mgr
WHERE mgr.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17208 | train |
v3 | Schema:
departments (alias: dept)(code, value, status, name)
managers(code, date, id, salary)
Task: Retrieve amount from departments with salary above the SUM(amount) of managers rows sharing the same status.
SQL: | SELECT amount FROM departments AS dept
WHERE salary > (
SELECT SUM(amount) FROM managers AS mgr
WHERE mgr.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17209 | train |
v3 | Schema:
invoices (alias: inv)(date, salary, level, value)
departments(name, date, value, amount)
Task: Retrieve id from invoices with value above the MAX(salary) of departments rows sharing the same type.
SQL: | SELECT id FROM invoices AS inv
WHERE value > (
SELECT MAX(salary) FROM departments AS dept
WHERE dept.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17210 | train |
v1 | Schema:
accounts (alias: acct)(id, type, name, date)
projects(code, name, salary, value)
Task: Find amount from accounts where code appears in projects entries with matching type.
SQL: | SELECT amount FROM accounts AS acct
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17211 | train |
v1 | Schema:
accounts (alias: acct)(status, level, salary, value)
departments(type, id, date, amount)
Task: Retrieve name from accounts whose status is found in departments rows where id matches the outer record.
SQL: | SELECT name FROM accounts AS acct
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17212 | train |
v3 | Schema:
managers (alias: mgr)(date, type, amount, code)
transactions(status, name, amount, code)
Task: Find id from managers where salary exceeds the total value from transactions for the same type.
SQL: | SELECT id FROM managers AS mgr
WHERE salary > (
SELECT SUM(value) FROM transactions AS txn
WHERE txn.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17213 | train |
v3 | Schema:
orders (alias: ord)(status, name, date, level)
employees(date, amount, status, type)
Task: Find code from orders where salary exceeds the average salary from employees for the same type.
SQL: | SELECT code FROM orders AS ord
WHERE salary > (
SELECT AVG(salary) FROM employees AS emp
WHERE emp.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17214 | train |
v1 | Schema:
sales (alias: sale)(id, name, value, salary)
transactions(type, salary, status, name)
Task: Select salary from sales where level exists in transactions for the same status.
SQL: | SELECT salary FROM sales AS sale
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17215 | train |
v1 | Schema:
sales (alias: sale)(amount, level, status, code)
categories(name, id, date, status)
Task: Find name from sales where level appears in categories entries with matching id.
SQL: | SELECT name FROM sales AS sale
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17216 | train |
v3 | Schema:
customers (alias: cust)(status, salary, level, type)
products(type, level, salary, status)
Task: Find amount from customers where salary exceeds the maximum value from products for the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE salary > (
SELECT MAX(value) FROM products AS prod
WHERE prod.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17217 | train |
v1 | Schema:
departments (alias: dept)(name, code, salary, value)
products(code, status, value, salary)
Task: Find code from departments where code appears in products entries with matching status.
SQL: | SELECT code FROM departments AS dept
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17218 | train |
v2 | Schema:
requests (alias: ordr)(salary, date, id, level)
regions(date, name, status, level)
Task: Find amount from requests where a matching record exists in regions with the same level.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17219 | train |
v3 | Schema:
accounts (alias: acct)(type, id, status, date)
projects(value, type, amount, name)
Task: Find code from accounts where salary exceeds the minimum amount from projects for the same status.
SQL: | SELECT code FROM accounts AS acct
WHERE salary > (
SELECT MIN(amount) FROM projects AS prj
WHERE prj.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17220 | train |
v1 | Schema:
staff (alias: empl)(type, id, status, date)
products(value, salary, level, type)
Task: Retrieve amount from staff whose type is found in products rows where status matches the outer record.
SQL: | SELECT amount FROM staff AS empl
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17221 | train |
v3 | Schema:
branches (alias: brc)(id, value, salary, name)
schedules(name, value, amount, salary)
Task: Find salary from branches where salary exceeds the average amount from schedules for the same code.
SQL: | SELECT salary FROM branches AS brc
WHERE salary > (
SELECT AVG(amount) FROM schedules AS schd
WHERE schd.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "schedules",
"outer_alias": "brc",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17222 | train |
v3 | Schema:
transactions (alias: txn)(id, salary, value, type)
requests(salary, status, type, code)
Task: Retrieve id from transactions with salary above the MIN(salary) of requests rows sharing the same code.
SQL: | SELECT id FROM transactions AS txn
WHERE salary > (
SELECT MIN(salary) FROM requests AS ordr
WHERE ordr.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17223 | train |
v3 | Schema:
schedules (alias: schd)(code, status, type, level)
orders(id, date, level, amount)
Task: Retrieve amount from schedules with amount above the MIN(salary) of orders rows sharing the same type.
SQL: | SELECT amount FROM schedules AS schd
WHERE amount > (
SELECT MIN(salary) FROM orders AS ord
WHERE ord.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17224 | train |
v2 | Schema:
invoices (alias: inv)(salary, amount, date, id)
departments(salary, level, amount, value)
Task: Find id from invoices where a matching record exists in departments with the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17225 | train |
v3 | Schema:
sales (alias: sale)(id, salary, type, code)
employees(name, level, date, salary)
Task: Find code from sales where salary exceeds the average amount from employees for the same code.
SQL: | SELECT code FROM sales AS sale
WHERE salary > (
SELECT AVG(amount) FROM employees AS emp
WHERE emp.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17226 | train |
v3 | Schema:
orders (alias: ord)(type, status, date, code)
regions(name, code, id, amount)
Task: Find amount from orders where amount exceeds the average salary from regions for the same id.
SQL: | SELECT amount FROM orders AS ord
WHERE amount > (
SELECT AVG(salary) FROM regions AS rgn
WHERE rgn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17227 | train |
v1 | Schema:
shipments (alias: shp)(level, name, salary, type)
schedules(name, code, status, type)
Task: Find id from shipments where level appears in schedules entries with matching level.
SQL: | SELECT id FROM shipments AS shp
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17228 | train |
v2 | Schema:
items (alias: lne)(status, level, type, name)
managers(type, amount, name, id)
Task: Retrieve code from items that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = lne.status
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17229 | train |
v3 | Schema:
regions (alias: rgn)(level, name, id, code)
sales(date, salary, value, type)
Task: Retrieve value from regions with amount above the SUM(amount) of sales rows sharing the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE amount > (
SELECT SUM(amount) FROM sales AS sale
WHERE sale.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17230 | train |
v1 | Schema:
orders (alias: ord)(value, salary, date, level)
accounts(date, code, id, salary)
Task: Select id from orders where id exists in accounts for the same type.
SQL: | SELECT id FROM orders AS ord
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17231 | train |
v3 | Schema:
sales (alias: sale)(level, date, type, salary)
items(code, status, name, date)
Task: Retrieve amount from sales with salary above the AVG(amount) of items rows sharing the same id.
SQL: | SELECT amount FROM sales AS sale
WHERE salary > (
SELECT AVG(amount) FROM items AS lne
WHERE lne.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17232 | train |
v2 | Schema:
sales (alias: sale)(amount, salary, code, type)
departments(name, level, status, value)
Task: Retrieve value from sales that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17233 | train |
v3 | Schema:
branches (alias: brc)(date, type, code, name)
categories(amount, date, code, type)
Task: Find salary from branches where amount exceeds the total value from categories for the same level.
SQL: | SELECT salary FROM branches AS brc
WHERE amount > (
SELECT SUM(value) FROM categories AS catg
WHERE catg.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17234 | train |
v2 | Schema:
requests (alias: ordr)(status, id, name, value)
tasks(date, level, status, salary)
Task: Find amount from requests where a matching record exists in tasks with the same type.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17235 | train |
v2 | Schema:
schedules (alias: schd)(level, amount, value, code)
tasks(amount, type, id, code)
Task: Find name from schedules where a matching record exists in tasks with the same code.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17236 | train |
v3 | Schema:
requests (alias: ordr)(date, code, name, level)
schedules(status, amount, name, level)
Task: Find name from requests where amount exceeds the total value from schedules for the same status.
SQL: | SELECT name FROM requests AS ordr
WHERE amount > (
SELECT SUM(value) FROM schedules AS schd
WHERE schd.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17237 | train |
v1 | Schema:
departments (alias: dept)(status, amount, name, salary)
orders(value, salary, code, status)
Task: Retrieve id from departments whose id is found in orders rows where id matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17238 | train |
v3 | Schema:
sales (alias: sale)(type, status, amount, salary)
shipments(salary, level, id, name)
Task: Retrieve id from sales with salary above the SUM(salary) of shipments rows sharing the same type.
SQL: | SELECT id FROM sales AS sale
WHERE salary > (
SELECT SUM(salary) FROM shipments AS shp
WHERE shp.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17239 | train |
v1 | Schema:
tasks (alias: tsk)(name, id, code, status)
regions(name, id, status, date)
Task: Find id from tasks where code appears in regions entries with matching status.
SQL: | SELECT id FROM tasks AS tsk
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17240 | train |
v3 | Schema:
departments (alias: dept)(salary, date, code, value)
sales(name, date, status, type)
Task: Find code from departments where amount exceeds the minimum value from sales for the same code.
SQL: | SELECT code FROM departments AS dept
WHERE amount > (
SELECT MIN(value) FROM sales AS sale
WHERE sale.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17241 | train |
v1 | Schema:
tasks (alias: tsk)(amount, value, name, level)
transactions(status, date, id, value)
Task: Retrieve code from tasks whose level is found in transactions rows where type matches the outer record.
SQL: | SELECT code FROM tasks AS tsk
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17242 | train |
v2 | Schema:
sales (alias: sale)(name, level, id, salary)
categories(level, salary, name, status)
Task: Find salary from sales where a matching record exists in categories with the same status.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17243 | train |
v2 | Schema:
accounts (alias: acct)(date, salary, level, type)
customers(type, status, level, code)
Task: Retrieve amount from accounts that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17244 | train |
v3 | Schema:
shipments (alias: shp)(id, level, value, salary)
employees(level, type, status, value)
Task: Find id from shipments where amount exceeds the maximum salary from employees for the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE amount > (
SELECT MAX(salary) FROM employees AS emp
WHERE emp.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17245 | train |
v2 | Schema:
requests (alias: ordr)(status, id, date, value)
schedules(code, status, salary, amount)
Task: Retrieve name from requests that have at least one corresponding entry in schedules sharing the same id.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17246 | train |
v1 | Schema:
sales (alias: sale)(code, level, value, id)
departments(code, id, value, name)
Task: Retrieve salary from sales whose level is found in departments rows where level matches the outer record.
SQL: | SELECT salary FROM sales AS sale
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17247 | train |
v3 | Schema:
shipments (alias: shp)(amount, salary, status, date)
managers(salary, level, code, value)
Task: Retrieve value from shipments with value above the MIN(amount) of managers rows sharing the same type.
SQL: | SELECT value FROM shipments AS shp
WHERE value > (
SELECT MIN(amount) FROM managers AS mgr
WHERE mgr.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17248 | train |
v3 | Schema:
branches (alias: brc)(id, value, name, date)
customers(date, type, status, id)
Task: Retrieve name from branches with value above the MIN(value) of customers rows sharing the same type.
SQL: | SELECT name FROM branches AS brc
WHERE value > (
SELECT MIN(value) FROM customers AS cust
WHERE cust.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17249 | train |
v3 | Schema:
staff (alias: empl)(code, type, level, name)
projects(code, salary, amount, date)
Task: Find code from staff where salary exceeds the maximum amount from projects for the same type.
SQL: | SELECT code FROM staff AS empl
WHERE salary > (
SELECT MAX(amount) FROM projects AS prj
WHERE prj.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17250 | train |
v3 | Schema:
products (alias: prod)(amount, value, code, name)
categories(type, salary, value, amount)
Task: Find id from products where amount exceeds the count of amount from categories for the same id.
SQL: | SELECT id FROM products AS prod
WHERE amount > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.id = prod.id
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17251 | train |
v3 | Schema:
tasks (alias: tsk)(status, amount, level, value)
transactions(name, date, value, id)
Task: Find salary from tasks where amount exceeds the minimum salary from transactions for the same id.
SQL: | SELECT salary FROM tasks AS tsk
WHERE amount > (
SELECT MIN(salary) FROM transactions AS txn
WHERE txn.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17252 | train |
v3 | Schema:
regions (alias: rgn)(level, date, amount, status)
customers(code, level, amount, date)
Task: Find code from regions where salary exceeds the minimum amount from customers for the same level.
SQL: | SELECT code FROM regions AS rgn
WHERE salary > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17253 | train |
v3 | Schema:
categories (alias: catg)(amount, level, value, id)
accounts(status, salary, id, code)
Task: Retrieve name from categories with salary above the AVG(value) of accounts rows sharing the same type.
SQL: | SELECT name FROM categories AS catg
WHERE salary > (
SELECT AVG(value) FROM accounts AS acct
WHERE acct.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17254 | train |
v1 | Schema:
requests (alias: ordr)(name, id, level, amount)
projects(id, status, name, code)
Task: Retrieve salary from requests whose status is found in projects rows where code matches the outer record.
SQL: | SELECT salary FROM requests AS ordr
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17255 | train |
v1 | Schema:
branches (alias: brc)(level, date, value, salary)
products(code, value, name, amount)
Task: Select amount from branches where type exists in products for the same status.
SQL: | SELECT amount FROM branches AS brc
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17256 | train |
v1 | Schema:
departments (alias: dept)(level, type, amount, salary)
schedules(date, type, salary, id)
Task: Retrieve value from departments whose level is found in schedules rows where type matches the outer record.
SQL: | SELECT value FROM departments AS dept
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17257 | train |
v3 | Schema:
categories (alias: catg)(level, id, value, type)
departments(code, amount, value, salary)
Task: Retrieve amount from categories with salary above the SUM(salary) of departments rows sharing the same level.
SQL: | SELECT amount FROM categories AS catg
WHERE salary > (
SELECT SUM(salary) FROM departments AS dept
WHERE dept.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17258 | train |
v3 | Schema:
orders (alias: ord)(name, code, value, level)
employees(status, id, code, type)
Task: Retrieve amount from orders with salary above the COUNT(amount) of employees rows sharing the same status.
SQL: | SELECT amount FROM orders AS ord
WHERE salary > (
SELECT COUNT(amount) FROM employees AS emp
WHERE emp.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17259 | train |
v2 | Schema:
shipments (alias: shp)(code, value, amount, salary)
sales(type, salary, value, date)
Task: Retrieve code from shipments that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17260 | train |
v1 | Schema:
requests (alias: ordr)(level, value, salary, code)
transactions(id, date, level, status)
Task: Select salary from requests where status exists in transactions for the same id.
SQL: | SELECT salary FROM requests AS ordr
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17261 | train |
v1 | Schema:
categories (alias: catg)(id, amount, status, value)
transactions(name, value, salary, id)
Task: Select name from categories where status exists in transactions for the same type.
SQL: | SELECT name FROM categories AS catg
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17262 | train |
v1 | Schema:
projects (alias: prj)(amount, code, status, level)
categories(value, id, amount, code)
Task: Select name from projects where level exists in categories for the same status.
SQL: | SELECT name FROM projects AS prj
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17263 | train |
v3 | Schema:
customers (alias: cust)(salary, level, date, status)
projects(salary, type, id, amount)
Task: Retrieve value from customers with amount above the SUM(value) of projects rows sharing the same code.
SQL: | SELECT value FROM customers AS cust
WHERE amount > (
SELECT SUM(value) FROM projects AS prj
WHERE prj.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17264 | train |
v1 | Schema:
projects (alias: prj)(date, value, id, level)
items(salary, value, id, amount)
Task: Find value from projects where type appears in items entries with matching code.
SQL: | SELECT value FROM projects AS prj
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17265 | train |
v1 | Schema:
products (alias: prod)(id, date, level, value)
managers(salary, type, id, name)
Task: Retrieve salary from products whose code is found in managers rows where code matches the outer record.
SQL: | SELECT salary FROM products AS prod
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.code = prod.code
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17266 | train |
v1 | Schema:
projects (alias: prj)(amount, type, name, id)
regions(code, amount, level, type)
Task: Retrieve id from projects whose level is found in regions rows where code matches the outer record.
SQL: | SELECT id FROM projects AS prj
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17267 | train |
v3 | Schema:
tasks (alias: tsk)(salary, amount, name, code)
managers(value, code, amount, name)
Task: Find id from tasks where value exceeds the average amount from managers for the same status.
SQL: | SELECT id FROM tasks AS tsk
WHERE value > (
SELECT AVG(amount) FROM managers AS mgr
WHERE mgr.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17268 | train |
v1 | Schema:
staff (alias: empl)(id, level, value, salary)
managers(date, value, type, level)
Task: Retrieve salary from staff whose status is found in managers rows where type matches the outer record.
SQL: | SELECT salary FROM staff AS empl
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17269 | train |
v2 | Schema:
employees (alias: emp)(status, value, salary, date)
sales(level, status, amount, value)
Task: Find value from employees where a matching record exists in sales with the same level.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17270 | train |
v2 | Schema:
customers (alias: cust)(value, salary, amount, type)
managers(date, value, salary, type)
Task: Retrieve salary from customers that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17271 | train |
v3 | Schema:
managers (alias: mgr)(value, salary, type, status)
accounts(level, status, amount, code)
Task: Retrieve value from managers with amount above the MIN(salary) of accounts rows sharing the same status.
SQL: | SELECT value FROM managers AS mgr
WHERE amount > (
SELECT MIN(salary) FROM accounts AS acct
WHERE acct.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17272 | train |
v1 | Schema:
invoices (alias: inv)(code, level, amount, salary)
products(salary, date, name, type)
Task: Find amount from invoices where id appears in products entries with matching code.
SQL: | SELECT amount FROM invoices AS inv
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17273 | train |
v1 | Schema:
accounts (alias: acct)(salary, value, type, name)
managers(name, salary, code, status)
Task: Select id from accounts where code exists in managers for the same level.
SQL: | SELECT id FROM accounts AS acct
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17274 | train |
v1 | Schema:
products (alias: prod)(salary, id, type, level)
customers(salary, code, date, name)
Task: Select name from products where id exists in customers for the same level.
SQL: | SELECT name FROM products AS prod
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.level = prod.level
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17275 | train |
v2 | Schema:
schedules (alias: schd)(id, amount, name, salary)
transactions(type, salary, amount, level)
Task: Retrieve code from schedules that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17276 | train |
v3 | Schema:
categories (alias: catg)(code, id, amount, name)
sales(salary, value, code, type)
Task: Retrieve amount from categories with salary above the COUNT(value) of sales rows sharing the same type.
SQL: | SELECT amount FROM categories AS catg
WHERE salary > (
SELECT COUNT(value) FROM sales AS sale
WHERE sale.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17277 | train |
v3 | Schema:
products (alias: prod)(date, value, type, status)
transactions(salary, name, value, level)
Task: Find amount from products where value exceeds the total value from transactions for the same status.
SQL: | SELECT amount FROM products AS prod
WHERE value > (
SELECT SUM(value) FROM transactions AS txn
WHERE txn.status = prod.status
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17278 | train |
v2 | Schema:
requests (alias: ordr)(type, salary, name, date)
sales(name, amount, id, type)
Task: Retrieve amount from requests that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17279 | train |
v3 | Schema:
invoices (alias: inv)(salary, name, status, id)
staff(date, level, code, value)
Task: Find name from invoices where amount exceeds the count of amount from staff for the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE amount > (
SELECT COUNT(amount) FROM staff AS empl
WHERE empl.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17280 | train |
v3 | Schema:
departments (alias: dept)(code, type, id, date)
sales(code, type, id, value)
Task: Retrieve id from departments with amount above the COUNT(value) of sales rows sharing the same id.
SQL: | SELECT id FROM departments AS dept
WHERE amount > (
SELECT COUNT(value) FROM sales AS sale
WHERE sale.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17281 | train |
v1 | Schema:
sales (alias: sale)(name, type, salary, value)
staff(type, level, name, status)
Task: Retrieve name from sales whose id is found in staff rows where level matches the outer record.
SQL: | SELECT name FROM sales AS sale
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17282 | train |
v1 | Schema:
requests (alias: ordr)(code, status, amount, value)
customers(amount, type, date, status)
Task: Retrieve id from requests whose type is found in customers rows where id matches the outer record.
SQL: | SELECT id FROM requests AS ordr
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17283 | train |
v2 | Schema:
schedules (alias: schd)(status, salary, level, id)
transactions(id, status, date, amount)
Task: Retrieve value from schedules that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17284 | train |
v2 | Schema:
tasks (alias: tsk)(salary, value, name, type)
sales(status, amount, value, salary)
Task: Retrieve name from tasks that have at least one corresponding entry in sales sharing the same status.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17285 | train |
v1 | Schema:
projects (alias: prj)(level, date, status, salary)
managers(code, id, type, salary)
Task: Select amount from projects where type exists in managers for the same code.
SQL: | SELECT amount FROM projects AS prj
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17286 | train |
v3 | Schema:
managers (alias: mgr)(level, salary, code, amount)
projects(value, status, name, level)
Task: Retrieve id from managers with amount above the MIN(salary) of projects rows sharing the same type.
SQL: | SELECT id FROM managers AS mgr
WHERE amount > (
SELECT MIN(salary) FROM projects AS prj
WHERE prj.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17287 | train |
v1 | Schema:
branches (alias: brc)(date, status, amount, id)
invoices(type, level, status, code)
Task: Find code from branches where id appears in invoices entries with matching code.
SQL: | SELECT code FROM branches AS brc
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17288 | train |
v2 | Schema:
regions (alias: rgn)(level, type, code, value)
items(status, level, id, salary)
Task: Find id from regions where a matching record exists in items with the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17289 | train |
v2 | Schema:
employees (alias: emp)(type, name, level, amount)
regions(date, salary, code, status)
Task: Retrieve id from employees that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17290 | train |
v1 | Schema:
requests (alias: ordr)(amount, name, type, id)
sales(value, level, name, status)
Task: Select value from requests where id exists in sales for the same level.
SQL: | SELECT value FROM requests AS ordr
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17291 | train |
v1 | Schema:
tasks (alias: tsk)(type, level, value, amount)
employees(amount, name, type, salary)
Task: Select name from tasks where level exists in employees for the same status.
SQL: | SELECT name FROM tasks AS tsk
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "tsk",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17292 | train |
v3 | Schema:
requests (alias: ordr)(id, date, type, status)
transactions(value, status, name, salary)
Task: Find name from requests where amount exceeds the count of amount from transactions for the same level.
SQL: | SELECT name FROM requests AS ordr
WHERE amount > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17293 | train |
v2 | Schema:
categories (alias: catg)(code, id, type, level)
managers(date, amount, value, name)
Task: Find salary from categories where a matching record exists in managers with the same level.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17294 | train |
v1 | Schema:
categories (alias: catg)(level, name, value, date)
managers(type, amount, id, value)
Task: Retrieve amount from categories whose level is found in managers rows where code matches the outer record.
SQL: | SELECT amount FROM categories AS catg
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17295 | train |
v2 | Schema:
branches (alias: brc)(status, salary, id, name)
staff(date, status, id, salary)
Task: Retrieve salary from branches that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17296 | train |
v1 | Schema:
tasks (alias: tsk)(type, status, salary, value)
categories(date, amount, id, value)
Task: Find value from tasks where status appears in categories entries with matching type.
SQL: | SELECT value FROM tasks AS tsk
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17297 | train |
v2 | Schema:
items (alias: lne)(salary, id, amount, date)
categories(status, value, level, date)
Task: Find salary from items where a matching record exists in categories with the same id.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = lne.id
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17298 | train |
v2 | Schema:
shipments (alias: shp)(status, salary, value, type)
managers(code, salary, type, amount)
Task: Retrieve code from shipments that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17299 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.