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:
products (alias: prod)(amount, name, id, salary)
sales(salary, level, value, date)
Task: Retrieve code from products whose level is found in sales rows where id matches the outer record.
SQL: | SELECT code FROM products AS prod
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.id = prod.id
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10700 | train |
v3 | Schema:
managers (alias: mgr)(status, code, date, salary)
items(status, amount, value, id)
Task: Retrieve salary from managers with salary above the MIN(value) of items rows sharing the same id.
SQL: | SELECT salary FROM managers AS mgr
WHERE salary > (
SELECT MIN(value) FROM items AS lne
WHERE lne.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10701 | train |
v3 | Schema:
requests (alias: ordr)(id, salary, value, type)
invoices(code, type, id, amount)
Task: Retrieve amount from requests with amount above the MAX(amount) of invoices rows sharing the same code.
SQL: | SELECT amount FROM requests AS ordr
WHERE amount > (
SELECT MAX(amount) FROM invoices AS inv
WHERE inv.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10702 | train |
v1 | Schema:
transactions (alias: txn)(name, value, amount, status)
sales(type, code, level, date)
Task: Select name from transactions where code exists in sales for the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10703 | train |
v2 | Schema:
branches (alias: brc)(value, name, id, amount)
staff(level, amount, salary, name)
Task: Retrieve salary from branches that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_10704 | train |
v1 | Schema:
transactions (alias: txn)(code, id, date, name)
departments(amount, status, name, salary)
Task: Select id from transactions where code exists in departments for the same id.
SQL: | SELECT id FROM transactions AS txn
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10705 | train |
v2 | Schema:
employees (alias: emp)(code, status, id, value)
orders(value, status, type, amount)
Task: Find code from employees where a matching record exists in orders with the same status.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10706 | train |
v1 | Schema:
products (alias: prod)(salary, date, level, code)
schedules(code, amount, value, type)
Task: Find salary from products where type appears in schedules entries with matching id.
SQL: | SELECT salary FROM products AS prod
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.id = prod.id
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10707 | train |
v1 | Schema:
requests (alias: ordr)(status, salary, name, amount)
branches(id, name, code, value)
Task: Retrieve id from requests whose status is found in branches rows where type matches the outer record.
SQL: | SELECT id FROM requests AS ordr
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10708 | train |
v3 | Schema:
products (alias: prod)(value, code, name, id)
departments(date, salary, level, type)
Task: Find name from products where amount exceeds the maximum amount from departments for the same type.
SQL: | SELECT name FROM products AS prod
WHERE amount > (
SELECT MAX(amount) FROM departments AS dept
WHERE dept.type = prod.type
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10709 | train |
v2 | Schema:
categories (alias: catg)(level, date, amount, salary)
branches(id, code, name, type)
Task: Retrieve name from categories that have at least one corresponding entry in branches sharing the same status.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10710 | train |
v1 | Schema:
regions (alias: rgn)(salary, code, amount, status)
shipments(code, id, salary, date)
Task: Retrieve value from regions whose status is found in shipments rows where level matches the outer record.
SQL: | SELECT value FROM regions AS rgn
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10711 | train |
v2 | Schema:
departments (alias: dept)(name, status, value, date)
tasks(value, amount, date, type)
Task: Find amount from departments where a matching record exists in tasks with the same code.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10712 | train |
v2 | Schema:
transactions (alias: txn)(status, type, date, amount)
accounts(id, amount, value, date)
Task: Find name from transactions where a matching record exists in accounts with the same type.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10713 | train |
v1 | Schema:
customers (alias: cust)(type, salary, level, code)
tasks(date, name, value, amount)
Task: Retrieve code from customers whose status is found in tasks rows where status matches the outer record.
SQL: | SELECT code FROM customers AS cust
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "tasks",
"outer_alias": "cust",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10714 | train |
v3 | Schema:
items (alias: lne)(name, type, id, status)
regions(type, date, id, status)
Task: Retrieve name from items with value above the COUNT(salary) of regions rows sharing the same id.
SQL: | SELECT name FROM items AS lne
WHERE value > (
SELECT COUNT(salary) FROM regions AS rgn
WHERE rgn.id = lne.id
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10715 | train |
v3 | Schema:
products (alias: prod)(type, status, amount, salary)
transactions(level, type, status, amount)
Task: Retrieve salary from products with amount above the MAX(amount) of transactions rows sharing the same level.
SQL: | SELECT salary FROM products AS prod
WHERE amount > (
SELECT MAX(amount) FROM transactions AS txn
WHERE txn.level = prod.level
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10716 | train |
v1 | Schema:
accounts (alias: acct)(name, salary, type, amount)
branches(code, status, type, level)
Task: Select name from accounts where id exists in branches for the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10717 | train |
v1 | Schema:
employees (alias: emp)(salary, name, status, amount)
transactions(id, status, amount, name)
Task: Select salary from employees where id exists in transactions for the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10718 | train |
v3 | Schema:
items (alias: lne)(code, name, amount, status)
projects(id, level, value, type)
Task: Retrieve code from items with salary above the MAX(salary) of projects rows sharing the same level.
SQL: | SELECT code FROM items AS lne
WHERE salary > (
SELECT MAX(salary) FROM projects AS prj
WHERE prj.level = lne.level
); | {
"outer_table": "items",
"inner_table": "projects",
"outer_alias": "lne",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10719 | train |
v3 | Schema:
invoices (alias: inv)(level, salary, name, amount)
sales(level, type, name, status)
Task: Find name from invoices where salary exceeds the maximum salary from sales for the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE salary > (
SELECT MAX(salary) FROM sales AS sale
WHERE sale.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10720 | train |
v1 | Schema:
invoices (alias: inv)(date, level, code, salary)
sales(salary, amount, value, code)
Task: Find value from invoices where level appears in sales entries with matching type.
SQL: | SELECT value FROM invoices AS inv
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10721 | train |
v3 | Schema:
departments (alias: dept)(level, value, id, type)
schedules(name, level, value, type)
Task: Retrieve id from departments with amount above the SUM(value) of schedules rows sharing the same level.
SQL: | SELECT id FROM departments AS dept
WHERE amount > (
SELECT SUM(value) FROM schedules AS schd
WHERE schd.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10722 | train |
v1 | Schema:
items (alias: lne)(salary, date, code, value)
transactions(code, id, value, amount)
Task: Find value from items where level appears in transactions entries with matching status.
SQL: | SELECT value FROM items AS lne
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10723 | train |
v2 | Schema:
staff (alias: empl)(date, salary, status, type)
customers(id, status, salary, amount)
Task: Find id from staff where a matching record exists in customers with the same status.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10724 | train |
v2 | Schema:
sales (alias: sale)(type, id, value, salary)
tasks(level, date, code, status)
Task: Retrieve value from sales that have at least one corresponding entry in tasks sharing the same code.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10725 | train |
v1 | Schema:
sales (alias: sale)(name, code, status, amount)
orders(value, code, id, type)
Task: Retrieve value from sales whose level is found in orders rows where status matches the outer record.
SQL: | SELECT value FROM sales AS sale
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10726 | train |
v3 | Schema:
accounts (alias: acct)(status, amount, value, name)
customers(amount, status, level, name)
Task: Retrieve amount from accounts with salary above the MAX(value) of customers rows sharing the same status.
SQL: | SELECT amount FROM accounts AS acct
WHERE salary > (
SELECT MAX(value) FROM customers AS cust
WHERE cust.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10727 | train |
v2 | Schema:
tasks (alias: tsk)(status, amount, type, id)
items(name, type, salary, status)
Task: Find value from tasks where a matching record exists in items with the same code.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "items",
"outer_alias": "tsk",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_10728 | train |
v2 | Schema:
sales (alias: sale)(salary, type, amount, level)
requests(type, amount, name, salary)
Task: Find name from sales where a matching record exists in requests with the same id.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10729 | train |
v2 | Schema:
staff (alias: empl)(code, id, date, type)
managers(code, id, salary, date)
Task: Retrieve id from staff that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10730 | train |
v3 | Schema:
managers (alias: mgr)(status, code, id, date)
categories(code, date, id, amount)
Task: Retrieve name from managers with salary above the COUNT(amount) of categories rows sharing the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE salary > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10731 | train |
v2 | Schema:
categories (alias: catg)(status, amount, id, value)
requests(type, amount, id, code)
Task: Find value from categories where a matching record exists in requests with the same code.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10732 | train |
v2 | Schema:
transactions (alias: txn)(id, amount, status, value)
requests(type, code, amount, level)
Task: Retrieve salary from transactions that have at least one corresponding entry in requests sharing the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10733 | train |
v3 | Schema:
managers (alias: mgr)(type, salary, id, level)
invoices(type, code, value, salary)
Task: Find salary from managers where salary exceeds the total salary from invoices for the same status.
SQL: | SELECT salary FROM managers AS mgr
WHERE salary > (
SELECT SUM(salary) FROM invoices AS inv
WHERE inv.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10734 | train |
v3 | Schema:
invoices (alias: inv)(name, date, status, salary)
products(amount, status, value, type)
Task: Find salary from invoices where value exceeds the maximum salary from products for the same level.
SQL: | SELECT salary FROM invoices AS inv
WHERE value > (
SELECT MAX(salary) FROM products AS prod
WHERE prod.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10735 | train |
v3 | Schema:
transactions (alias: txn)(name, type, status, salary)
schedules(code, name, amount, level)
Task: Find amount from transactions where value exceeds the minimum value from schedules for the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE value > (
SELECT MIN(value) FROM schedules AS schd
WHERE schd.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10736 | train |
v3 | Schema:
products (alias: prod)(salary, value, name, date)
requests(level, salary, value, type)
Task: Find salary from products where amount exceeds the average amount from requests for the same level.
SQL: | SELECT salary FROM products AS prod
WHERE amount > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10737 | train |
v3 | Schema:
branches (alias: brc)(name, status, type, id)
staff(salary, amount, name, code)
Task: Find name from branches where amount exceeds the maximum salary from staff for the same level.
SQL: | SELECT name FROM branches AS brc
WHERE amount > (
SELECT MAX(salary) FROM staff AS empl
WHERE empl.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_10738 | train |
v1 | Schema:
regions (alias: rgn)(id, type, name, value)
categories(salary, amount, date, name)
Task: Find name from regions where status appears in categories entries with matching level.
SQL: | SELECT name FROM regions AS rgn
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10739 | train |
v2 | Schema:
customers (alias: cust)(date, type, status, value)
managers(type, level, value, id)
Task: Retrieve value from customers that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10740 | train |
v3 | Schema:
orders (alias: ord)(name, salary, type, amount)
managers(date, value, type, id)
Task: Find name from orders where salary exceeds the maximum salary from managers for the same status.
SQL: | SELECT name FROM orders AS ord
WHERE salary > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10741 | train |
v1 | Schema:
projects (alias: prj)(name, code, level, id)
departments(status, salary, value, id)
Task: Retrieve name from projects whose level is found in departments rows where level matches the outer record.
SQL: | SELECT name FROM projects AS prj
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10742 | train |
v1 | Schema:
branches (alias: brc)(name, id, date, type)
requests(level, id, status, date)
Task: Find id from branches where id appears in requests entries with matching type.
SQL: | SELECT id FROM branches AS brc
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_10743 | train |
v1 | Schema:
employees (alias: emp)(code, name, level, value)
invoices(salary, value, id, date)
Task: Retrieve name from employees whose type is found in invoices rows where type matches the outer record.
SQL: | SELECT name FROM employees AS emp
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10744 | train |
v2 | Schema:
regions (alias: rgn)(value, name, type, id)
requests(date, amount, type, code)
Task: Find value from regions where a matching record exists in requests with the same type.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10745 | train |
v2 | Schema:
requests (alias: ordr)(status, id, date, level)
orders(level, salary, id, date)
Task: Find amount from requests where a matching record exists in orders with the same level.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10746 | train |
v3 | Schema:
sales (alias: sale)(value, code, amount, date)
tasks(value, type, status, id)
Task: Find code from sales where salary exceeds the average amount from tasks for the same type.
SQL: | SELECT code FROM sales AS sale
WHERE salary > (
SELECT AVG(amount) FROM tasks AS tsk
WHERE tsk.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10747 | train |
v1 | Schema:
sales (alias: sale)(name, salary, date, type)
categories(type, date, salary, code)
Task: Select salary from sales where id exists in categories for the same status.
SQL: | SELECT salary FROM sales AS sale
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10748 | train |
v2 | Schema:
invoices (alias: inv)(level, value, name, id)
requests(id, salary, type, date)
Task: Retrieve id from invoices that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10749 | train |
v1 | Schema:
customers (alias: cust)(value, id, type, date)
managers(amount, type, id, salary)
Task: Select salary from customers where id exists in managers for the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10750 | train |
v1 | Schema:
schedules (alias: schd)(status, id, amount, level)
products(salary, value, level, status)
Task: Retrieve value from schedules whose code is found in products rows where status matches the outer record.
SQL: | SELECT value FROM schedules AS schd
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10751 | train |
v1 | Schema:
products (alias: prod)(salary, code, type, date)
employees(name, salary, level, type)
Task: Find salary from products where status appears in employees entries with matching code.
SQL: | SELECT salary FROM products AS prod
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.code = prod.code
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10752 | train |
v2 | Schema:
products (alias: prod)(amount, level, date, value)
transactions(code, id, type, status)
Task: Find code from products where a matching record exists in transactions with the same level.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = prod.level
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10753 | train |
v2 | Schema:
shipments (alias: shp)(status, id, type, amount)
categories(value, code, status, name)
Task: Retrieve salary from shipments that have at least one corresponding entry in categories sharing the same level.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10754 | train |
v2 | Schema:
projects (alias: prj)(id, salary, status, date)
managers(type, salary, status, value)
Task: Find value from projects where a matching record exists in managers with the same status.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10755 | train |
v1 | Schema:
requests (alias: ordr)(level, status, code, date)
transactions(id, salary, name, code)
Task: Select salary from requests where id exists in transactions for the same level.
SQL: | SELECT salary FROM requests AS ordr
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10756 | train |
v2 | Schema:
shipments (alias: shp)(amount, level, date, status)
requests(name, value, type, salary)
Task: Find amount from shipments where a matching record exists in requests with the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10757 | train |
v2 | Schema:
invoices (alias: inv)(name, date, level, status)
tasks(value, date, salary, id)
Task: Find id from invoices where a matching record exists in tasks with the same type.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10758 | train |
v1 | Schema:
managers (alias: mgr)(type, date, status, level)
schedules(level, status, name, date)
Task: Select value from managers where level exists in schedules for the same type.
SQL: | SELECT value FROM managers AS mgr
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10759 | train |
v1 | Schema:
branches (alias: brc)(code, amount, date, salary)
schedules(code, amount, level, status)
Task: Find name from branches where level appears in schedules entries with matching status.
SQL: | SELECT name FROM branches AS brc
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "schedules",
"outer_alias": "brc",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_10760 | train |
v1 | Schema:
managers (alias: mgr)(name, code, type, salary)
projects(level, value, type, amount)
Task: Retrieve code from managers whose level is found in projects rows where type matches the outer record.
SQL: | SELECT code FROM managers AS mgr
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10761 | train |
v3 | Schema:
projects (alias: prj)(code, name, id, salary)
sales(name, amount, level, salary)
Task: Find code from projects where value exceeds the count of amount from sales for the same code.
SQL: | SELECT code FROM projects AS prj
WHERE value > (
SELECT COUNT(amount) FROM sales AS sale
WHERE sale.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10762 | train |
v1 | Schema:
invoices (alias: inv)(name, salary, date, status)
customers(status, salary, date, id)
Task: Find value from invoices where code appears in customers entries with matching level.
SQL: | SELECT value FROM invoices AS inv
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10763 | train |
v2 | Schema:
items (alias: lne)(code, type, salary, name)
schedules(salary, date, value, name)
Task: Find amount from items where a matching record exists in schedules with the same level.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = lne.level
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10764 | train |
v1 | Schema:
sales (alias: sale)(salary, name, status, date)
branches(date, code, name, salary)
Task: Find id from sales where type appears in branches entries with matching level.
SQL: | SELECT id FROM sales AS sale
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "branches",
"outer_alias": "sale",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10765 | train |
v3 | Schema:
requests (alias: ordr)(code, type, status, amount)
staff(status, value, level, id)
Task: Retrieve code from requests with value above the MAX(amount) of staff rows sharing the same status.
SQL: | SELECT code FROM requests AS ordr
WHERE value > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10766 | train |
v3 | Schema:
orders (alias: ord)(salary, code, status, date)
regions(amount, name, salary, level)
Task: Find amount from orders where amount exceeds the count of value from regions for the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE amount > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10767 | train |
v3 | Schema:
employees (alias: emp)(type, date, salary, level)
products(salary, id, level, amount)
Task: Retrieve salary from employees with amount above the SUM(value) of products rows sharing the same type.
SQL: | SELECT salary FROM employees AS emp
WHERE amount > (
SELECT SUM(value) FROM products AS prod
WHERE prod.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10768 | train |
v1 | Schema:
customers (alias: cust)(type, level, id, date)
managers(id, salary, value, type)
Task: Select amount from customers where level exists in managers for the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10769 | train |
v3 | Schema:
tasks (alias: tsk)(code, amount, id, salary)
items(type, name, code, id)
Task: Find id from tasks where amount exceeds the total value from items for the same type.
SQL: | SELECT id FROM tasks AS tsk
WHERE amount > (
SELECT SUM(value) FROM items AS lne
WHERE lne.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "items",
"outer_alias": "tsk",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_10770 | train |
v1 | Schema:
departments (alias: dept)(amount, code, type, status)
requests(status, salary, code, name)
Task: Retrieve code from departments whose code is found in requests rows where level matches the outer record.
SQL: | SELECT code FROM departments AS dept
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10771 | train |
v1 | Schema:
customers (alias: cust)(code, level, value, amount)
staff(id, code, amount, value)
Task: Retrieve amount from customers whose id is found in staff rows where status matches the outer record.
SQL: | SELECT amount FROM customers AS cust
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10772 | train |
v2 | Schema:
regions (alias: rgn)(id, code, salary, type)
invoices(value, salary, code, date)
Task: Find salary from regions where a matching record exists in invoices with the same status.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10773 | train |
v3 | Schema:
employees (alias: emp)(level, type, code, id)
shipments(salary, date, value, name)
Task: Find id from employees where value exceeds the total value from shipments for the same type.
SQL: | SELECT id FROM employees AS emp
WHERE value > (
SELECT SUM(value) FROM shipments AS shp
WHERE shp.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10774 | train |
v3 | Schema:
items (alias: lne)(value, status, date, name)
regions(level, code, id, name)
Task: Retrieve name from items with salary above the SUM(value) of regions rows sharing the same status.
SQL: | SELECT name FROM items AS lne
WHERE salary > (
SELECT SUM(value) FROM regions AS rgn
WHERE rgn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10775 | train |
v2 | Schema:
branches (alias: brc)(code, amount, status, level)
employees(code, amount, type, date)
Task: Retrieve amount from branches that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_10776 | train |
v1 | Schema:
transactions (alias: txn)(status, salary, amount, type)
categories(amount, type, date, id)
Task: Find amount from transactions where code appears in categories entries with matching type.
SQL: | SELECT amount FROM transactions AS txn
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10777 | train |
v3 | Schema:
departments (alias: dept)(type, name, code, value)
schedules(value, date, code, level)
Task: Retrieve amount from departments with amount above the SUM(value) of schedules rows sharing the same type.
SQL: | SELECT amount FROM departments AS dept
WHERE amount > (
SELECT SUM(value) FROM schedules AS schd
WHERE schd.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10778 | train |
v2 | Schema:
products (alias: prod)(code, value, salary, status)
branches(id, date, amount, name)
Task: Find code from products where a matching record exists in branches with the same level.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = prod.level
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10779 | train |
v2 | Schema:
transactions (alias: txn)(name, id, value, status)
accounts(level, id, value, status)
Task: Find amount from transactions where a matching record exists in accounts with the same type.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10780 | train |
v3 | Schema:
employees (alias: emp)(amount, type, code, name)
categories(level, name, value, date)
Task: Find code from employees where amount exceeds the maximum value from categories for the same code.
SQL: | SELECT code FROM employees AS emp
WHERE amount > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10781 | train |
v3 | Schema:
sales (alias: sale)(salary, code, status, value)
employees(code, name, salary, id)
Task: Retrieve amount from sales with amount above the COUNT(amount) of employees rows sharing the same code.
SQL: | SELECT amount FROM sales AS sale
WHERE amount > (
SELECT COUNT(amount) FROM employees AS emp
WHERE emp.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10782 | train |
v3 | Schema:
transactions (alias: txn)(type, salary, status, level)
categories(salary, type, date, code)
Task: Find id from transactions where value exceeds the count of amount from categories for the same code.
SQL: | SELECT id FROM transactions AS txn
WHERE value > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10783 | train |
v1 | Schema:
schedules (alias: schd)(code, salary, level, value)
sales(level, date, id, name)
Task: Find amount from schedules where type appears in sales entries with matching type.
SQL: | SELECT amount FROM schedules AS schd
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10784 | train |
v1 | Schema:
employees (alias: emp)(level, value, type, code)
customers(id, date, code, salary)
Task: Find salary from employees where status appears in customers entries with matching code.
SQL: | SELECT salary FROM employees AS emp
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10785 | train |
v3 | Schema:
categories (alias: catg)(name, type, value, status)
orders(salary, code, value, name)
Task: Retrieve name from categories with amount above the MAX(salary) of orders rows sharing the same level.
SQL: | SELECT name FROM categories AS catg
WHERE amount > (
SELECT MAX(salary) FROM orders AS ord
WHERE ord.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10786 | train |
v3 | Schema:
projects (alias: prj)(amount, date, type, value)
employees(code, value, level, id)
Task: Find name from projects where amount exceeds the maximum amount from employees for the same id.
SQL: | SELECT name FROM projects AS prj
WHERE amount > (
SELECT MAX(amount) FROM employees AS emp
WHERE emp.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10787 | train |
v2 | Schema:
customers (alias: cust)(status, id, salary, value)
schedules(salary, value, level, amount)
Task: Find amount from customers where a matching record exists in schedules with the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10788 | train |
v1 | Schema:
transactions (alias: txn)(type, id, salary, amount)
requests(id, level, date, code)
Task: Select code from transactions where type exists in requests for the same code.
SQL: | SELECT code FROM transactions AS txn
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10789 | train |
v1 | Schema:
accounts (alias: acct)(level, value, salary, amount)
branches(value, level, name, salary)
Task: Select value from accounts where status exists in branches for the same type.
SQL: | SELECT value FROM accounts AS acct
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10790 | train |
v3 | Schema:
tasks (alias: tsk)(date, id, value, status)
products(status, id, amount, name)
Task: Retrieve code from tasks with value above the COUNT(value) of products rows sharing the same type.
SQL: | SELECT code FROM tasks AS tsk
WHERE value > (
SELECT COUNT(value) FROM products AS prod
WHERE prod.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_10791 | train |
v1 | Schema:
requests (alias: ordr)(name, code, date, type)
branches(status, name, code, type)
Task: Find id from requests where id appears in branches entries with matching id.
SQL: | SELECT id FROM requests AS ordr
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10792 | train |
v3 | Schema:
branches (alias: brc)(id, type, date, name)
products(status, code, level, id)
Task: Find name from branches where salary exceeds the average salary from products for the same level.
SQL: | SELECT name FROM branches AS brc
WHERE salary > (
SELECT AVG(salary) FROM products AS prod
WHERE prod.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_10793 | train |
v3 | Schema:
projects (alias: prj)(value, level, id, salary)
staff(date, salary, value, id)
Task: Retrieve code from projects with value above the SUM(salary) of staff rows sharing the same type.
SQL: | SELECT code FROM projects AS prj
WHERE value > (
SELECT SUM(salary) FROM staff AS empl
WHERE empl.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "staff",
"outer_alias": "prj",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10794 | train |
v1 | Schema:
accounts (alias: acct)(amount, status, name, value)
products(id, name, amount, code)
Task: Select code from accounts where type exists in products for the same id.
SQL: | SELECT code FROM accounts AS acct
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10795 | train |
v2 | Schema:
staff (alias: empl)(level, type, value, salary)
customers(status, amount, level, date)
Task: Retrieve value from staff that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10796 | train |
v1 | Schema:
customers (alias: cust)(code, salary, amount, value)
requests(status, level, type, value)
Task: Retrieve id from customers whose status is found in requests rows where id matches the outer record.
SQL: | SELECT id FROM customers AS cust
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10797 | train |
v3 | Schema:
schedules (alias: schd)(name, amount, id, type)
regions(level, amount, name, date)
Task: Find code from schedules where salary exceeds the count of amount from regions for the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE salary > (
SELECT COUNT(amount) FROM regions AS rgn
WHERE rgn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10798 | train |
v3 | Schema:
schedules (alias: schd)(status, type, name, level)
orders(date, salary, id, type)
Task: Find name from schedules where salary exceeds the maximum amount from orders for the same type.
SQL: | SELECT name FROM schedules AS schd
WHERE salary > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10799 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.