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:
projects (alias: prj)(value, date, status, salary)
items(level, code, amount, date)
Task: Select name from projects where status exists in items for the same code.
SQL: | SELECT name FROM projects AS prj
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07100 | train |
v2 | Schema:
transactions (alias: txn)(name, amount, value, date)
staff(salary, type, amount, value)
Task: Retrieve salary from transactions that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07101 | train |
v3 | Schema:
schedules (alias: schd)(type, amount, name, status)
regions(code, status, value, type)
Task: Find id from schedules where value exceeds the count of value from regions for the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE value > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07102 | train |
v1 | Schema:
tasks (alias: tsk)(amount, salary, name, level)
requests(type, amount, code, salary)
Task: Select amount from tasks where status exists in requests for the same status.
SQL: | SELECT amount FROM tasks AS tsk
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07103 | train |
v3 | Schema:
orders (alias: ord)(code, type, id, name)
managers(id, status, type, code)
Task: Retrieve name from orders with salary above the MAX(salary) of managers rows sharing the same id.
SQL: | SELECT name FROM orders AS ord
WHERE salary > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07104 | train |
v1 | Schema:
accounts (alias: acct)(id, value, salary, name)
transactions(amount, name, value, level)
Task: Retrieve value from accounts whose status is found in transactions rows where code matches the outer record.
SQL: | SELECT value FROM accounts AS acct
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07105 | train |
v2 | Schema:
employees (alias: emp)(id, value, code, amount)
tasks(type, salary, status, level)
Task: Find code from employees where a matching record exists in tasks with the same type.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07106 | train |
v3 | Schema:
customers (alias: cust)(id, code, salary, name)
schedules(status, salary, code, amount)
Task: Find salary from customers where value exceeds the maximum amount from schedules for the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE value > (
SELECT MAX(amount) FROM schedules AS schd
WHERE schd.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07107 | train |
v3 | Schema:
branches (alias: brc)(name, type, code, value)
requests(code, amount, value, status)
Task: Retrieve amount from branches with salary above the AVG(value) of requests rows sharing the same id.
SQL: | SELECT amount FROM branches AS brc
WHERE salary > (
SELECT AVG(value) FROM requests AS ordr
WHERE ordr.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07108 | train |
v1 | Schema:
categories (alias: catg)(date, value, status, level)
transactions(id, amount, value, code)
Task: Retrieve name from categories whose level is found in transactions rows where level matches the outer record.
SQL: | SELECT name FROM categories AS catg
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07109 | train |
v3 | Schema:
items (alias: lne)(id, name, status, type)
shipments(code, value, date, amount)
Task: Find name from items where value exceeds the average value from shipments for the same level.
SQL: | SELECT name FROM items AS lne
WHERE value > (
SELECT AVG(value) FROM shipments AS shp
WHERE shp.level = lne.level
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07110 | train |
v1 | Schema:
customers (alias: cust)(type, level, name, amount)
invoices(code, value, name, id)
Task: Retrieve salary from customers whose status is found in invoices rows where code matches the outer record.
SQL: | SELECT salary FROM customers AS cust
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07111 | train |
v3 | Schema:
staff (alias: empl)(id, status, salary, value)
employees(status, level, amount, name)
Task: Find value from staff where salary exceeds the count of salary from employees for the same level.
SQL: | SELECT value FROM staff AS empl
WHERE salary > (
SELECT COUNT(salary) FROM employees AS emp
WHERE emp.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07112 | train |
v1 | Schema:
managers (alias: mgr)(id, date, salary, type)
items(code, amount, status, value)
Task: Retrieve code from managers whose status is found in items rows where status matches the outer record.
SQL: | SELECT code FROM managers AS mgr
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07113 | train |
v1 | Schema:
invoices (alias: inv)(type, salary, amount, value)
employees(name, id, amount, value)
Task: Select id from invoices where level exists in employees for the same type.
SQL: | SELECT id FROM invoices AS inv
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07114 | train |
v1 | Schema:
schedules (alias: schd)(level, name, status, amount)
regions(type, level, date, name)
Task: Find value from schedules where id appears in regions entries with matching level.
SQL: | SELECT value FROM schedules AS schd
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07115 | train |
v1 | Schema:
schedules (alias: schd)(level, id, salary, date)
invoices(date, amount, value, id)
Task: Select name from schedules where code exists in invoices for the same type.
SQL: | SELECT name FROM schedules AS schd
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07116 | train |
v2 | Schema:
products (alias: prod)(name, code, type, status)
branches(salary, code, level, name)
Task: Find code from products where a matching record exists in branches with the same id.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = prod.id
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07117 | train |
v1 | Schema:
staff (alias: empl)(salary, type, value, id)
employees(salary, date, level, id)
Task: Retrieve name from staff whose id is found in employees rows where id matches the outer record.
SQL: | SELECT name FROM staff AS empl
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07118 | train |
v1 | Schema:
invoices (alias: inv)(value, salary, level, date)
branches(code, name, id, status)
Task: Select name from invoices where status exists in branches for the same status.
SQL: | SELECT name FROM invoices AS inv
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07119 | train |
v2 | Schema:
departments (alias: dept)(value, code, name, level)
projects(value, type, amount, id)
Task: Find amount from departments where a matching record exists in projects with the same level.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07120 | train |
v1 | Schema:
employees (alias: emp)(status, date, id, type)
transactions(amount, name, code, value)
Task: Select name from employees where status exists in transactions for the same code.
SQL: | SELECT name FROM employees AS emp
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07121 | train |
v3 | Schema:
branches (alias: brc)(type, amount, level, code)
staff(value, level, salary, code)
Task: Find amount from branches where value exceeds the minimum value from staff for the same code.
SQL: | SELECT amount FROM branches AS brc
WHERE value > (
SELECT MIN(value) FROM staff AS empl
WHERE empl.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07122 | train |
v2 | Schema:
employees (alias: emp)(code, type, level, value)
orders(name, type, id, status)
Task: Find amount from employees where a matching record exists in orders with the same type.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07123 | train |
v1 | Schema:
sales (alias: sale)(value, amount, date, code)
employees(amount, type, code, value)
Task: Select salary from sales where code exists in employees for the same code.
SQL: | SELECT salary FROM sales AS sale
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07124 | train |
v1 | Schema:
items (alias: lne)(status, type, amount, value)
departments(amount, status, salary, type)
Task: Find amount from items where id appears in departments entries with matching code.
SQL: | SELECT amount FROM items AS lne
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.code = lne.code
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07125 | train |
v2 | Schema:
branches (alias: brc)(level, amount, id, value)
customers(date, name, code, status)
Task: Find value from branches where a matching record exists in customers with the same type.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07126 | train |
v2 | Schema:
branches (alias: brc)(date, amount, level, id)
transactions(status, value, amount, salary)
Task: Retrieve name from branches that have at least one corresponding entry in transactions sharing the same type.
SQL: | SELECT name FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "transactions",
"outer_alias": "brc",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07127 | train |
v2 | Schema:
departments (alias: dept)(code, id, value, level)
tasks(date, level, salary, code)
Task: Retrieve code from departments that have at least one corresponding entry in tasks sharing the same status.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07128 | train |
v3 | Schema:
projects (alias: prj)(amount, value, name, code)
branches(name, id, value, level)
Task: Find salary from projects where salary exceeds the minimum salary from branches for the same id.
SQL: | SELECT salary FROM projects AS prj
WHERE salary > (
SELECT MIN(salary) FROM branches AS brc
WHERE brc.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07129 | train |
v2 | Schema:
tasks (alias: tsk)(type, value, amount, salary)
shipments(id, value, type, salary)
Task: Retrieve amount from tasks that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07130 | train |
v3 | Schema:
projects (alias: prj)(id, status, level, amount)
invoices(salary, type, code, date)
Task: Find salary from projects where salary exceeds the average value from invoices for the same level.
SQL: | SELECT salary FROM projects AS prj
WHERE salary > (
SELECT AVG(value) FROM invoices AS inv
WHERE inv.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07131 | train |
v3 | Schema:
employees (alias: emp)(code, level, type, status)
orders(status, id, name, amount)
Task: Find amount from employees where salary exceeds the total amount from orders for the same type.
SQL: | SELECT amount FROM employees AS emp
WHERE salary > (
SELECT SUM(amount) FROM orders AS ord
WHERE ord.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07132 | train |
v2 | Schema:
sales (alias: sale)(amount, code, salary, level)
requests(date, code, type, level)
Task: Retrieve code from sales that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07133 | train |
v2 | Schema:
transactions (alias: txn)(value, type, id, name)
accounts(salary, status, date, name)
Task: Retrieve salary from transactions that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07134 | train |
v2 | Schema:
categories (alias: catg)(name, level, date, type)
transactions(level, id, date, salary)
Task: Retrieve code from categories that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07135 | train |
v1 | Schema:
items (alias: lne)(salary, status, type, amount)
tasks(value, code, name, level)
Task: Retrieve name from items whose status is found in tasks rows where status matches the outer record.
SQL: | SELECT name FROM items AS lne
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.status = lne.status
); | {
"outer_table": "items",
"inner_table": "tasks",
"outer_alias": "lne",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07136 | train |
v3 | Schema:
staff (alias: empl)(status, amount, salary, code)
schedules(amount, name, status, id)
Task: Retrieve name from staff with salary above the MAX(salary) of schedules rows sharing the same id.
SQL: | SELECT name FROM staff AS empl
WHERE salary > (
SELECT MAX(salary) FROM schedules AS schd
WHERE schd.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07137 | train |
v1 | Schema:
shipments (alias: shp)(level, code, name, date)
categories(code, level, name, type)
Task: Find name from shipments where type appears in categories entries with matching level.
SQL: | SELECT name FROM shipments AS shp
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07138 | train |
v3 | Schema:
products (alias: prod)(id, level, value, status)
sales(status, id, code, amount)
Task: Find id from products where salary exceeds the count of value from sales for the same id.
SQL: | SELECT id FROM products AS prod
WHERE salary > (
SELECT COUNT(value) FROM sales AS sale
WHERE sale.id = prod.id
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07139 | train |
v1 | Schema:
invoices (alias: inv)(name, salary, code, level)
orders(id, type, salary, code)
Task: Retrieve amount from invoices whose id is found in orders rows where status matches the outer record.
SQL: | SELECT amount FROM invoices AS inv
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07140 | train |
v3 | Schema:
sales (alias: sale)(value, salary, code, id)
projects(code, salary, level, status)
Task: Find salary from sales where amount exceeds the total value from projects for the same code.
SQL: | SELECT salary FROM sales AS sale
WHERE amount > (
SELECT SUM(value) FROM projects AS prj
WHERE prj.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07141 | train |
v1 | Schema:
projects (alias: prj)(level, salary, value, date)
branches(salary, type, level, code)
Task: Select name from projects where id exists in branches for the same code.
SQL: | SELECT name FROM projects AS prj
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07142 | train |
v3 | Schema:
branches (alias: brc)(id, name, value, date)
staff(amount, status, code, value)
Task: Retrieve salary from branches with salary above the AVG(salary) of staff rows sharing the same status.
SQL: | SELECT salary FROM branches AS brc
WHERE salary > (
SELECT AVG(salary) FROM staff AS empl
WHERE empl.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07143 | train |
v3 | Schema:
regions (alias: rgn)(name, amount, id, salary)
branches(type, name, id, amount)
Task: Find amount from regions where salary exceeds the total value from branches for the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE salary > (
SELECT SUM(value) FROM branches AS brc
WHERE brc.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07144 | train |
v2 | Schema:
sales (alias: sale)(status, id, level, date)
branches(status, level, date, code)
Task: Retrieve code from sales that have at least one corresponding entry in branches sharing the same status.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "branches",
"outer_alias": "sale",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07145 | train |
v1 | Schema:
requests (alias: ordr)(date, status, code, value)
branches(date, value, salary, level)
Task: Select id from requests where id exists in branches for the same status.
SQL: | SELECT id FROM requests AS ordr
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07146 | train |
v3 | Schema:
staff (alias: empl)(type, amount, code, status)
requests(id, level, amount, name)
Task: Retrieve salary from staff with salary above the MAX(value) of requests rows sharing the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE salary > (
SELECT MAX(value) FROM requests AS ordr
WHERE ordr.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07147 | train |
v2 | Schema:
staff (alias: empl)(level, name, status, code)
customers(amount, date, name, type)
Task: Find id from staff where a matching record exists in customers with the same type.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07148 | train |
v1 | Schema:
invoices (alias: inv)(name, id, level, salary)
tasks(value, code, date, amount)
Task: Retrieve id from invoices whose status is found in tasks rows where code matches the outer record.
SQL: | SELECT id FROM invoices AS inv
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07149 | train |
v1 | Schema:
products (alias: prod)(amount, level, code, status)
schedules(id, amount, level, value)
Task: Find name from products where level appears in schedules entries with matching id.
SQL: | SELECT name FROM products AS prod
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.id = prod.id
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07150 | train |
v2 | Schema:
items (alias: lne)(amount, code, name, status)
departments(status, type, amount, date)
Task: Find amount from items where a matching record exists in departments with the same type.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = lne.type
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07151 | train |
v3 | Schema:
requests (alias: ordr)(code, value, level, date)
customers(salary, name, amount, date)
Task: Find name from requests where amount exceeds the count of value from customers for the same type.
SQL: | SELECT name FROM requests AS ordr
WHERE amount > (
SELECT COUNT(value) FROM customers AS cust
WHERE cust.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07152 | train |
v3 | Schema:
requests (alias: ordr)(code, salary, status, date)
categories(value, level, salary, amount)
Task: Retrieve salary from requests with salary above the MIN(salary) of categories rows sharing the same code.
SQL: | SELECT salary FROM requests AS ordr
WHERE salary > (
SELECT MIN(salary) FROM categories AS catg
WHERE catg.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07153 | train |
v1 | Schema:
invoices (alias: inv)(code, id, level, date)
products(name, date, code, id)
Task: Select amount from invoices where code exists in products for the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07154 | train |
v2 | Schema:
items (alias: lne)(amount, id, name, level)
categories(name, value, salary, code)
Task: Find id from items where a matching record exists in categories with the same id.
SQL: | SELECT id 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": "id",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07155 | train |
v2 | Schema:
sales (alias: sale)(code, id, name, date)
products(amount, salary, value, type)
Task: Find id from sales where a matching record exists in products with the same type.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07156 | train |
v2 | Schema:
employees (alias: emp)(salary, code, value, date)
customers(amount, type, date, id)
Task: Find value from employees where a matching record exists in customers with the same code.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07157 | train |
v1 | Schema:
categories (alias: catg)(type, code, value, date)
invoices(amount, type, status, id)
Task: Retrieve name from categories whose status is found in invoices rows where level matches the outer record.
SQL: | SELECT name FROM categories AS catg
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07158 | train |
v2 | Schema:
transactions (alias: txn)(amount, id, code, date)
sales(type, name, status, id)
Task: Find salary from transactions where a matching record exists in sales with the same status.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07159 | train |
v3 | Schema:
projects (alias: prj)(value, amount, status, date)
regions(status, amount, salary, value)
Task: Find name from projects where amount exceeds the average salary from regions for the same id.
SQL: | SELECT name FROM projects AS prj
WHERE amount > (
SELECT AVG(salary) FROM regions AS rgn
WHERE rgn.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07160 | train |
v3 | Schema:
invoices (alias: inv)(status, date, value, name)
items(level, salary, type, date)
Task: Find id from invoices where salary exceeds the minimum value from items for the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE salary > (
SELECT MIN(value) FROM items AS lne
WHERE lne.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07161 | train |
v1 | Schema:
projects (alias: prj)(salary, id, value, level)
sales(name, id, type, value)
Task: Find id from projects where id appears in sales entries with matching level.
SQL: | SELECT id FROM projects AS prj
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07162 | train |
v1 | Schema:
tasks (alias: tsk)(level, id, name, value)
orders(status, level, id, type)
Task: Find value from tasks where id appears in orders entries with matching code.
SQL: | SELECT value FROM tasks AS tsk
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07163 | train |
v1 | Schema:
orders (alias: ord)(salary, code, amount, status)
staff(salary, status, value, level)
Task: Select value from orders where code exists in staff for the same code.
SQL: | SELECT value FROM orders AS ord
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07164 | train |
v3 | Schema:
staff (alias: empl)(status, level, date, amount)
sales(status, id, date, value)
Task: Retrieve amount from staff with value above the MAX(value) of sales rows sharing the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE value > (
SELECT MAX(value) FROM sales AS sale
WHERE sale.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07165 | train |
v1 | Schema:
departments (alias: dept)(date, code, id, level)
customers(id, salary, value, date)
Task: Retrieve id from departments whose type is found in customers rows where level matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07166 | train |
v2 | Schema:
requests (alias: ordr)(name, salary, code, status)
branches(type, name, id, status)
Task: Find amount from requests where a matching record exists in branches with the same level.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07167 | train |
v3 | Schema:
regions (alias: rgn)(value, date, type, status)
employees(level, value, status, type)
Task: Retrieve id from regions with amount above the MIN(amount) of employees rows sharing the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE amount > (
SELECT MIN(amount) FROM employees AS emp
WHERE emp.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07168 | train |
v1 | Schema:
managers (alias: mgr)(salary, value, type, level)
projects(value, name, date, id)
Task: Select amount from managers where status exists in projects for the same id.
SQL: | SELECT amount FROM managers AS mgr
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07169 | train |
v3 | Schema:
departments (alias: dept)(level, date, name, value)
accounts(value, name, date, salary)
Task: Find value from departments where value exceeds the maximum amount from accounts for the same level.
SQL: | SELECT value FROM departments AS dept
WHERE value > (
SELECT MAX(amount) FROM accounts AS acct
WHERE acct.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07170 | train |
v3 | Schema:
regions (alias: rgn)(salary, type, amount, name)
categories(type, date, code, name)
Task: Find id from regions where amount exceeds the average value from categories for the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE amount > (
SELECT AVG(value) FROM categories AS catg
WHERE catg.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07171 | train |
v1 | Schema:
accounts (alias: acct)(name, salary, status, code)
sales(status, code, salary, name)
Task: Find name from accounts where status appears in sales entries with matching status.
SQL: | SELECT name FROM accounts AS acct
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07172 | train |
v3 | Schema:
requests (alias: ordr)(amount, status, id, code)
schedules(name, status, code, value)
Task: Retrieve id from requests with value above the AVG(salary) of schedules rows sharing the same level.
SQL: | SELECT id FROM requests AS ordr
WHERE value > (
SELECT AVG(salary) FROM schedules AS schd
WHERE schd.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07173 | train |
v2 | Schema:
branches (alias: brc)(type, amount, date, id)
accounts(code, value, amount, date)
Task: Retrieve code from branches that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "accounts",
"outer_alias": "brc",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07174 | train |
v1 | Schema:
requests (alias: ordr)(code, status, date, amount)
products(name, code, level, status)
Task: Retrieve name from requests whose type is found in products rows where code matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07175 | train |
v1 | Schema:
requests (alias: ordr)(type, level, status, date)
employees(date, salary, value, level)
Task: Retrieve salary from requests whose type is found in employees rows where level matches the outer record.
SQL: | SELECT salary FROM requests AS ordr
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07176 | train |
v2 | Schema:
managers (alias: mgr)(code, type, id, status)
employees(code, name, type, value)
Task: Retrieve value from managers that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07177 | train |
v3 | Schema:
projects (alias: prj)(code, amount, level, status)
orders(date, code, status, salary)
Task: Find id from projects where amount exceeds the total value from orders for the same status.
SQL: | SELECT id FROM projects AS prj
WHERE amount > (
SELECT SUM(value) FROM orders AS ord
WHERE ord.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "orders",
"outer_alias": "prj",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07178 | train |
v3 | Schema:
schedules (alias: schd)(level, salary, type, status)
accounts(name, status, id, amount)
Task: Find salary from schedules where salary exceeds the minimum amount from accounts for the same level.
SQL: | SELECT salary FROM schedules AS schd
WHERE salary > (
SELECT MIN(amount) FROM accounts AS acct
WHERE acct.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07179 | train |
v3 | Schema:
invoices (alias: inv)(type, value, date, salary)
sales(salary, code, type, date)
Task: Retrieve value from invoices with value above the AVG(value) of sales rows sharing the same status.
SQL: | SELECT value FROM invoices AS inv
WHERE value > (
SELECT AVG(value) FROM sales AS sale
WHERE sale.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07180 | train |
v1 | Schema:
employees (alias: emp)(date, value, amount, code)
managers(date, status, amount, name)
Task: Find code from employees where code appears in managers entries with matching level.
SQL: | SELECT code FROM employees AS emp
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07181 | train |
v2 | Schema:
items (alias: lne)(level, date, amount, salary)
transactions(value, salary, type, status)
Task: Find name from items where a matching record exists in transactions with the same level.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07182 | train |
v2 | Schema:
staff (alias: empl)(date, value, id, level)
regions(status, id, code, salary)
Task: Retrieve amount from staff that have at least one corresponding entry in regions sharing the same code.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07183 | train |
v1 | Schema:
requests (alias: ordr)(level, date, id, status)
orders(level, value, id, status)
Task: Retrieve amount from requests whose type is found in orders rows where type matches the outer record.
SQL: | SELECT amount FROM requests AS ordr
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07184 | train |
v2 | Schema:
staff (alias: empl)(value, id, salary, name)
branches(id, level, type, value)
Task: Find name from staff where a matching record exists in branches with the same status.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07185 | train |
v3 | Schema:
regions (alias: rgn)(code, value, status, salary)
orders(id, code, amount, value)
Task: Retrieve salary from regions with value above the SUM(amount) of orders rows sharing the same status.
SQL: | SELECT salary FROM regions AS rgn
WHERE value > (
SELECT SUM(amount) FROM orders AS ord
WHERE ord.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07186 | train |
v2 | Schema:
branches (alias: brc)(id, salary, level, type)
staff(name, level, status, id)
Task: Find name from branches where a matching record exists in staff with the same status.
SQL: | SELECT name FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07187 | train |
v2 | Schema:
orders (alias: ord)(level, amount, id, date)
departments(id, code, salary, amount)
Task: Retrieve code from orders that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07188 | train |
v3 | Schema:
employees (alias: emp)(name, code, id, date)
items(level, id, salary, type)
Task: Retrieve id from employees with value above the SUM(amount) of items rows sharing the same level.
SQL: | SELECT id FROM employees AS emp
WHERE value > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07189 | train |
v3 | Schema:
tasks (alias: tsk)(level, status, date, code)
categories(code, salary, date, status)
Task: Find amount from tasks where amount exceeds the maximum value from categories for the same status.
SQL: | SELECT amount FROM tasks AS tsk
WHERE amount > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07190 | train |
v1 | Schema:
schedules (alias: schd)(value, date, status, id)
categories(id, date, type, level)
Task: Find id from schedules where type appears in categories entries with matching type.
SQL: | SELECT id FROM schedules AS schd
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07191 | train |
v3 | Schema:
items (alias: lne)(value, level, status, id)
categories(status, amount, value, code)
Task: Retrieve amount from items with amount above the COUNT(value) of categories rows sharing the same code.
SQL: | SELECT amount FROM items AS lne
WHERE amount > (
SELECT COUNT(value) FROM categories AS catg
WHERE catg.code = lne.code
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07192 | train |
v1 | Schema:
invoices (alias: inv)(amount, salary, code, status)
schedules(name, code, amount, date)
Task: Find amount from invoices where status appears in schedules entries with matching level.
SQL: | SELECT amount FROM invoices AS inv
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07193 | train |
v2 | Schema:
staff (alias: empl)(amount, status, code, date)
transactions(id, amount, name, type)
Task: Retrieve value from staff that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07194 | train |
v2 | Schema:
tasks (alias: tsk)(code, level, value, type)
accounts(value, status, name, amount)
Task: Find amount from tasks where a matching record exists in accounts with the same status.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07195 | train |
v1 | Schema:
transactions (alias: txn)(salary, code, type, value)
tasks(date, salary, type, status)
Task: Find code from transactions where status appears in tasks entries with matching type.
SQL: | SELECT code FROM transactions AS txn
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07196 | train |
v3 | Schema:
products (alias: prod)(code, salary, id, amount)
sales(status, value, id, salary)
Task: Retrieve amount from products with amount above the MIN(value) of sales rows sharing the same code.
SQL: | SELECT amount FROM products AS prod
WHERE amount > (
SELECT MIN(value) FROM sales AS sale
WHERE sale.code = prod.code
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07197 | train |
v2 | Schema:
orders (alias: ord)(level, salary, amount, name)
staff(code, value, type, level)
Task: Find salary from orders where a matching record exists in staff with the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07198 | train |
v1 | Schema:
sales (alias: sale)(salary, level, name, amount)
branches(amount, salary, date, status)
Task: Select id from sales where type exists in branches for the same type.
SQL: | SELECT id FROM sales AS sale
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "branches",
"outer_alias": "sale",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07199 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.