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:
tasks (alias: tsk)(code, date, amount, id)
branches(status, amount, level, salary)
Task: Retrieve id from tasks whose code is found in branches rows where code matches the outer record.
SQL: | SELECT id FROM tasks AS tsk
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_09800 | train |
v3 | Schema:
requests (alias: ordr)(date, name, id, status)
customers(salary, name, id, value)
Task: Retrieve id from requests with amount above the MAX(salary) of customers rows sharing the same code.
SQL: | SELECT id FROM requests AS ordr
WHERE amount > (
SELECT MAX(salary) FROM customers AS cust
WHERE cust.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_09801 | train |
v2 | Schema:
accounts (alias: acct)(type, amount, level, id)
staff(level, amount, date, value)
Task: Find code from accounts where a matching record exists in staff with the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09802 | train |
v1 | Schema:
departments (alias: dept)(value, status, id, code)
customers(code, salary, value, amount)
Task: Retrieve amount from departments whose level is found in customers rows where status matches the outer record.
SQL: | SELECT amount FROM departments AS dept
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09803 | train |
v3 | Schema:
projects (alias: prj)(salary, level, date, name)
regions(code, date, status, name)
Task: Find amount from projects where salary exceeds the maximum value from regions for the same id.
SQL: | SELECT amount FROM projects AS prj
WHERE salary > (
SELECT MAX(value) FROM regions AS rgn
WHERE rgn.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_09804 | train |
v2 | Schema:
staff (alias: empl)(salary, name, level, value)
customers(level, amount, status, code)
Task: Find code from staff where a matching record exists in customers with the same id.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_09805 | train |
v1 | Schema:
employees (alias: emp)(type, name, date, salary)
departments(id, salary, level, code)
Task: Retrieve code from employees whose code is found in departments rows where type matches the outer record.
SQL: | SELECT code FROM employees AS emp
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09806 | train |
v3 | Schema:
products (alias: prod)(id, level, type, value)
managers(code, status, name, amount)
Task: Retrieve id from products with value above the COUNT(amount) of managers rows sharing the same level.
SQL: | SELECT id FROM products AS prod
WHERE value > (
SELECT COUNT(amount) FROM managers AS mgr
WHERE mgr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09807 | train |
v3 | Schema:
employees (alias: emp)(date, level, amount, type)
orders(code, amount, date, type)
Task: Retrieve code from employees with value above the MAX(value) of orders rows sharing the same code.
SQL: | SELECT code FROM employees AS emp
WHERE value > (
SELECT MAX(value) FROM orders AS ord
WHERE ord.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09808 | train |
v3 | Schema:
customers (alias: cust)(salary, date, status, amount)
accounts(date, salary, name, code)
Task: Find amount from customers where amount exceeds the count of value from accounts for the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE amount > (
SELECT COUNT(value) FROM accounts AS acct
WHERE acct.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09809 | train |
v3 | Schema:
staff (alias: empl)(level, date, type, code)
invoices(salary, value, amount, level)
Task: Retrieve code from staff with salary above the COUNT(value) of invoices rows sharing the same code.
SQL: | SELECT code FROM staff AS empl
WHERE salary > (
SELECT COUNT(value) FROM invoices AS inv
WHERE inv.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_09810 | train |
v1 | Schema:
products (alias: prod)(date, salary, type, level)
managers(status, salary, id, level)
Task: Select name from products where status exists in managers for the same id.
SQL: | SELECT name FROM products AS prod
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.id = prod.id
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09811 | train |
v2 | Schema:
managers (alias: mgr)(code, amount, level, salary)
tasks(status, date, salary, amount)
Task: Retrieve name from managers that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09812 | train |
v1 | Schema:
orders (alias: ord)(date, status, id, salary)
shipments(code, status, value, date)
Task: Select name from orders where type exists in shipments for the same code.
SQL: | SELECT name FROM orders AS ord
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09813 | train |
v3 | Schema:
branches (alias: brc)(id, status, salary, date)
staff(salary, id, date, name)
Task: Find salary from branches where amount exceeds the maximum salary from staff for the same id.
SQL: | SELECT salary FROM branches AS brc
WHERE amount > (
SELECT MAX(salary) FROM staff AS empl
WHERE empl.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_09814 | train |
v3 | Schema:
departments (alias: dept)(level, type, code, date)
sales(status, value, code, date)
Task: Retrieve name from departments with value above the MAX(salary) of sales rows sharing the same level.
SQL: | SELECT name FROM departments AS dept
WHERE value > (
SELECT MAX(salary) FROM sales AS sale
WHERE sale.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09815 | train |
v2 | Schema:
employees (alias: emp)(id, value, level, amount)
requests(value, id, amount, date)
Task: Find salary from employees where a matching record exists in requests with the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09816 | train |
v1 | Schema:
accounts (alias: acct)(code, level, id, date)
requests(salary, amount, status, id)
Task: Find name from accounts where status appears in requests entries with matching level.
SQL: | SELECT name FROM accounts AS acct
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09817 | train |
v1 | Schema:
shipments (alias: shp)(code, value, salary, level)
branches(level, id, type, name)
Task: Select amount from shipments where code exists in branches for the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09818 | train |
v2 | Schema:
branches (alias: brc)(amount, name, salary, value)
customers(id, value, name, date)
Task: Retrieve amount from branches that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_09819 | train |
v2 | Schema:
transactions (alias: txn)(code, name, value, amount)
accounts(amount, date, value, id)
Task: Find code from transactions where a matching record exists in accounts with the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09820 | train |
v3 | Schema:
transactions (alias: txn)(status, type, name, value)
products(amount, id, name, code)
Task: Find amount from transactions where value exceeds the maximum value from products for the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE value > (
SELECT MAX(value) FROM products AS prod
WHERE prod.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09821 | train |
v3 | Schema:
invoices (alias: inv)(status, type, value, level)
regions(level, status, salary, amount)
Task: Retrieve id from invoices with value above the MIN(salary) of regions rows sharing the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE value > (
SELECT MIN(salary) FROM regions AS rgn
WHERE rgn.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09822 | train |
v2 | Schema:
requests (alias: ordr)(type, date, code, id)
branches(status, level, type, amount)
Task: Find value from requests where a matching record exists in branches with the same id.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_09823 | train |
v1 | Schema:
departments (alias: dept)(name, id, salary, status)
categories(amount, name, type, date)
Task: Retrieve salary from departments whose status is found in categories rows where type matches the outer record.
SQL: | SELECT salary FROM departments AS dept
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09824 | train |
v3 | Schema:
projects (alias: prj)(value, date, amount, salary)
requests(amount, level, salary, value)
Task: Retrieve name from projects with value above the AVG(salary) of requests rows sharing the same code.
SQL: | SELECT name FROM projects AS prj
WHERE value > (
SELECT AVG(salary) FROM requests AS ordr
WHERE ordr.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_09825 | train |
v1 | Schema:
shipments (alias: shp)(salary, code, date, type)
staff(code, date, type, value)
Task: Find salary from shipments where type appears in staff entries with matching type.
SQL: | SELECT salary FROM shipments AS shp
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09826 | train |
v3 | Schema:
departments (alias: dept)(status, name, id, value)
staff(date, id, salary, value)
Task: Find code from departments where value exceeds the average value from staff for the same code.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09827 | train |
v1 | Schema:
products (alias: prod)(value, type, status, name)
transactions(status, salary, date, value)
Task: Retrieve name from products whose level is found in transactions rows where id matches the outer record.
SQL: | SELECT name FROM products AS prod
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.id = prod.id
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09828 | train |
v1 | Schema:
regions (alias: rgn)(code, name, value, id)
accounts(level, type, amount, date)
Task: Select salary from regions where level exists in accounts for the same type.
SQL: | SELECT salary FROM regions AS rgn
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_09829 | train |
v1 | Schema:
managers (alias: mgr)(id, type, date, salary)
invoices(name, date, amount, code)
Task: Find salary from managers where level appears in invoices entries with matching type.
SQL: | SELECT salary FROM managers AS mgr
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09830 | train |
v2 | Schema:
projects (alias: prj)(name, id, code, type)
invoices(date, value, amount, salary)
Task: Retrieve salary from projects that have at least one corresponding entry in invoices sharing the same code.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_09831 | train |
v2 | Schema:
tasks (alias: tsk)(level, type, name, salary)
schedules(date, salary, value, amount)
Task: Find amount from tasks where a matching record exists in schedules with the same type.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_09832 | train |
v3 | Schema:
regions (alias: rgn)(name, id, date, status)
schedules(code, date, amount, level)
Task: Retrieve name from regions with salary above the MAX(salary) of schedules rows sharing the same code.
SQL: | SELECT name FROM regions AS rgn
WHERE salary > (
SELECT MAX(salary) FROM schedules AS schd
WHERE schd.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_09833 | train |
v1 | Schema:
regions (alias: rgn)(salary, status, amount, type)
tasks(status, salary, name, id)
Task: Select salary from regions where id exists in tasks for the same level.
SQL: | SELECT salary FROM regions AS rgn
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_09834 | train |
v2 | Schema:
schedules (alias: schd)(name, salary, type, amount)
shipments(salary, name, value, code)
Task: Retrieve name from schedules that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09835 | train |
v2 | Schema:
managers (alias: mgr)(level, value, name, amount)
branches(status, id, date, value)
Task: Retrieve code from managers that have at least one corresponding entry in branches sharing the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09836 | train |
v1 | Schema:
items (alias: lne)(name, type, amount, date)
staff(status, value, code, salary)
Task: Find name from items where id appears in staff entries with matching id.
SQL: | SELECT name FROM items AS lne
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.id = lne.id
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_09837 | train |
v1 | Schema:
regions (alias: rgn)(status, value, type, id)
managers(id, salary, amount, type)
Task: Retrieve value from regions whose code is found in managers rows where type matches the outer record.
SQL: | SELECT value FROM regions AS rgn
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_09838 | train |
v2 | Schema:
schedules (alias: schd)(value, level, status, date)
transactions(type, date, value, name)
Task: Retrieve name from schedules that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09839 | train |
v3 | Schema:
tasks (alias: tsk)(status, value, type, name)
products(amount, type, salary, value)
Task: Retrieve name from tasks with value above the COUNT(amount) of products rows sharing the same code.
SQL: | SELECT name FROM tasks AS tsk
WHERE value > (
SELECT COUNT(amount) FROM products AS prod
WHERE prod.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_09840 | train |
v1 | Schema:
managers (alias: mgr)(date, status, code, salary)
customers(name, date, id, salary)
Task: Find salary from managers where id appears in customers entries with matching type.
SQL: | SELECT salary FROM managers AS mgr
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09841 | train |
v1 | Schema:
employees (alias: emp)(name, status, salary, amount)
items(salary, value, id, type)
Task: Find salary from employees where status appears in items entries with matching id.
SQL: | SELECT salary FROM employees AS emp
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09842 | train |
v2 | Schema:
items (alias: lne)(name, salary, value, code)
branches(level, date, type, name)
Task: Find name from items where a matching record exists in branches with the same level.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = lne.level
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_09843 | train |
v1 | Schema:
transactions (alias: txn)(id, amount, type, date)
branches(name, level, amount, status)
Task: Select value from transactions where level exists in branches for the same type.
SQL: | SELECT value FROM transactions AS txn
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09844 | train |
v1 | Schema:
branches (alias: brc)(name, code, amount, type)
items(level, type, name, value)
Task: Select salary from branches where status exists in items for the same status.
SQL: | SELECT salary FROM branches AS brc
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_09845 | train |
v2 | Schema:
regions (alias: rgn)(type, level, date, salary)
tasks(id, code, date, level)
Task: Retrieve amount from regions that have at least one corresponding entry in tasks sharing the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_09846 | train |
v2 | Schema:
requests (alias: ordr)(amount, type, level, name)
employees(value, level, status, id)
Task: Find id from requests where a matching record exists in employees with the same id.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_09847 | train |
v1 | Schema:
customers (alias: cust)(amount, level, value, date)
accounts(date, name, value, code)
Task: Select name from customers where type exists in accounts for the same level.
SQL: | SELECT name FROM customers AS cust
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09848 | train |
v3 | Schema:
branches (alias: brc)(name, value, id, level)
requests(level, date, type, salary)
Task: Find amount from branches where salary exceeds the total salary from requests for the same id.
SQL: | SELECT amount FROM branches AS brc
WHERE salary > (
SELECT SUM(salary) 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": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_09849 | train |
v1 | Schema:
regions (alias: rgn)(name, value, id, code)
projects(value, amount, code, level)
Task: Select code from regions where id exists in projects for the same status.
SQL: | SELECT code FROM regions AS rgn
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_09850 | train |
v2 | Schema:
projects (alias: prj)(name, status, id, salary)
departments(date, salary, id, name)
Task: Retrieve code from projects that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_09851 | train |
v3 | Schema:
departments (alias: dept)(value, salary, status, type)
customers(amount, status, date, id)
Task: Retrieve amount from departments with salary above the MIN(value) of customers rows sharing the same type.
SQL: | SELECT amount FROM departments AS dept
WHERE salary > (
SELECT MIN(value) FROM customers AS cust
WHERE cust.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09852 | train |
v2 | Schema:
projects (alias: prj)(id, date, amount, name)
schedules(amount, level, code, salary)
Task: Retrieve value from projects that have at least one corresponding entry in schedules sharing the same id.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "schedules",
"outer_alias": "prj",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_09853 | train |
v2 | Schema:
shipments (alias: shp)(value, status, type, amount)
managers(id, type, amount, name)
Task: Retrieve code from shipments that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09854 | train |
v1 | Schema:
employees (alias: emp)(code, type, id, amount)
transactions(code, value, level, date)
Task: Select code from employees where level exists in transactions for the same id.
SQL: | SELECT code FROM employees AS emp
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09855 | train |
v3 | Schema:
invoices (alias: inv)(code, value, name, amount)
employees(type, name, code, salary)
Task: Find value from invoices where salary exceeds the average value from employees for the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE salary > (
SELECT AVG(value) FROM employees AS emp
WHERE emp.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09856 | train |
v3 | Schema:
customers (alias: cust)(date, name, code, type)
departments(name, amount, value, status)
Task: Retrieve code from customers with salary above the MIN(value) of departments rows sharing the same code.
SQL: | SELECT code FROM customers AS cust
WHERE salary > (
SELECT MIN(value) FROM departments AS dept
WHERE dept.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09857 | train |
v2 | Schema:
tasks (alias: tsk)(level, name, amount, type)
projects(code, value, name, salary)
Task: Find value from tasks where a matching record exists in projects with the same status.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_09858 | train |
v2 | Schema:
staff (alias: empl)(name, amount, date, type)
customers(value, status, id, name)
Task: Find id from staff where a matching record exists in customers with the same id.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_09859 | train |
v3 | Schema:
schedules (alias: schd)(amount, name, status, id)
managers(salary, code, date, value)
Task: Retrieve code from schedules with value above the AVG(amount) of managers rows sharing the same status.
SQL: | SELECT code FROM schedules AS schd
WHERE value > (
SELECT AVG(amount) FROM managers AS mgr
WHERE mgr.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09860 | train |
v2 | Schema:
departments (alias: dept)(salary, amount, level, date)
regions(level, date, amount, name)
Task: Find name from departments where a matching record exists in regions with the same code.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09861 | train |
v3 | Schema:
branches (alias: brc)(id, value, status, code)
staff(id, status, name, salary)
Task: Retrieve salary from branches with salary above the AVG(value) of staff rows sharing the same type.
SQL: | SELECT salary FROM branches AS brc
WHERE salary > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_09862 | train |
v2 | Schema:
orders (alias: ord)(code, id, level, status)
schedules(name, date, code, value)
Task: Retrieve code from orders that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09863 | train |
v1 | Schema:
regions (alias: rgn)(code, status, value, salary)
staff(type, amount, salary, level)
Task: Retrieve id from regions whose status is found in staff rows where id matches the outer record.
SQL: | SELECT id FROM regions AS rgn
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_09864 | train |
v1 | Schema:
managers (alias: mgr)(date, amount, code, value)
staff(date, code, salary, name)
Task: Retrieve code from managers whose id is found in staff rows where id matches the outer record.
SQL: | SELECT code FROM managers AS mgr
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09865 | train |
v1 | Schema:
shipments (alias: shp)(type, date, name, value)
accounts(level, value, type, date)
Task: Find name from shipments where id appears in accounts entries with matching type.
SQL: | SELECT name FROM shipments AS shp
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09866 | train |
v1 | Schema:
shipments (alias: shp)(id, status, name, date)
departments(value, name, salary, code)
Task: Retrieve value from shipments whose level is found in departments rows where level matches the outer record.
SQL: | SELECT value FROM shipments AS shp
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09867 | train |
v2 | Schema:
regions (alias: rgn)(type, value, id, name)
requests(name, type, id, status)
Task: Retrieve salary from regions that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_09868 | train |
v2 | Schema:
orders (alias: ord)(type, status, code, amount)
invoices(value, id, status, level)
Task: Find code from orders where a matching record exists in invoices with the same status.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09869 | train |
v3 | Schema:
departments (alias: dept)(level, id, salary, amount)
employees(id, code, amount, date)
Task: Retrieve code from departments with amount above the AVG(salary) of employees rows sharing the same id.
SQL: | SELECT code FROM departments AS dept
WHERE amount > (
SELECT AVG(salary) FROM employees AS emp
WHERE emp.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09870 | train |
v3 | Schema:
branches (alias: brc)(status, date, salary, code)
requests(date, code, level, type)
Task: Find amount from branches where amount exceeds the total value from requests for the same type.
SQL: | SELECT amount FROM branches AS brc
WHERE amount > (
SELECT SUM(value) FROM requests AS ordr
WHERE ordr.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_09871 | train |
v2 | Schema:
regions (alias: rgn)(type, level, date, code)
managers(amount, status, name, date)
Task: Retrieve value from regions that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_09872 | train |
v1 | Schema:
shipments (alias: shp)(name, status, type, code)
schedules(date, type, id, salary)
Task: Find name from shipments where level appears in schedules entries with matching code.
SQL: | SELECT name FROM shipments AS shp
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09873 | train |
v1 | Schema:
products (alias: prod)(id, name, code, type)
categories(code, value, amount, level)
Task: Select salary from products where type exists in categories for the same type.
SQL: | SELECT salary FROM products AS prod
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.type = prod.type
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09874 | train |
v2 | Schema:
regions (alias: rgn)(type, level, value, amount)
orders(salary, name, code, status)
Task: Find amount from regions where a matching record exists in orders with the same type.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_09875 | train |
v2 | Schema:
invoices (alias: inv)(name, salary, level, id)
customers(level, amount, type, name)
Task: Find salary from invoices where a matching record exists in customers with the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09876 | train |
v3 | Schema:
employees (alias: emp)(name, type, value, status)
products(salary, status, code, id)
Task: Retrieve id from employees with amount above the AVG(value) of products rows sharing the same type.
SQL: | SELECT id FROM employees AS emp
WHERE amount > (
SELECT AVG(value) FROM products AS prod
WHERE prod.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09877 | train |
v2 | Schema:
tasks (alias: tsk)(id, code, amount, name)
regions(code, value, amount, salary)
Task: Retrieve name from tasks that have at least one corresponding entry in regions sharing the same level.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_09878 | train |
v1 | Schema:
managers (alias: mgr)(status, level, id, salary)
sales(date, salary, id, value)
Task: Retrieve salary from managers whose level is found in sales rows where status matches the outer record.
SQL: | SELECT salary FROM managers AS mgr
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09879 | train |
v1 | Schema:
managers (alias: mgr)(name, salary, type, code)
schedules(type, code, amount, level)
Task: Select salary from managers where type exists in schedules for the same level.
SQL: | SELECT salary FROM managers AS mgr
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09880 | train |
v3 | Schema:
projects (alias: prj)(name, id, salary, code)
regions(id, date, code, type)
Task: Find value from projects where amount exceeds the average amount from regions for the same code.
SQL: | SELECT value FROM projects AS prj
WHERE amount > (
SELECT AVG(amount) FROM regions AS rgn
WHERE rgn.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_09881 | train |
v3 | Schema:
invoices (alias: inv)(status, salary, type, name)
managers(type, name, date, amount)
Task: Retrieve value from invoices with amount above the COUNT(value) of managers rows sharing the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE amount > (
SELECT COUNT(value) FROM managers AS mgr
WHERE mgr.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09882 | train |
v1 | Schema:
employees (alias: emp)(level, code, amount, salary)
items(type, id, level, date)
Task: Select amount from employees where type exists in items for the same status.
SQL: | SELECT amount FROM employees AS emp
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09883 | train |
v2 | Schema:
accounts (alias: acct)(date, status, name, code)
categories(code, amount, date, status)
Task: Find salary from accounts where a matching record exists in categories with the same code.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09884 | train |
v2 | Schema:
invoices (alias: inv)(value, name, date, code)
tasks(level, value, status, date)
Task: Retrieve name from invoices that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09885 | train |
v3 | Schema:
staff (alias: empl)(id, type, name, code)
branches(type, date, salary, id)
Task: Find amount from staff where amount exceeds the maximum value from branches for the same status.
SQL: | SELECT amount FROM staff AS empl
WHERE amount > (
SELECT MAX(value) FROM branches AS brc
WHERE brc.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_09886 | train |
v2 | Schema:
orders (alias: ord)(value, salary, amount, date)
schedules(amount, code, name, type)
Task: Retrieve salary from orders that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09887 | train |
v1 | Schema:
customers (alias: cust)(amount, type, value, code)
branches(id, level, date, salary)
Task: Select name from customers where type exists in branches for the same id.
SQL: | SELECT name FROM customers AS cust
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "branches",
"outer_alias": "cust",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09888 | train |
v1 | Schema:
orders (alias: ord)(code, level, salary, id)
customers(status, type, amount, value)
Task: Select name from orders where level exists in customers for the same code.
SQL: | SELECT name FROM orders AS ord
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09889 | train |
v3 | Schema:
sales (alias: sale)(type, level, name, status)
invoices(date, amount, name, value)
Task: Retrieve id from sales with amount above the MIN(amount) of invoices rows sharing the same level.
SQL: | SELECT id FROM sales AS sale
WHERE amount > (
SELECT MIN(amount) FROM invoices AS inv
WHERE inv.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09890 | train |
v3 | Schema:
departments (alias: dept)(status, name, level, type)
regions(type, value, level, amount)
Task: Retrieve id from departments with salary above the MAX(salary) of regions rows sharing the same code.
SQL: | SELECT id FROM departments AS dept
WHERE salary > (
SELECT MAX(salary) FROM regions AS rgn
WHERE rgn.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09891 | train |
v1 | Schema:
branches (alias: brc)(amount, level, name, code)
tasks(date, status, amount, value)
Task: Retrieve amount from branches whose id is found in tasks rows where status matches the outer record.
SQL: | SELECT amount FROM branches AS brc
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_09892 | train |
v1 | Schema:
departments (alias: dept)(code, date, level, value)
invoices(status, name, value, code)
Task: Retrieve value from departments whose id is found in invoices rows where type matches the outer record.
SQL: | SELECT value FROM departments AS dept
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "invoices",
"outer_alias": "dept",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09893 | train |
v1 | Schema:
departments (alias: dept)(id, date, code, name)
transactions(level, value, type, name)
Task: Find name from departments where status appears in transactions entries with matching level.
SQL: | SELECT name FROM departments AS dept
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09894 | train |
v3 | Schema:
schedules (alias: schd)(date, id, status, salary)
invoices(amount, level, value, name)
Task: Retrieve id from schedules with amount above the COUNT(amount) of invoices rows sharing the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE amount > (
SELECT COUNT(amount) FROM invoices AS inv
WHERE inv.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09895 | train |
v3 | Schema:
invoices (alias: inv)(date, code, salary, name)
categories(code, level, status, value)
Task: Find amount from invoices where salary exceeds the minimum amount from categories for the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE salary > (
SELECT MIN(amount) FROM categories AS catg
WHERE catg.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09896 | train |
v3 | Schema:
accounts (alias: acct)(salary, type, date, id)
projects(id, date, type, value)
Task: Retrieve salary from accounts with value above the MIN(salary) of projects rows sharing the same level.
SQL: | SELECT salary FROM accounts AS acct
WHERE value > (
SELECT MIN(salary) FROM projects AS prj
WHERE prj.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09897 | train |
v3 | Schema:
employees (alias: emp)(status, date, amount, type)
requests(salary, id, value, date)
Task: Find salary from employees where value exceeds the maximum amount from requests for the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE value > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09898 | train |
v3 | Schema:
tasks (alias: tsk)(id, status, level, type)
projects(id, level, value, code)
Task: Retrieve name from tasks with value above the SUM(value) of projects rows sharing the same status.
SQL: | SELECT name FROM tasks AS tsk
WHERE value > (
SELECT SUM(value) FROM projects AS prj
WHERE prj.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_09899 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.