variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v1 | Schema:
items (alias: lne)(salary, value, date, level)
transactions(status, level, amount, salary)
Task: Select amount from items where status exists in transactions for the same level.
SQL: | SELECT amount FROM items AS lne
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14900 | train |
v2 | Schema:
managers (alias: mgr)(value, type, salary, level)
employees(value, amount, id, level)
Task: Find name from managers where a matching record exists in employees with the same status.
SQL: | SELECT name 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": "name",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14901 | train |
v1 | Schema:
requests (alias: ordr)(type, status, value, salary)
managers(date, status, name, value)
Task: Find amount from requests where status appears in managers entries with matching status.
SQL: | SELECT amount FROM requests AS ordr
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14902 | train |
v2 | Schema:
managers (alias: mgr)(value, id, code, level)
shipments(status, level, salary, date)
Task: Retrieve salary from managers that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14903 | train |
v2 | Schema:
accounts (alias: acct)(amount, code, salary, id)
orders(id, status, value, code)
Task: Find amount from accounts where a matching record exists in orders with the same id.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14904 | train |
v3 | Schema:
invoices (alias: inv)(status, code, level, id)
departments(value, status, id, level)
Task: Find id from invoices where value exceeds the count of salary from departments for the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE value > (
SELECT COUNT(salary) FROM departments AS dept
WHERE dept.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14905 | train |
v2 | Schema:
items (alias: lne)(type, code, level, amount)
projects(date, amount, value, id)
Task: Find name from items where a matching record exists in projects with the same type.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = lne.type
); | {
"outer_table": "items",
"inner_table": "projects",
"outer_alias": "lne",
"inner_alias": "prj",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14906 | train |
v3 | Schema:
invoices (alias: inv)(name, value, level, id)
items(salary, level, date, amount)
Task: Retrieve value from invoices with amount above the AVG(value) of items rows sharing the same level.
SQL: | SELECT value FROM invoices AS inv
WHERE amount > (
SELECT AVG(value) FROM items AS lne
WHERE lne.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14907 | train |
v3 | Schema:
staff (alias: empl)(value, name, code, date)
branches(value, type, salary, date)
Task: Find id from staff where salary exceeds the maximum value from branches for the same status.
SQL: | SELECT id FROM staff AS empl
WHERE salary > (
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": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14908 | train |
v1 | Schema:
transactions (alias: txn)(date, value, level, amount)
employees(salary, level, status, type)
Task: Select salary from transactions where status exists in employees for the same level.
SQL: | SELECT salary FROM transactions AS txn
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14909 | train |
v2 | Schema:
schedules (alias: schd)(date, amount, level, salary)
projects(amount, code, type, name)
Task: Find name from schedules where a matching record exists in projects with the same code.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14910 | train |
v1 | Schema:
regions (alias: rgn)(status, level, salary, code)
managers(id, salary, name, amount)
Task: Retrieve amount from regions whose type is found in managers rows where code matches the outer record.
SQL: | SELECT amount FROM regions AS rgn
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14911 | train |
v3 | Schema:
accounts (alias: acct)(id, salary, name, value)
items(value, code, status, id)
Task: Retrieve amount from accounts with amount above the AVG(value) of items rows sharing the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE amount > (
SELECT AVG(value) FROM items AS lne
WHERE lne.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14912 | train |
v3 | Schema:
invoices (alias: inv)(id, type, value, level)
transactions(status, type, amount, id)
Task: Retrieve id from invoices with value above the SUM(salary) of transactions rows sharing the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE value > (
SELECT SUM(salary) FROM transactions AS txn
WHERE txn.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14913 | train |
v2 | Schema:
schedules (alias: schd)(amount, salary, level, id)
tasks(level, name, date, salary)
Task: Find salary from schedules where a matching record exists in tasks with the same code.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14914 | train |
v1 | Schema:
projects (alias: prj)(type, id, date, level)
staff(amount, code, salary, status)
Task: Find amount from projects where id appears in staff entries with matching code.
SQL: | SELECT amount FROM projects AS prj
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "staff",
"outer_alias": "prj",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14915 | train |
v1 | Schema:
departments (alias: dept)(date, salary, value, amount)
accounts(status, type, id, level)
Task: Find name from departments where level appears in accounts entries with matching level.
SQL: | SELECT name FROM departments AS dept
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14916 | train |
v2 | Schema:
transactions (alias: txn)(value, date, amount, name)
managers(date, level, code, id)
Task: Find id from transactions where a matching record exists in managers with the same level.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14917 | train |
v3 | Schema:
requests (alias: ordr)(id, amount, code, date)
schedules(code, salary, amount, id)
Task: Retrieve value from requests with salary above the AVG(value) of schedules rows sharing the same level.
SQL: | SELECT value FROM requests AS ordr
WHERE salary > (
SELECT AVG(value) FROM schedules AS schd
WHERE schd.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14918 | train |
v1 | Schema:
schedules (alias: schd)(type, value, amount, salary)
tasks(status, amount, type, name)
Task: Retrieve value from schedules whose level is found in tasks rows where code matches the outer record.
SQL: | SELECT value FROM schedules AS schd
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14919 | train |
v2 | Schema:
tasks (alias: tsk)(id, amount, status, value)
managers(name, salary, value, level)
Task: Retrieve value from tasks that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14920 | train |
v2 | Schema:
orders (alias: ord)(amount, date, status, type)
tasks(name, code, status, date)
Task: Retrieve id from orders that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14921 | train |
v2 | Schema:
staff (alias: empl)(status, salary, type, amount)
products(date, type, name, status)
Task: Find name from staff where a matching record exists in products with the same type.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14922 | train |
v1 | Schema:
schedules (alias: schd)(salary, value, date, status)
departments(status, type, salary, code)
Task: Select value from schedules where type exists in departments for the same code.
SQL: | SELECT value FROM schedules AS schd
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14923 | train |
v1 | Schema:
schedules (alias: schd)(code, id, date, type)
regions(id, type, salary, level)
Task: Retrieve amount from schedules whose type is found in regions rows where code matches the outer record.
SQL: | SELECT amount FROM schedules AS schd
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14924 | train |
v1 | Schema:
branches (alias: brc)(level, status, code, amount)
customers(name, level, amount, status)
Task: Find code from branches where code appears in customers entries with matching type.
SQL: | SELECT code FROM branches AS brc
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14925 | train |
v2 | Schema:
categories (alias: catg)(status, type, id, amount)
tasks(amount, value, code, id)
Task: Find name from categories where a matching record exists in tasks with the same status.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14926 | train |
v1 | Schema:
products (alias: prod)(level, amount, type, salary)
orders(salary, value, id, code)
Task: Select code from products where status exists in orders for the same level.
SQL: | SELECT code FROM products AS prod
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.level = prod.level
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14927 | train |
v1 | Schema:
employees (alias: emp)(salary, code, status, level)
orders(name, amount, id, salary)
Task: Retrieve value from employees whose type is found in orders rows where level matches the outer record.
SQL: | SELECT value FROM employees AS emp
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14928 | train |
v3 | Schema:
tasks (alias: tsk)(level, value, code, type)
orders(name, status, salary, id)
Task: Retrieve code from tasks with amount above the MAX(amount) of orders rows sharing the same level.
SQL: | SELECT code FROM tasks AS tsk
WHERE amount > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14929 | train |
v2 | Schema:
shipments (alias: shp)(code, level, amount, status)
departments(date, status, code, name)
Task: Find name from shipments where a matching record exists in departments with the same level.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14930 | train |
v3 | Schema:
branches (alias: brc)(id, type, date, value)
invoices(level, amount, value, type)
Task: Find salary from branches where amount exceeds the count of value from invoices for the same code.
SQL: | SELECT salary FROM branches AS brc
WHERE amount > (
SELECT COUNT(value) FROM invoices AS inv
WHERE inv.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14931 | train |
v2 | Schema:
managers (alias: mgr)(name, type, status, salary)
tasks(amount, type, value, level)
Task: Retrieve amount from managers that have at least one corresponding entry in tasks sharing the same status.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14932 | train |
v2 | Schema:
transactions (alias: txn)(salary, level, value, name)
tasks(status, code, amount, value)
Task: Find id from transactions where a matching record exists in tasks with the same type.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14933 | train |
v3 | Schema:
branches (alias: brc)(salary, level, code, amount)
employees(id, level, date, salary)
Task: Retrieve code from branches with value above the SUM(salary) of employees rows sharing the same id.
SQL: | SELECT code FROM branches AS brc
WHERE value > (
SELECT SUM(salary) FROM employees AS emp
WHERE emp.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14934 | train |
v3 | Schema:
schedules (alias: schd)(type, status, value, amount)
transactions(salary, amount, level, code)
Task: Find amount from schedules where value exceeds the average salary from transactions for the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE value > (
SELECT AVG(salary) FROM transactions AS txn
WHERE txn.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14935 | train |
v1 | Schema:
orders (alias: ord)(type, code, id, name)
products(name, type, code, id)
Task: Select amount from orders where status exists in products for the same code.
SQL: | SELECT amount FROM orders AS ord
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14936 | train |
v2 | Schema:
sales (alias: sale)(type, level, code, amount)
items(id, code, status, salary)
Task: Retrieve value from sales that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14937 | train |
v1 | Schema:
transactions (alias: txn)(name, type, status, value)
employees(value, salary, id, code)
Task: Select code from transactions where type exists in employees for the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14938 | train |
v3 | Schema:
schedules (alias: schd)(value, date, status, code)
products(level, status, date, salary)
Task: Retrieve id from schedules with value above the MIN(value) of products rows sharing the same level.
SQL: | SELECT id FROM schedules AS schd
WHERE value > (
SELECT MIN(value) FROM products AS prod
WHERE prod.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14939 | train |
v2 | Schema:
departments (alias: dept)(date, code, amount, type)
branches(status, salary, date, id)
Task: Retrieve amount from departments that have at least one corresponding entry in branches sharing the same status.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14940 | train |
v3 | Schema:
staff (alias: empl)(code, status, type, amount)
orders(status, date, name, value)
Task: Retrieve name from staff with salary above the COUNT(salary) of orders rows sharing the same code.
SQL: | SELECT name FROM staff AS empl
WHERE salary > (
SELECT COUNT(salary) FROM orders AS ord
WHERE ord.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14941 | train |
v3 | Schema:
invoices (alias: inv)(value, type, date, code)
shipments(code, level, status, salary)
Task: Find code from invoices where value exceeds the count of value from shipments for the same code.
SQL: | SELECT code FROM invoices AS inv
WHERE value > (
SELECT COUNT(value) FROM shipments AS shp
WHERE shp.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14942 | train |
v3 | Schema:
branches (alias: brc)(value, amount, level, code)
projects(code, date, level, value)
Task: Retrieve salary from branches with salary above the MIN(salary) of projects rows sharing the same status.
SQL: | SELECT salary FROM branches AS brc
WHERE salary > (
SELECT MIN(salary) FROM projects AS prj
WHERE prj.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14943 | train |
v3 | Schema:
employees (alias: emp)(salary, date, value, name)
invoices(date, salary, status, code)
Task: Find salary from employees where salary exceeds the maximum value from invoices for the same id.
SQL: | SELECT salary FROM employees AS emp
WHERE salary > (
SELECT MAX(value) FROM invoices AS inv
WHERE inv.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14944 | train |
v2 | Schema:
employees (alias: emp)(level, id, status, salary)
staff(value, type, salary, status)
Task: Find name from employees where a matching record exists in staff with the same id.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14945 | train |
v1 | Schema:
projects (alias: prj)(amount, date, id, level)
tasks(type, level, date, salary)
Task: Find code from projects where status appears in tasks entries with matching status.
SQL: | SELECT code FROM projects AS prj
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "prj",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14946 | train |
v1 | Schema:
branches (alias: brc)(name, id, type, value)
projects(id, type, level, code)
Task: Retrieve salary from branches whose type is found in projects rows where level matches the outer record.
SQL: | SELECT salary FROM branches AS brc
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14947 | train |
v3 | Schema:
staff (alias: empl)(code, id, date, type)
managers(level, amount, status, value)
Task: Find salary from staff where value exceeds the maximum salary from managers for the same id.
SQL: | SELECT salary FROM staff AS empl
WHERE value > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14948 | train |
v3 | Schema:
schedules (alias: schd)(type, salary, code, level)
invoices(salary, name, type, amount)
Task: Find amount from schedules where amount exceeds the minimum amount from invoices for the same code.
SQL: | SELECT amount FROM schedules AS schd
WHERE amount > (
SELECT MIN(amount) FROM invoices AS inv
WHERE inv.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14949 | train |
v3 | Schema:
employees (alias: emp)(level, name, salary, date)
tasks(status, name, date, level)
Task: Find salary from employees where salary exceeds the count of value from tasks for the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE salary > (
SELECT COUNT(value) FROM tasks AS tsk
WHERE tsk.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14950 | train |
v1 | Schema:
categories (alias: catg)(id, level, value, code)
managers(id, name, salary, status)
Task: Find id from categories where type appears in managers entries with matching id.
SQL: | SELECT id FROM categories AS catg
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14951 | train |
v3 | Schema:
employees (alias: emp)(type, level, value, status)
regions(date, value, salary, status)
Task: Retrieve code from employees with value above the SUM(salary) of regions rows sharing the same status.
SQL: | SELECT code FROM employees AS emp
WHERE value > (
SELECT SUM(salary) FROM regions AS rgn
WHERE rgn.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14952 | train |
v2 | Schema:
tasks (alias: tsk)(salary, level, status, id)
invoices(status, code, id, date)
Task: Find code from tasks where a matching record exists in invoices with the same type.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14953 | train |
v1 | Schema:
sales (alias: sale)(level, status, amount, date)
invoices(salary, date, level, amount)
Task: Retrieve salary from sales whose status is found in invoices rows where id matches the outer record.
SQL: | SELECT salary FROM sales AS sale
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14954 | train |
v1 | Schema:
items (alias: lne)(code, name, value, date)
regions(type, value, date, id)
Task: Select amount from items where id exists in regions for the same status.
SQL: | SELECT amount FROM items AS lne
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14955 | train |
v2 | Schema:
orders (alias: ord)(name, date, type, code)
employees(value, date, name, type)
Task: Find code from orders where a matching record exists in employees with the same code.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14956 | train |
v3 | Schema:
tasks (alias: tsk)(name, level, id, status)
transactions(status, value, id, date)
Task: Retrieve code from tasks with salary above the SUM(amount) of transactions rows sharing the same status.
SQL: | SELECT code FROM tasks AS tsk
WHERE salary > (
SELECT SUM(amount) FROM transactions AS txn
WHERE txn.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14957 | train |
v3 | Schema:
projects (alias: prj)(id, name, salary, amount)
branches(status, name, id, amount)
Task: Find code from projects where value exceeds the total salary from branches for the same id.
SQL: | SELECT code FROM projects AS prj
WHERE value > (
SELECT SUM(salary) FROM branches AS brc
WHERE brc.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14958 | train |
v2 | Schema:
customers (alias: cust)(type, id, status, code)
employees(name, level, type, value)
Task: Retrieve salary from customers that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14959 | train |
v2 | Schema:
employees (alias: emp)(value, status, code, id)
departments(status, code, level, amount)
Task: Find value from employees where a matching record exists in departments with the same id.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14960 | train |
v2 | Schema:
items (alias: lne)(name, code, date, id)
invoices(amount, status, code, name)
Task: Find amount from items where a matching record exists in invoices with the same code.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = lne.code
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14961 | train |
v1 | Schema:
branches (alias: brc)(id, salary, level, amount)
employees(type, id, date, level)
Task: Find name from branches where type appears in employees entries with matching code.
SQL: | SELECT name FROM branches AS brc
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14962 | train |
v3 | Schema:
staff (alias: empl)(salary, type, amount, date)
departments(date, name, salary, level)
Task: Retrieve name from staff with amount above the COUNT(salary) of departments rows sharing the same status.
SQL: | SELECT name FROM staff AS empl
WHERE amount > (
SELECT COUNT(salary) FROM departments AS dept
WHERE dept.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14963 | train |
v1 | Schema:
customers (alias: cust)(name, code, value, salary)
employees(date, status, code, type)
Task: Find id from customers where status appears in employees entries with matching level.
SQL: | SELECT id FROM customers AS cust
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14964 | train |
v1 | Schema:
transactions (alias: txn)(date, type, id, amount)
managers(type, id, level, salary)
Task: Select salary from transactions where id exists in managers for the same type.
SQL: | SELECT salary FROM transactions AS txn
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14965 | train |
v3 | Schema:
transactions (alias: txn)(status, code, level, value)
invoices(value, level, name, code)
Task: Retrieve name from transactions with amount above the SUM(value) of invoices rows sharing the same type.
SQL: | SELECT name FROM transactions AS txn
WHERE amount > (
SELECT SUM(value) FROM invoices AS inv
WHERE inv.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14966 | train |
v2 | Schema:
accounts (alias: acct)(value, amount, name, type)
invoices(date, name, code, level)
Task: Find amount from accounts where a matching record exists in invoices with the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14967 | train |
v1 | Schema:
tasks (alias: tsk)(name, level, value, id)
transactions(salary, id, amount, value)
Task: Retrieve amount from tasks whose code is found in transactions rows where status matches the outer record.
SQL: | SELECT amount FROM tasks AS tsk
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14968 | train |
v2 | Schema:
requests (alias: ordr)(code, status, value, id)
managers(level, amount, name, type)
Task: Retrieve name from requests that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14969 | train |
v2 | Schema:
regions (alias: rgn)(value, salary, code, amount)
sales(level, date, id, value)
Task: Retrieve id from regions that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14970 | train |
v2 | Schema:
managers (alias: mgr)(status, value, name, type)
departments(name, value, salary, amount)
Task: Find salary from managers where a matching record exists in departments with the same status.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14971 | train |
v1 | Schema:
transactions (alias: txn)(name, value, amount, salary)
regions(value, status, level, code)
Task: Retrieve id from transactions whose type is found in regions rows where id matches the outer record.
SQL: | SELECT id FROM transactions AS txn
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14972 | train |
v2 | Schema:
regions (alias: rgn)(code, name, status, value)
shipments(name, id, date, type)
Task: Find id from regions where a matching record exists in shipments with the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14973 | train |
v3 | Schema:
managers (alias: mgr)(status, id, value, code)
accounts(name, level, type, amount)
Task: Retrieve id from managers with amount above the MAX(salary) of accounts rows sharing the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE amount > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14974 | train |
v3 | Schema:
requests (alias: ordr)(type, id, date, name)
tasks(status, name, salary, amount)
Task: Retrieve name from requests with amount above the MIN(amount) of tasks rows sharing the same level.
SQL: | SELECT name FROM requests AS ordr
WHERE amount > (
SELECT MIN(amount) FROM tasks AS tsk
WHERE tsk.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14975 | train |
v1 | Schema:
employees (alias: emp)(code, date, value, amount)
customers(status, amount, value, level)
Task: Find name from employees where status appears in customers entries with matching id.
SQL: | SELECT name FROM employees AS emp
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14976 | train |
v2 | Schema:
staff (alias: empl)(date, level, salary, amount)
sales(code, status, level, type)
Task: Retrieve id from staff that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14977 | train |
v3 | Schema:
items (alias: lne)(salary, date, status, value)
requests(code, name, amount, level)
Task: Retrieve value from items with value above the SUM(value) of requests rows sharing the same code.
SQL: | SELECT value FROM items AS lne
WHERE value > (
SELECT SUM(value) FROM requests AS ordr
WHERE ordr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14978 | train |
v3 | Schema:
staff (alias: empl)(level, status, value, salary)
transactions(type, level, status, amount)
Task: Find id from staff where salary exceeds the total amount from transactions for the same code.
SQL: | SELECT id FROM staff AS empl
WHERE salary > (
SELECT SUM(amount) FROM transactions AS txn
WHERE txn.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14979 | train |
v3 | Schema:
transactions (alias: txn)(salary, level, amount, name)
schedules(name, salary, value, status)
Task: Find id from transactions where value exceeds the total amount from schedules for the same status.
SQL: | SELECT id FROM transactions AS txn
WHERE value > (
SELECT SUM(amount) FROM schedules AS schd
WHERE schd.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14980 | train |
v1 | Schema:
managers (alias: mgr)(value, type, name, code)
items(name, status, level, amount)
Task: Retrieve id from managers whose code is found in items rows where id matches the outer record.
SQL: | SELECT id FROM managers AS mgr
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14981 | train |
v3 | Schema:
regions (alias: rgn)(code, date, amount, salary)
invoices(code, value, level, id)
Task: Retrieve id from regions with amount above the MAX(salary) of invoices rows sharing the same status.
SQL: | SELECT id FROM regions AS rgn
WHERE amount > (
SELECT MAX(salary) FROM invoices AS inv
WHERE inv.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14982 | train |
v1 | Schema:
customers (alias: cust)(date, salary, code, level)
items(value, amount, date, type)
Task: Select value from customers where level exists in items for the same code.
SQL: | SELECT value FROM customers AS cust
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14983 | train |
v2 | Schema:
accounts (alias: acct)(level, type, code, salary)
categories(date, amount, value, salary)
Task: Retrieve salary from accounts that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14984 | train |
v2 | Schema:
staff (alias: empl)(salary, code, level, value)
products(type, amount, salary, name)
Task: Find id from staff where a matching record exists in products with the same code.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14985 | train |
v2 | Schema:
categories (alias: catg)(level, status, value, code)
departments(code, name, id, amount)
Task: Retrieve salary from categories that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14986 | train |
v1 | Schema:
transactions (alias: txn)(date, type, code, status)
tasks(level, status, value, type)
Task: Retrieve code from transactions whose code is found in tasks rows where status matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14987 | train |
v3 | Schema:
branches (alias: brc)(type, level, code, status)
requests(level, name, status, date)
Task: Retrieve salary from branches with value above the MIN(amount) of requests rows sharing the same level.
SQL: | SELECT salary FROM branches AS brc
WHERE value > (
SELECT MIN(amount) FROM requests AS ordr
WHERE ordr.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14988 | train |
v1 | Schema:
staff (alias: empl)(type, amount, salary, name)
regions(status, name, salary, id)
Task: Find salary from staff where level appears in regions entries with matching id.
SQL: | SELECT salary FROM staff AS empl
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14989 | train |
v2 | Schema:
staff (alias: empl)(salary, id, value, status)
regions(status, code, level, id)
Task: Retrieve code from staff that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14990 | train |
v1 | Schema:
requests (alias: ordr)(amount, code, date, type)
staff(salary, name, status, date)
Task: Select code from requests where id exists in staff for the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14991 | train |
v3 | Schema:
accounts (alias: acct)(level, id, name, status)
projects(value, code, name, status)
Task: Find salary from accounts where salary exceeds the total salary from projects for the same status.
SQL: | SELECT salary FROM accounts AS acct
WHERE salary > (
SELECT SUM(salary) FROM projects AS prj
WHERE prj.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14992 | train |
v1 | Schema:
tasks (alias: tsk)(name, status, type, date)
items(date, value, name, amount)
Task: Find name from tasks where level appears in items entries with matching id.
SQL: | SELECT name FROM tasks AS tsk
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "items",
"outer_alias": "tsk",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14993 | train |
v2 | Schema:
shipments (alias: shp)(level, amount, value, name)
tasks(value, name, type, level)
Task: Find name from shipments where a matching record exists in tasks with the same code.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14994 | train |
v2 | Schema:
schedules (alias: schd)(code, amount, name, id)
sales(amount, date, level, value)
Task: Find value from schedules where a matching record exists in sales with the same code.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14995 | train |
v3 | Schema:
departments (alias: dept)(status, date, type, value)
categories(name, level, status, id)
Task: Retrieve amount from departments with amount above the MIN(value) of categories rows sharing the same level.
SQL: | SELECT amount FROM departments AS dept
WHERE amount > (
SELECT MIN(value) FROM categories AS catg
WHERE catg.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14996 | train |
v3 | Schema:
orders (alias: ord)(level, id, date, type)
requests(salary, code, id, level)
Task: Retrieve code from orders with amount above the COUNT(value) of requests rows sharing the same status.
SQL: | SELECT code FROM orders AS ord
WHERE amount > (
SELECT COUNT(value) FROM requests AS ordr
WHERE ordr.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14997 | train |
v1 | Schema:
products (alias: prod)(type, date, value, name)
managers(type, code, amount, salary)
Task: Select value from products where type exists in managers for the same type.
SQL: | SELECT value FROM products AS prod
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.type = prod.type
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14998 | train |
v3 | Schema:
employees (alias: emp)(code, name, type, id)
products(salary, value, date, id)
Task: Retrieve name from employees with salary above the MIN(value) of products rows sharing the same level.
SQL: | SELECT name FROM employees AS emp
WHERE salary > (
SELECT MIN(value) FROM products AS prod
WHERE prod.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14999 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.