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 |
|---|---|---|---|---|---|---|
v2 | Schema:
managers (alias: mgr)(id, value, name, code)
departments(date, salary, name, code)
Task: Retrieve id from managers that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15600 | train |
v2 | Schema:
schedules (alias: schd)(date, status, type, salary)
tasks(salary, date, level, id)
Task: Find id from schedules where a matching record exists in tasks with the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15601 | train |
v3 | Schema:
invoices (alias: inv)(date, status, type, amount)
requests(type, code, date, name)
Task: Find code from invoices where value exceeds the average value from requests for the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE value > (
SELECT AVG(value) FROM requests AS ordr
WHERE ordr.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15602 | train |
v3 | Schema:
employees (alias: emp)(code, status, level, type)
transactions(name, type, amount, id)
Task: Retrieve value from employees with salary above the MAX(salary) of transactions rows sharing the same status.
SQL: | SELECT value FROM employees AS emp
WHERE salary > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15603 | train |
v3 | Schema:
transactions (alias: txn)(date, level, status, value)
staff(value, salary, name, amount)
Task: Retrieve code from transactions with value above the MIN(salary) of staff rows sharing the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE value > (
SELECT MIN(salary) FROM staff AS empl
WHERE empl.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15604 | train |
v2 | Schema:
departments (alias: dept)(type, amount, id, salary)
sales(name, status, level, id)
Task: Retrieve id from departments that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15605 | train |
v1 | Schema:
staff (alias: empl)(date, salary, name, value)
employees(date, id, salary, amount)
Task: Retrieve amount from staff whose type is found in employees rows where status matches the outer record.
SQL: | SELECT amount FROM staff AS empl
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15606 | train |
v2 | Schema:
tasks (alias: tsk)(code, level, value, type)
transactions(status, amount, date, value)
Task: Find value from tasks where a matching record exists in transactions with the same code.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_15607 | train |
v3 | Schema:
transactions (alias: txn)(id, amount, salary, status)
staff(salary, amount, status, level)
Task: Find amount from transactions where value exceeds the count of salary from staff for the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE value > (
SELECT COUNT(salary) FROM staff AS empl
WHERE empl.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15608 | train |
v1 | Schema:
branches (alias: brc)(code, level, id, date)
customers(code, status, value, amount)
Task: Find id from branches where code appears in customers entries with matching level.
SQL: | SELECT id FROM branches AS brc
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_15609 | train |
v1 | Schema:
requests (alias: ordr)(name, date, code, amount)
orders(salary, level, amount, value)
Task: Find salary from requests where id appears in orders entries with matching code.
SQL: | SELECT salary FROM requests AS ordr
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_15610 | train |
v2 | Schema:
schedules (alias: schd)(salary, amount, type, value)
products(name, date, status, code)
Task: Retrieve code from schedules that have at least one corresponding entry in products sharing the same status.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15611 | train |
v2 | Schema:
employees (alias: emp)(type, level, value, id)
departments(date, id, amount, name)
Task: Find salary from employees where a matching record exists in departments with the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15612 | train |
v1 | Schema:
regions (alias: rgn)(id, code, value, amount)
departments(amount, id, type, status)
Task: Select value from regions where type exists in departments for the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_15613 | train |
v1 | Schema:
accounts (alias: acct)(value, level, code, date)
requests(name, date, salary, amount)
Task: Find amount from accounts where code appears in requests entries with matching id.
SQL: | SELECT amount FROM accounts AS acct
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15614 | train |
v1 | Schema:
staff (alias: empl)(id, name, type, amount)
accounts(date, id, amount, type)
Task: Find amount from staff where type appears in accounts entries with matching level.
SQL: | SELECT amount FROM staff AS empl
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15615 | train |
v3 | Schema:
categories (alias: catg)(name, amount, date, type)
orders(date, id, name, status)
Task: Retrieve name from categories with salary above the MAX(amount) of orders rows sharing the same id.
SQL: | SELECT name FROM categories AS catg
WHERE salary > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15616 | train |
v1 | Schema:
tasks (alias: tsk)(salary, code, type, amount)
customers(date, code, name, status)
Task: Find id from tasks where status appears in customers entries with matching status.
SQL: | SELECT id FROM tasks AS tsk
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "tsk",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_15617 | train |
v3 | Schema:
products (alias: prod)(salary, amount, code, status)
requests(name, type, value, id)
Task: Retrieve id from products with amount above the MIN(salary) of requests rows sharing the same type.
SQL: | SELECT id FROM products AS prod
WHERE amount > (
SELECT MIN(salary) FROM requests AS ordr
WHERE ordr.type = prod.type
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15618 | train |
v2 | Schema:
categories (alias: catg)(code, level, amount, id)
departments(code, name, status, level)
Task: Find salary from categories where a matching record exists in departments with the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15619 | train |
v1 | Schema:
staff (alias: empl)(id, level, date, value)
departments(value, amount, salary, code)
Task: Select id from staff where status exists in departments for the same id.
SQL: | SELECT id FROM staff AS empl
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15620 | train |
v1 | Schema:
requests (alias: ordr)(type, id, level, date)
sales(date, type, amount, name)
Task: Retrieve id from requests whose level is found in sales rows where code matches the outer record.
SQL: | SELECT id FROM requests AS ordr
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_15621 | train |
v2 | Schema:
sales (alias: sale)(type, code, name, date)
customers(type, date, level, name)
Task: Retrieve value from sales that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15622 | train |
v2 | Schema:
requests (alias: ordr)(salary, level, date, type)
departments(status, level, code, type)
Task: Retrieve code from requests that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_15623 | train |
v2 | Schema:
regions (alias: rgn)(date, status, salary, id)
orders(level, id, type, amount)
Task: Find amount from regions where a matching record exists in orders with the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_15624 | train |
v3 | Schema:
transactions (alias: txn)(status, id, level, salary)
employees(code, date, salary, id)
Task: Retrieve id from transactions with salary above the SUM(value) of employees rows sharing the same type.
SQL: | SELECT id FROM transactions AS txn
WHERE salary > (
SELECT SUM(value) FROM employees AS emp
WHERE emp.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15625 | train |
v2 | Schema:
customers (alias: cust)(id, status, value, type)
branches(type, id, value, salary)
Task: Retrieve value from customers that have at least one corresponding entry in branches sharing the same level.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "branches",
"outer_alias": "cust",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15626 | train |
v1 | Schema:
schedules (alias: schd)(level, name, status, salary)
requests(date, name, id, type)
Task: Select amount from schedules where status exists in requests for the same level.
SQL: | SELECT amount FROM schedules AS schd
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15627 | train |
v3 | Schema:
transactions (alias: txn)(code, level, value, name)
staff(status, code, salary, amount)
Task: Retrieve name from transactions with amount above the SUM(salary) of staff rows sharing the same level.
SQL: | SELECT name FROM transactions AS txn
WHERE amount > (
SELECT SUM(salary) FROM staff AS empl
WHERE empl.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15628 | train |
v3 | Schema:
products (alias: prod)(type, value, date, name)
schedules(level, type, date, id)
Task: Retrieve value from products with value above the AVG(value) of schedules rows sharing the same status.
SQL: | SELECT value FROM products AS prod
WHERE value > (
SELECT AVG(value) FROM schedules AS schd
WHERE schd.status = prod.status
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15629 | train |
v1 | Schema:
invoices (alias: inv)(id, name, amount, level)
staff(name, date, level, amount)
Task: Find amount from invoices where status appears in staff entries with matching status.
SQL: | SELECT amount FROM invoices AS inv
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15630 | train |
v2 | Schema:
schedules (alias: schd)(salary, level, date, name)
requests(code, name, status, amount)
Task: Retrieve salary from schedules that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15631 | train |
v1 | Schema:
requests (alias: ordr)(value, level, id, name)
invoices(level, value, code, amount)
Task: Find salary from requests where id appears in invoices entries with matching code.
SQL: | SELECT salary FROM requests AS ordr
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_15632 | train |
v2 | Schema:
orders (alias: ord)(status, id, name, amount)
schedules(salary, id, name, level)
Task: Retrieve salary from orders that have at least one corresponding entry in schedules sharing the same level.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15633 | train |
v1 | Schema:
schedules (alias: schd)(value, level, status, code)
sales(amount, level, salary, name)
Task: Retrieve value from schedules whose id is found in sales rows where type matches the outer record.
SQL: | SELECT value FROM schedules AS schd
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15634 | train |
v2 | Schema:
employees (alias: emp)(date, code, status, value)
regions(name, id, value, code)
Task: Retrieve name from employees that have at least one corresponding entry in regions sharing the same code.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15635 | train |
v1 | Schema:
products (alias: prod)(type, date, status, amount)
employees(status, level, amount, code)
Task: Retrieve id from products whose status is found in employees rows where status matches the outer record.
SQL: | SELECT id FROM products AS prod
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.status = prod.status
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15636 | train |
v2 | Schema:
employees (alias: emp)(value, amount, id, date)
staff(level, amount, value, id)
Task: Retrieve name from employees that have at least one corresponding entry in staff sharing the same type.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15637 | train |
v2 | Schema:
projects (alias: prj)(level, name, type, code)
requests(date, id, level, value)
Task: Retrieve name from projects that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15638 | train |
v1 | Schema:
schedules (alias: schd)(status, salary, id, type)
regions(name, amount, code, salary)
Task: Find id from schedules where type appears in regions entries with matching level.
SQL: | SELECT id FROM schedules AS schd
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15639 | train |
v1 | Schema:
invoices (alias: inv)(name, value, type, code)
managers(code, date, id, salary)
Task: Select salary from invoices where level exists in managers for the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15640 | train |
v3 | Schema:
departments (alias: dept)(name, code, level, amount)
categories(code, id, amount, salary)
Task: Find name from departments where amount exceeds the average value from categories for the same level.
SQL: | SELECT name FROM departments AS dept
WHERE amount > (
SELECT AVG(value) FROM categories AS catg
WHERE catg.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15641 | train |
v3 | Schema:
transactions (alias: txn)(salary, amount, date, type)
managers(date, name, status, code)
Task: Retrieve value from transactions with value above the AVG(value) of managers rows sharing the same code.
SQL: | SELECT value FROM transactions AS txn
WHERE value > (
SELECT AVG(value) FROM managers AS mgr
WHERE mgr.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15642 | train |
v3 | Schema:
managers (alias: mgr)(status, level, name, date)
projects(level, id, value, date)
Task: Retrieve code from managers with salary above the MIN(salary) of projects rows sharing the same code.
SQL: | SELECT code FROM managers AS mgr
WHERE salary > (
SELECT MIN(salary) FROM projects AS prj
WHERE prj.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15643 | train |
v1 | Schema:
categories (alias: catg)(date, amount, value, code)
shipments(code, salary, name, amount)
Task: Find id from categories where status appears in shipments entries with matching status.
SQL: | SELECT id FROM categories AS catg
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15644 | train |
v2 | Schema:
shipments (alias: shp)(type, code, date, amount)
employees(date, name, amount, salary)
Task: Find id from shipments where a matching record exists in employees with the same id.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15645 | train |
v1 | Schema:
branches (alias: brc)(name, status, code, value)
products(salary, status, value, date)
Task: Find amount from branches where level appears in products entries with matching id.
SQL: | SELECT amount FROM branches AS brc
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_15646 | train |
v3 | Schema:
categories (alias: catg)(id, type, amount, salary)
invoices(id, amount, name, code)
Task: Find code from categories where amount exceeds the minimum amount from invoices for the same status.
SQL: | SELECT code FROM categories AS catg
WHERE amount > (
SELECT MIN(amount) FROM invoices AS inv
WHERE inv.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15647 | train |
v1 | Schema:
shipments (alias: shp)(salary, id, type, status)
items(amount, name, id, code)
Task: Retrieve code from shipments whose id is found in items rows where status matches the outer record.
SQL: | SELECT code FROM shipments AS shp
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15648 | train |
v2 | Schema:
items (alias: lne)(value, date, type, amount)
staff(id, value, date, type)
Task: Find value from items where a matching record exists in staff with the same type.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = lne.type
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_15649 | train |
v1 | Schema:
accounts (alias: acct)(value, id, date, level)
tasks(status, id, salary, date)
Task: Find code from accounts where level appears in tasks entries with matching status.
SQL: | SELECT code FROM accounts AS acct
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15650 | train |
v1 | Schema:
projects (alias: prj)(name, code, date, value)
schedules(status, value, code, salary)
Task: Select name from projects where status exists in schedules for the same status.
SQL: | SELECT name FROM projects AS prj
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "schedules",
"outer_alias": "prj",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15651 | train |
v3 | Schema:
invoices (alias: inv)(id, type, name, date)
sales(status, code, amount, id)
Task: Retrieve amount from invoices with salary above the MIN(value) of sales rows sharing the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE salary > (
SELECT MIN(value) FROM sales AS sale
WHERE sale.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15652 | train |
v2 | Schema:
customers (alias: cust)(level, id, salary, name)
items(amount, code, value, name)
Task: Retrieve name from customers that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15653 | train |
v1 | Schema:
sales (alias: sale)(value, level, status, code)
branches(status, code, amount, name)
Task: Select salary from sales where id exists in branches for the same id.
SQL: | SELECT salary FROM sales AS sale
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "branches",
"outer_alias": "sale",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15654 | train |
v3 | Schema:
products (alias: prod)(status, level, date, code)
projects(status, id, value, salary)
Task: Find amount from products where salary exceeds the maximum amount from projects for the same code.
SQL: | SELECT amount FROM products AS prod
WHERE salary > (
SELECT MAX(amount) FROM projects AS prj
WHERE prj.code = prod.code
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "prod",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15655 | train |
v2 | Schema:
customers (alias: cust)(date, id, name, value)
departments(code, date, type, name)
Task: Find code from customers where a matching record exists in departments with the same level.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15656 | train |
v1 | Schema:
staff (alias: empl)(salary, amount, level, date)
departments(date, value, status, code)
Task: Find salary from staff where code appears in departments entries with matching status.
SQL: | SELECT salary FROM staff AS empl
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15657 | train |
v2 | Schema:
accounts (alias: acct)(type, date, code, id)
transactions(id, type, value, date)
Task: Find name from accounts where a matching record exists in transactions with the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15658 | train |
v1 | Schema:
departments (alias: dept)(type, status, amount, date)
employees(salary, code, status, amount)
Task: Select code from departments where level exists in employees for the same status.
SQL: | SELECT code FROM departments AS dept
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15659 | train |
v1 | Schema:
staff (alias: empl)(code, name, value, type)
regions(id, name, code, status)
Task: Find id from staff where status appears in regions entries with matching code.
SQL: | SELECT id FROM staff AS empl
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15660 | train |
v3 | Schema:
transactions (alias: txn)(code, type, date, name)
categories(date, status, value, amount)
Task: Retrieve code from transactions with salary above the MAX(value) of categories rows sharing the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE salary > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15661 | train |
v1 | Schema:
departments (alias: dept)(name, level, date, salary)
tasks(code, status, id, name)
Task: Find code from departments where type appears in tasks entries with matching type.
SQL: | SELECT code FROM departments AS dept
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15662 | train |
v2 | Schema:
regions (alias: rgn)(value, date, id, type)
transactions(type, code, level, date)
Task: Find value from regions where a matching record exists in transactions with the same type.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_15663 | train |
v2 | Schema:
departments (alias: dept)(status, code, type, date)
categories(name, code, date, type)
Task: Find code from departments where a matching record exists in categories with the same status.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15664 | train |
v2 | Schema:
customers (alias: cust)(status, level, amount, type)
sales(amount, salary, status, value)
Task: Find id from customers where a matching record exists in sales with the same status.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15665 | train |
v3 | Schema:
employees (alias: emp)(date, id, value, type)
products(salary, date, code, amount)
Task: Retrieve salary from employees with salary above the MAX(salary) of products rows sharing the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE salary > (
SELECT MAX(salary) FROM products AS prod
WHERE prod.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15666 | train |
v1 | Schema:
employees (alias: emp)(code, name, salary, status)
products(value, amount, date, status)
Task: Find salary from employees where code appears in products entries with matching status.
SQL: | SELECT salary FROM employees AS emp
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15667 | train |
v1 | Schema:
regions (alias: rgn)(status, date, id, name)
projects(name, value, code, status)
Task: Retrieve id from regions whose code is found in projects rows where level matches the outer record.
SQL: | SELECT id FROM regions AS rgn
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_15668 | train |
v3 | Schema:
invoices (alias: inv)(date, amount, code, value)
schedules(level, date, salary, type)
Task: Find amount from invoices where salary exceeds the maximum value from schedules for the same status.
SQL: | SELECT amount FROM invoices AS inv
WHERE salary > (
SELECT MAX(value) FROM schedules AS schd
WHERE schd.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15669 | train |
v3 | Schema:
requests (alias: ordr)(status, value, date, code)
invoices(amount, date, value, status)
Task: Find name from requests where amount exceeds the minimum amount from invoices for the same type.
SQL: | SELECT name FROM requests AS ordr
WHERE amount > (
SELECT MIN(amount) FROM invoices AS inv
WHERE inv.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_15670 | train |
v1 | Schema:
schedules (alias: schd)(date, status, id, value)
transactions(salary, status, name, level)
Task: Retrieve name from schedules whose code is found in transactions rows where code matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15671 | train |
v3 | Schema:
products (alias: prod)(level, status, value, id)
accounts(level, name, amount, id)
Task: Retrieve name from products with amount above the AVG(amount) of accounts rows sharing the same type.
SQL: | SELECT name FROM products AS prod
WHERE amount > (
SELECT AVG(amount) FROM accounts AS acct
WHERE acct.type = prod.type
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15672 | train |
v1 | Schema:
invoices (alias: inv)(status, code, amount, salary)
projects(level, name, date, amount)
Task: Select code from invoices where status exists in projects for the same level.
SQL: | SELECT code FROM invoices AS inv
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15673 | train |
v3 | Schema:
branches (alias: brc)(value, salary, date, code)
customers(amount, name, code, date)
Task: Find value from branches where salary exceeds the minimum salary from customers for the same type.
SQL: | SELECT value FROM branches AS brc
WHERE salary > (
SELECT MIN(salary) FROM customers AS cust
WHERE cust.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_15674 | train |
v1 | Schema:
orders (alias: ord)(id, value, date, salary)
products(date, code, amount, type)
Task: Find code from orders where status appears in products entries with matching status.
SQL: | SELECT code FROM orders AS ord
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15675 | train |
v2 | Schema:
managers (alias: mgr)(name, value, status, id)
shipments(value, type, code, status)
Task: Retrieve name from managers that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15676 | train |
v2 | Schema:
orders (alias: ord)(code, name, value, status)
requests(salary, date, code, id)
Task: Find code from orders where a matching record exists in requests with the same code.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15677 | train |
v1 | Schema:
employees (alias: emp)(type, date, level, id)
customers(code, id, salary, date)
Task: Retrieve name from employees whose level is found in customers rows where id matches the outer record.
SQL: | SELECT name FROM employees AS emp
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15678 | train |
v2 | Schema:
departments (alias: dept)(date, amount, type, salary)
projects(id, date, name, status)
Task: Find code from departments where a matching record exists in projects with the same status.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15679 | train |
v3 | Schema:
products (alias: prod)(amount, value, level, id)
employees(code, name, salary, level)
Task: Retrieve value from products with amount above the SUM(amount) of employees rows sharing the same level.
SQL: | SELECT value FROM products AS prod
WHERE amount > (
SELECT SUM(amount) FROM employees AS emp
WHERE emp.level = prod.level
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15680 | train |
v1 | Schema:
staff (alias: empl)(salary, id, code, date)
customers(type, date, id, level)
Task: Find name from staff where id appears in customers entries with matching type.
SQL: | SELECT name FROM staff AS empl
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15681 | train |
v2 | Schema:
shipments (alias: shp)(status, salary, amount, type)
employees(type, id, level, status)
Task: Find salary from shipments where a matching record exists in employees with the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15682 | train |
v3 | Schema:
tasks (alias: tsk)(value, amount, id, salary)
employees(type, code, value, id)
Task: Find amount from tasks where salary exceeds the maximum value from employees for the same id.
SQL: | SELECT amount FROM tasks AS tsk
WHERE salary > (
SELECT MAX(value) FROM employees AS emp
WHERE emp.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "tsk",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_15683 | train |
v2 | Schema:
branches (alias: brc)(name, value, code, date)
schedules(code, date, amount, status)
Task: Find salary from branches where a matching record exists in schedules with the same level.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "schedules",
"outer_alias": "brc",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_15684 | train |
v1 | Schema:
regions (alias: rgn)(date, status, name, level)
categories(id, date, status, level)
Task: Retrieve value from regions whose id is found in categories rows where type matches the outer record.
SQL: | SELECT value FROM regions AS rgn
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_15685 | train |
v3 | Schema:
requests (alias: ordr)(id, status, value, code)
products(amount, value, level, code)
Task: Find value from requests where value exceeds the minimum value from products for the same status.
SQL: | SELECT value FROM requests AS ordr
WHERE value > (
SELECT MIN(value) FROM products AS prod
WHERE prod.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_15686 | train |
v2 | Schema:
invoices (alias: inv)(name, status, amount, value)
transactions(code, name, id, value)
Task: Find value from invoices where a matching record exists in transactions with the same id.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15687 | train |
v1 | Schema:
staff (alias: empl)(status, date, code, level)
invoices(level, date, type, amount)
Task: Find code from staff where type appears in invoices entries with matching id.
SQL: | SELECT code FROM staff AS empl
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15688 | train |
v3 | Schema:
tasks (alias: tsk)(level, name, salary, id)
accounts(status, amount, code, type)
Task: Find id from tasks where salary exceeds the average salary from accounts for the same status.
SQL: | SELECT id FROM tasks AS tsk
WHERE salary > (
SELECT AVG(salary) FROM accounts AS acct
WHERE acct.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_15689 | train |
v2 | Schema:
shipments (alias: shp)(id, value, level, amount)
staff(date, id, value, salary)
Task: Find amount from shipments where a matching record exists in staff with the same type.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15690 | train |
v2 | Schema:
products (alias: prod)(id, type, date, status)
orders(code, value, type, level)
Task: Retrieve code from products that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = prod.type
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15691 | train |
v3 | Schema:
products (alias: prod)(id, status, name, level)
branches(id, salary, amount, date)
Task: Retrieve salary from products with amount above the MAX(value) of branches rows sharing the same status.
SQL: | SELECT salary FROM products AS prod
WHERE amount > (
SELECT MAX(value) FROM branches AS brc
WHERE brc.status = prod.status
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15692 | train |
v1 | Schema:
orders (alias: ord)(id, value, status, name)
categories(salary, date, id, amount)
Task: Find amount from orders where id appears in categories entries with matching status.
SQL: | SELECT amount FROM orders AS ord
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15693 | train |
v1 | Schema:
invoices (alias: inv)(salary, id, value, name)
accounts(name, value, salary, status)
Task: Retrieve salary from invoices whose status is found in accounts rows where type matches the outer record.
SQL: | SELECT salary FROM invoices AS inv
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15694 | train |
v3 | Schema:
regions (alias: rgn)(code, date, amount, level)
requests(date, status, level, id)
Task: Retrieve amount from regions with value above the MAX(amount) of requests rows sharing the same id.
SQL: | SELECT amount FROM regions AS rgn
WHERE value > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_15695 | train |
v2 | Schema:
products (alias: prod)(name, amount, code, value)
customers(level, value, type, salary)
Task: Retrieve value from products that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = prod.code
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15696 | train |
v2 | Schema:
transactions (alias: txn)(code, date, value, name)
tasks(level, type, code, date)
Task: Retrieve name from transactions that have at least one corresponding entry in tasks sharing the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15697 | train |
v2 | Schema:
accounts (alias: acct)(amount, salary, value, id)
shipments(level, type, code, salary)
Task: Find salary from accounts where a matching record exists in shipments with the same level.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15698 | train |
v3 | Schema:
schedules (alias: schd)(id, code, level, date)
products(status, code, value, amount)
Task: Retrieve name from schedules with value above the COUNT(salary) of products rows sharing the same code.
SQL: | SELECT name FROM schedules AS schd
WHERE value > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15699 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.