variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v2 | Schema:
accounts (alias: acct)(amount, id, status, date)
sales(salary, id, name, amount)
Task: Retrieve value from accounts that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16700 | train |
v1 | Schema:
accounts (alias: acct)(salary, name, code, amount)
categories(type, date, code, name)
Task: Find amount from accounts where level appears in categories entries with matching level.
SQL: | SELECT amount FROM accounts AS acct
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16701 | train |
v2 | Schema:
tasks (alias: tsk)(level, value, salary, amount)
managers(level, name, salary, date)
Task: Retrieve value from tasks that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16702 | train |
v3 | Schema:
orders (alias: ord)(status, type, amount, level)
transactions(date, code, name, value)
Task: Find amount from orders where salary exceeds the minimum value from transactions for the same status.
SQL: | SELECT amount FROM orders AS ord
WHERE salary > (
SELECT MIN(value) FROM transactions AS txn
WHERE txn.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16703 | train |
v2 | Schema:
categories (alias: catg)(level, date, name, id)
regions(name, code, status, amount)
Task: Retrieve name from categories that have at least one corresponding entry in regions sharing the same level.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16704 | train |
v3 | Schema:
items (alias: lne)(status, level, id, date)
transactions(code, date, value, name)
Task: Find id from items where value exceeds the maximum amount from transactions for the same id.
SQL: | SELECT id FROM items AS lne
WHERE value > (
SELECT MAX(amount) FROM transactions AS txn
WHERE txn.id = lne.id
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16705 | train |
v2 | Schema:
transactions (alias: txn)(date, amount, id, level)
departments(level, id, type, value)
Task: Retrieve value from transactions that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16706 | train |
v3 | Schema:
sales (alias: sale)(level, id, name, code)
schedules(date, id, amount, code)
Task: Retrieve value from sales with salary above the COUNT(value) of schedules rows sharing the same type.
SQL: | SELECT value FROM sales AS sale
WHERE salary > (
SELECT COUNT(value) FROM schedules AS schd
WHERE schd.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16707 | train |
v3 | Schema:
projects (alias: prj)(date, amount, type, salary)
products(salary, date, id, level)
Task: Retrieve id from projects with salary above the COUNT(value) of products rows sharing the same id.
SQL: | SELECT id FROM projects AS prj
WHERE salary > (
SELECT COUNT(value) FROM products AS prod
WHERE prod.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16708 | train |
v1 | Schema:
departments (alias: dept)(value, level, status, name)
customers(date, code, salary, name)
Task: Select id from departments where id exists in customers for the same level.
SQL: | SELECT id FROM departments AS dept
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16709 | train |
v3 | Schema:
staff (alias: empl)(level, date, code, id)
accounts(code, salary, name, amount)
Task: Retrieve salary from staff with value above the SUM(salary) of accounts rows sharing the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE value > (
SELECT SUM(salary) FROM accounts AS acct
WHERE acct.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16710 | train |
v3 | Schema:
employees (alias: emp)(name, value, code, salary)
transactions(code, type, name, salary)
Task: Retrieve name from employees with amount above the MIN(salary) of transactions rows sharing the same id.
SQL: | SELECT name FROM employees AS emp
WHERE amount > (
SELECT MIN(salary) FROM transactions AS txn
WHERE txn.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16711 | train |
v1 | Schema:
customers (alias: cust)(code, level, id, type)
tasks(name, salary, value, code)
Task: Retrieve value from customers whose code is found in tasks rows where code matches the outer record.
SQL: | SELECT value FROM customers AS cust
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "tasks",
"outer_alias": "cust",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16712 | train |
v3 | Schema:
customers (alias: cust)(name, salary, type, level)
items(id, salary, date, code)
Task: Retrieve id from customers with amount above the MAX(value) of items rows sharing the same level.
SQL: | SELECT id FROM customers AS cust
WHERE amount > (
SELECT MAX(value) FROM items AS lne
WHERE lne.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16713 | train |
v3 | Schema:
managers (alias: mgr)(status, value, name, id)
customers(amount, value, name, status)
Task: Find amount from managers where salary exceeds the total value from customers for the same type.
SQL: | SELECT amount FROM managers AS mgr
WHERE salary > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16714 | train |
v2 | Schema:
regions (alias: rgn)(amount, salary, level, date)
shipments(code, salary, type, status)
Task: Find value from regions where a matching record exists in shipments with the same status.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16715 | train |
v2 | Schema:
items (alias: lne)(date, level, code, id)
shipments(level, code, salary, value)
Task: Find code from items where a matching record exists in shipments with the same id.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = lne.id
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16716 | train |
v2 | Schema:
sales (alias: sale)(name, status, value, amount)
projects(code, status, amount, level)
Task: Retrieve amount from sales that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16717 | train |
v3 | Schema:
regions (alias: rgn)(id, code, name, level)
employees(amount, id, status, name)
Task: Retrieve name from regions with salary above the MAX(value) of employees rows sharing the same id.
SQL: | SELECT name FROM regions AS rgn
WHERE salary > (
SELECT MAX(value) FROM employees AS emp
WHERE emp.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16718 | train |
v1 | Schema:
branches (alias: brc)(salary, code, value, level)
projects(amount, code, date, value)
Task: Select salary from branches where id exists in projects for the same status.
SQL: | SELECT salary FROM branches AS brc
WHERE id IN (
SELECT id 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": "id",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16719 | train |
v1 | Schema:
accounts (alias: acct)(value, salary, id, name)
transactions(salary, status, level, value)
Task: Find code from accounts where id appears in transactions entries with matching level.
SQL: | SELECT code FROM accounts AS acct
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16720 | train |
v3 | Schema:
requests (alias: ordr)(code, level, type, date)
invoices(name, value, amount, type)
Task: Retrieve code from requests with salary above the COUNT(value) of invoices rows sharing the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE salary > (
SELECT COUNT(value) FROM invoices AS inv
WHERE inv.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16721 | train |
v3 | Schema:
sales (alias: sale)(code, name, value, level)
invoices(code, type, status, date)
Task: Retrieve code from sales with amount above the SUM(amount) of invoices rows sharing the same id.
SQL: | SELECT code FROM sales AS sale
WHERE amount > (
SELECT SUM(amount) FROM invoices AS inv
WHERE inv.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16722 | train |
v3 | Schema:
tasks (alias: tsk)(value, level, amount, id)
branches(level, name, amount, type)
Task: Retrieve code from tasks with amount above the SUM(amount) of branches rows sharing the same id.
SQL: | SELECT code FROM tasks AS tsk
WHERE amount > (
SELECT SUM(amount) FROM branches AS brc
WHERE brc.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16723 | train |
v1 | Schema:
schedules (alias: schd)(level, value, status, amount)
invoices(name, amount, level, status)
Task: Find code from schedules where status appears in invoices entries with matching id.
SQL: | SELECT code FROM schedules AS schd
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16724 | train |
v1 | Schema:
customers (alias: cust)(salary, date, name, id)
categories(status, salary, name, amount)
Task: Retrieve code from customers whose level is found in categories rows where level matches the outer record.
SQL: | SELECT code FROM customers AS cust
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16725 | train |
v3 | Schema:
shipments (alias: shp)(salary, level, type, value)
tasks(code, level, type, date)
Task: Retrieve salary from shipments with amount above the COUNT(value) of tasks rows sharing the same id.
SQL: | SELECT salary FROM shipments AS shp
WHERE amount > (
SELECT COUNT(value) FROM tasks AS tsk
WHERE tsk.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16726 | train |
v2 | Schema:
requests (alias: ordr)(type, name, value, amount)
staff(value, amount, type, code)
Task: Retrieve code from requests that have at least one corresponding entry in staff sharing the same level.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16727 | train |
v3 | Schema:
customers (alias: cust)(amount, name, date, value)
regions(level, date, id, code)
Task: Find name from customers where amount exceeds the average value from regions for the same id.
SQL: | SELECT name FROM customers AS cust
WHERE amount > (
SELECT AVG(value) FROM regions AS rgn
WHERE rgn.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16728 | train |
v3 | Schema:
categories (alias: catg)(id, salary, type, level)
regions(code, date, id, salary)
Task: Find name from categories where salary exceeds the maximum salary from regions for the same level.
SQL: | SELECT name FROM categories AS catg
WHERE salary > (
SELECT MAX(salary) FROM regions AS rgn
WHERE rgn.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16729 | train |
v1 | Schema:
tasks (alias: tsk)(salary, level, amount, code)
products(status, name, code, date)
Task: Retrieve salary from tasks whose code is found in products rows where id matches the outer record.
SQL: | SELECT salary FROM tasks AS tsk
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16730 | train |
v2 | Schema:
orders (alias: ord)(salary, value, id, amount)
requests(name, date, type, salary)
Task: Find salary from orders where a matching record exists in requests with the same type.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16731 | train |
v1 | Schema:
schedules (alias: schd)(level, date, salary, name)
invoices(id, amount, value, level)
Task: Find salary from schedules where status appears in invoices entries with matching type.
SQL: | SELECT salary FROM schedules AS schd
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16732 | train |
v2 | Schema:
branches (alias: brc)(date, level, status, amount)
projects(date, level, id, status)
Task: Retrieve id from branches that have at least one corresponding entry in projects sharing the same id.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16733 | train |
v1 | Schema:
staff (alias: empl)(salary, id, status, date)
accounts(code, name, type, salary)
Task: Select amount from staff where id exists in accounts for the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16734 | train |
v1 | Schema:
branches (alias: brc)(type, date, level, code)
accounts(salary, name, id, amount)
Task: Select code from branches where status exists in accounts for the same id.
SQL: | SELECT code FROM branches AS brc
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "accounts",
"outer_alias": "brc",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16735 | train |
v3 | Schema:
regions (alias: rgn)(value, amount, level, salary)
tasks(status, id, amount, code)
Task: Find amount from regions where amount exceeds the minimum amount from tasks for the same type.
SQL: | SELECT amount FROM regions AS rgn
WHERE amount > (
SELECT MIN(amount) FROM tasks AS tsk
WHERE tsk.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16736 | train |
v2 | Schema:
branches (alias: brc)(type, name, value, code)
items(id, date, salary, level)
Task: Find amount from branches where a matching record exists in items with the same level.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16737 | train |
v2 | Schema:
items (alias: lne)(type, salary, value, date)
schedules(name, type, id, code)
Task: Retrieve code from items that have at least one corresponding entry in schedules sharing the same type.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = lne.type
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16738 | train |
v1 | Schema:
employees (alias: emp)(value, date, amount, code)
projects(code, id, name, value)
Task: Retrieve value from employees whose status is found in projects rows where level matches the outer record.
SQL: | SELECT value FROM employees AS emp
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "projects",
"outer_alias": "emp",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16739 | train |
v2 | Schema:
tasks (alias: tsk)(level, id, amount, type)
invoices(value, status, id, name)
Task: Retrieve salary from tasks that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT salary 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": "salary",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16740 | train |
v2 | Schema:
orders (alias: ord)(status, salary, date, level)
staff(salary, status, value, date)
Task: Retrieve name from orders that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16741 | train |
v2 | Schema:
managers (alias: mgr)(salary, level, type, value)
regions(date, id, amount, name)
Task: Retrieve code from managers that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16742 | train |
v2 | Schema:
staff (alias: empl)(id, name, date, level)
products(amount, level, date, value)
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_16743 | train |
v3 | Schema:
customers (alias: cust)(amount, status, type, name)
products(status, code, salary, date)
Task: Retrieve name from customers with salary above the MAX(salary) of products rows sharing the same status.
SQL: | SELECT name FROM customers AS cust
WHERE salary > (
SELECT MAX(salary) FROM products AS prod
WHERE prod.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16744 | train |
v3 | Schema:
requests (alias: ordr)(name, status, value, type)
managers(date, name, id, level)
Task: Find salary from requests where salary exceeds the maximum value from managers for the same code.
SQL: | SELECT salary FROM requests AS ordr
WHERE salary > (
SELECT MAX(value) FROM managers AS mgr
WHERE mgr.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16745 | train |
v2 | Schema:
accounts (alias: acct)(type, amount, id, salary)
transactions(status, id, level, date)
Task: Retrieve salary from accounts that have at least one corresponding entry in transactions sharing the same code.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16746 | train |
v2 | Schema:
accounts (alias: acct)(name, date, salary, level)
managers(code, id, type, name)
Task: Retrieve value from accounts that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16747 | train |
v1 | Schema:
regions (alias: rgn)(value, code, status, type)
categories(level, name, id, type)
Task: Find value from regions where level appears in categories entries with matching code.
SQL: | SELECT value FROM regions AS rgn
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16748 | train |
v2 | Schema:
transactions (alias: txn)(code, date, status, type)
accounts(id, amount, value, code)
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_16749 | train |
v1 | Schema:
schedules (alias: schd)(salary, type, status, name)
sales(type, date, value, status)
Task: Retrieve value from schedules whose id is found in sales rows where id matches the outer record.
SQL: | SELECT value FROM schedules AS schd
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16750 | train |
v1 | Schema:
tasks (alias: tsk)(type, name, id, date)
managers(salary, code, status, id)
Task: Find code from tasks where id appears in managers entries with matching status.
SQL: | SELECT code FROM tasks AS tsk
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16751 | train |
v2 | Schema:
projects (alias: prj)(name, date, value, salary)
sales(amount, id, status, code)
Task: Find amount from projects where a matching record exists in sales with the same type.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16752 | train |
v2 | Schema:
sales (alias: sale)(name, status, amount, level)
orders(value, status, code, id)
Task: Retrieve id from sales that have at least one corresponding entry in orders sharing the same status.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16753 | train |
v3 | Schema:
projects (alias: prj)(amount, date, level, name)
orders(id, date, value, level)
Task: Retrieve id from projects with value above the MAX(value) of orders rows sharing the same type.
SQL: | SELECT id FROM projects AS prj
WHERE value > (
SELECT MAX(value) FROM orders AS ord
WHERE ord.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "orders",
"outer_alias": "prj",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16754 | train |
v3 | Schema:
products (alias: prod)(date, value, name, id)
employees(name, code, amount, type)
Task: Retrieve name from products with amount above the AVG(value) of employees rows sharing the same code.
SQL: | SELECT name FROM products AS prod
WHERE amount > (
SELECT AVG(value) FROM employees AS emp
WHERE emp.code = prod.code
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16755 | train |
v1 | Schema:
transactions (alias: txn)(level, status, name, date)
branches(status, salary, code, level)
Task: Find value from transactions where id appears in branches entries with matching id.
SQL: | SELECT value FROM transactions AS txn
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16756 | train |
v2 | Schema:
categories (alias: catg)(type, amount, value, id)
accounts(value, date, level, status)
Task: Retrieve amount from categories that have at least one corresponding entry in accounts sharing the same type.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16757 | train |
v3 | Schema:
requests (alias: ordr)(id, code, date, name)
products(name, value, salary, type)
Task: Find code from requests where salary exceeds the average amount from products for the same level.
SQL: | SELECT code FROM requests AS ordr
WHERE salary > (
SELECT AVG(amount) FROM products AS prod
WHERE prod.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16758 | train |
v1 | Schema:
sales (alias: sale)(value, salary, amount, level)
tasks(id, name, type, level)
Task: Retrieve name from sales whose level is found in tasks rows where code matches the outer record.
SQL: | SELECT name FROM sales AS sale
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16759 | train |
v1 | Schema:
tasks (alias: tsk)(code, status, type, value)
categories(date, name, id, salary)
Task: Retrieve value from tasks whose type is found in categories rows where level matches the outer record.
SQL: | SELECT value FROM tasks AS tsk
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16760 | train |
v1 | Schema:
sales (alias: sale)(status, name, id, amount)
regions(type, salary, id, amount)
Task: Select amount from sales where type exists in regions for the same status.
SQL: | SELECT amount FROM sales AS sale
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16761 | train |
v3 | Schema:
orders (alias: ord)(type, date, value, salary)
products(id, salary, date, amount)
Task: Find name from orders where amount exceeds the average value from products for the same level.
SQL: | SELECT name FROM orders AS ord
WHERE amount > (
SELECT AVG(value) FROM products AS prod
WHERE prod.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16762 | train |
v3 | Schema:
products (alias: prod)(amount, type, status, salary)
orders(level, code, salary, date)
Task: Find id from products where amount exceeds the average value from orders for the same id.
SQL: | SELECT id FROM products AS prod
WHERE amount > (
SELECT AVG(value) FROM orders AS ord
WHERE ord.id = prod.id
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16763 | train |
v3 | Schema:
regions (alias: rgn)(amount, salary, date, name)
transactions(id, amount, type, name)
Task: Find salary from regions where amount exceeds the average value from transactions for the same type.
SQL: | SELECT salary FROM regions AS rgn
WHERE amount > (
SELECT AVG(value) FROM transactions AS txn
WHERE txn.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16764 | train |
v3 | Schema:
products (alias: prod)(date, status, name, value)
managers(value, id, status, level)
Task: Find id from products where salary exceeds the average value from managers for the same status.
SQL: | SELECT id FROM products AS prod
WHERE salary > (
SELECT AVG(value) FROM managers AS mgr
WHERE mgr.status = prod.status
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16765 | train |
v1 | Schema:
accounts (alias: acct)(date, id, status, value)
categories(level, amount, type, status)
Task: Select code from accounts where code exists in categories for the same id.
SQL: | SELECT code FROM accounts AS acct
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16766 | train |
v3 | Schema:
transactions (alias: txn)(id, name, salary, status)
requests(id, status, date, type)
Task: Find amount from transactions where value exceeds the minimum value from requests for the same type.
SQL: | SELECT amount FROM transactions AS txn
WHERE value > (
SELECT MIN(value) FROM requests AS ordr
WHERE ordr.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16767 | train |
v1 | Schema:
items (alias: lne)(date, type, salary, code)
products(status, id, date, value)
Task: Find salary from items where level appears in products entries with matching id.
SQL: | SELECT salary FROM items AS lne
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.id = lne.id
); | {
"outer_table": "items",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16768 | train |
v3 | Schema:
schedules (alias: schd)(name, amount, value, status)
shipments(code, status, date, name)
Task: Find id from schedules where amount exceeds the minimum amount from shipments for the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE amount > (
SELECT MIN(amount) FROM shipments AS shp
WHERE shp.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16769 | train |
v1 | Schema:
shipments (alias: shp)(level, name, amount, code)
products(type, status, code, amount)
Task: Retrieve salary from shipments whose code is found in products rows where id matches the outer record.
SQL: | SELECT salary FROM shipments AS shp
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16770 | train |
v2 | Schema:
employees (alias: emp)(status, type, value, amount)
branches(value, salary, id, code)
Task: Find name from employees where a matching record exists in branches with the same id.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16771 | train |
v1 | Schema:
items (alias: lne)(code, value, name, type)
departments(name, amount, salary, date)
Task: Find name from items where id appears in departments entries with matching level.
SQL: | SELECT name FROM items AS lne
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.level = lne.level
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16772 | train |
v1 | Schema:
branches (alias: brc)(level, amount, value, date)
sales(salary, level, amount, type)
Task: Find name from branches where id appears in sales entries with matching code.
SQL: | SELECT name FROM branches AS brc
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16773 | train |
v1 | Schema:
shipments (alias: shp)(name, date, type, code)
products(value, amount, name, status)
Task: Retrieve salary from shipments whose level is found in products rows where id matches the outer record.
SQL: | SELECT salary FROM shipments AS shp
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16774 | train |
v1 | Schema:
regions (alias: rgn)(date, id, level, type)
items(value, code, type, salary)
Task: Retrieve code from regions whose level is found in items rows where code matches the outer record.
SQL: | SELECT code FROM regions AS rgn
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16775 | train |
v1 | Schema:
managers (alias: mgr)(status, amount, salary, name)
items(type, level, value, salary)
Task: Select value from managers where code exists in items for the same type.
SQL: | SELECT value FROM managers AS mgr
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16776 | train |
v3 | Schema:
schedules (alias: schd)(status, salary, level, date)
accounts(type, code, status, value)
Task: Find code from schedules where amount exceeds the maximum amount from accounts for the same status.
SQL: | SELECT code FROM schedules AS schd
WHERE amount > (
SELECT MAX(amount) FROM accounts AS acct
WHERE acct.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16777 | train |
v2 | Schema:
managers (alias: mgr)(name, status, level, amount)
requests(id, type, salary, level)
Task: Find code from managers where a matching record exists in requests with the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16778 | train |
v3 | Schema:
items (alias: lne)(date, salary, value, level)
regions(code, value, name, salary)
Task: Retrieve value from items with amount above the MIN(amount) of regions rows sharing the same status.
SQL: | SELECT value FROM items AS lne
WHERE amount > (
SELECT MIN(amount) FROM regions AS rgn
WHERE rgn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16779 | train |
v1 | Schema:
staff (alias: empl)(code, status, amount, date)
orders(id, value, type, level)
Task: Find value from staff where id appears in orders entries with matching level.
SQL: | SELECT value FROM staff AS empl
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16780 | train |
v3 | Schema:
projects (alias: prj)(amount, salary, status, name)
tasks(type, status, date, amount)
Task: Find value from projects where salary exceeds the maximum value from tasks for the same code.
SQL: | SELECT value FROM projects AS prj
WHERE salary > (
SELECT MAX(value) FROM tasks AS tsk
WHERE tsk.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "prj",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16781 | train |
v2 | Schema:
customers (alias: cust)(code, amount, level, name)
accounts(type, date, value, status)
Task: Retrieve id from customers that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16782 | train |
v3 | Schema:
transactions (alias: txn)(value, type, amount, level)
accounts(type, level, date, id)
Task: Find salary from transactions where salary exceeds the average salary from accounts for the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE salary > (
SELECT AVG(salary) FROM accounts AS acct
WHERE acct.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16783 | train |
v2 | Schema:
orders (alias: ord)(id, value, amount, date)
regions(level, salary, date, name)
Task: Retrieve amount from orders that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16784 | train |
v3 | Schema:
shipments (alias: shp)(amount, id, value, name)
customers(type, date, level, name)
Task: Retrieve amount from shipments with amount above the AVG(amount) of customers rows sharing the same type.
SQL: | SELECT amount FROM shipments AS shp
WHERE amount > (
SELECT AVG(amount) FROM customers AS cust
WHERE cust.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16785 | train |
v1 | Schema:
sales (alias: sale)(salary, level, code, date)
invoices(amount, date, id, name)
Task: Retrieve id from sales whose status is found in invoices rows where type matches the outer record.
SQL: | SELECT id FROM sales AS sale
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16786 | train |
v1 | Schema:
regions (alias: rgn)(salary, id, level, value)
sales(value, name, status, type)
Task: Find id from regions where code appears in sales entries with matching type.
SQL: | SELECT id FROM regions AS rgn
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16787 | train |
v1 | Schema:
staff (alias: empl)(code, status, id, date)
departments(code, level, salary, amount)
Task: Retrieve salary from staff whose level is found in departments rows where id matches the outer record.
SQL: | SELECT salary FROM staff AS empl
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16788 | train |
v2 | Schema:
shipments (alias: shp)(code, amount, status, salary)
projects(status, code, type, date)
Task: Retrieve salary from shipments that have at least one corresponding entry in projects sharing the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16789 | train |
v1 | Schema:
employees (alias: emp)(salary, code, status, name)
products(name, level, type, date)
Task: Find value from employees where level appears in products entries with matching type.
SQL: | SELECT value FROM employees AS emp
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16790 | train |
v1 | Schema:
managers (alias: mgr)(status, name, amount, code)
accounts(status, code, date, value)
Task: Find code from managers where code appears in accounts entries with matching id.
SQL: | SELECT code FROM managers AS mgr
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16791 | train |
v2 | Schema:
managers (alias: mgr)(amount, level, salary, id)
shipments(amount, value, id, status)
Task: Find name from managers where a matching record exists in shipments with the same code.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16792 | train |
v1 | Schema:
regions (alias: rgn)(code, date, level, id)
schedules(name, type, level, id)
Task: Select value from regions where id exists in schedules for the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16793 | train |
v3 | Schema:
schedules (alias: schd)(date, id, name, level)
branches(value, salary, date, status)
Task: Find name from schedules where amount exceeds the count of salary from branches for the same level.
SQL: | SELECT name FROM schedules AS schd
WHERE amount > (
SELECT COUNT(salary) FROM branches AS brc
WHERE brc.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16794 | train |
v1 | Schema:
items (alias: lne)(amount, value, status, level)
managers(salary, level, name, amount)
Task: Retrieve value from items whose id is found in managers rows where code matches the outer record.
SQL: | SELECT value FROM items AS lne
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16795 | train |
v1 | Schema:
products (alias: prod)(salary, level, amount, type)
customers(salary, name, level, type)
Task: Select code from products where code exists in customers for the same type.
SQL: | SELECT code FROM products AS prod
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.type = prod.type
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16796 | train |
v3 | Schema:
regions (alias: rgn)(type, value, name, level)
projects(salary, level, code, type)
Task: Retrieve value from regions with value above the SUM(value) of projects rows sharing the same status.
SQL: | SELECT value FROM regions AS rgn
WHERE value > (
SELECT SUM(value) FROM projects AS prj
WHERE prj.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16797 | train |
v1 | Schema:
products (alias: prod)(status, id, code, amount)
employees(amount, status, date, salary)
Task: Find code from products where level appears in employees entries with matching id.
SQL: | SELECT code FROM products AS prod
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.id = prod.id
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16798 | train |
v1 | Schema:
sales (alias: sale)(value, level, salary, status)
invoices(amount, type, salary, id)
Task: Retrieve name from sales whose level is found in invoices rows where type matches the outer record.
SQL: | SELECT name FROM sales AS sale
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16799 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.