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 |
|---|---|---|---|---|---|---|
v3 | Schema:
categories (alias: catg)(name, level, code, date)
tasks(level, salary, type, status)
Task: Find name from categories where amount exceeds the maximum value from tasks for the same status.
SQL: | SELECT name FROM categories AS catg
WHERE amount > (
SELECT MAX(value) FROM tasks AS tsk
WHERE tsk.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10600 | train |
v3 | Schema:
orders (alias: ord)(name, level, value, date)
tasks(name, amount, level, value)
Task: Find salary from orders where value exceeds the count of amount from tasks for the same id.
SQL: | SELECT salary FROM orders AS ord
WHERE value > (
SELECT COUNT(amount) FROM tasks AS tsk
WHERE tsk.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10601 | train |
v3 | Schema:
customers (alias: cust)(amount, salary, level, status)
transactions(type, level, id, value)
Task: Find salary from customers where salary exceeds the total amount from transactions for the same type.
SQL: | SELECT salary FROM customers AS cust
WHERE salary > (
SELECT SUM(amount) FROM transactions AS txn
WHERE txn.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10602 | train |
v1 | Schema:
categories (alias: catg)(value, level, id, status)
regions(id, name, status, code)
Task: Find salary from categories where level appears in regions entries with matching status.
SQL: | SELECT salary FROM categories AS catg
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10603 | train |
v1 | Schema:
projects (alias: prj)(level, status, salary, date)
orders(status, level, salary, amount)
Task: Retrieve code from projects whose code is found in orders rows where id matches the outer record.
SQL: | SELECT code FROM projects AS prj
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "orders",
"outer_alias": "prj",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10604 | train |
v2 | Schema:
departments (alias: dept)(value, date, code, id)
transactions(value, name, level, amount)
Task: Find salary from departments where a matching record exists in transactions with the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10605 | train |
v1 | Schema:
products (alias: prod)(status, salary, value, type)
sales(name, level, value, id)
Task: Select id from products where level exists in sales for the same id.
SQL: | SELECT id 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": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10606 | train |
v1 | Schema:
tasks (alias: tsk)(code, salary, status, level)
products(status, type, code, name)
Task: Select code from tasks where level exists in products for the same status.
SQL: | SELECT code FROM tasks AS tsk
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_10607 | train |
v3 | Schema:
departments (alias: dept)(code, amount, type, status)
products(value, id, name, code)
Task: Find amount from departments where salary exceeds the maximum amount from products for the same type.
SQL: | SELECT amount FROM departments AS dept
WHERE salary > (
SELECT MAX(amount) FROM products AS prod
WHERE prod.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10608 | train |
v3 | Schema:
orders (alias: ord)(id, code, type, date)
departments(type, code, value, date)
Task: Find salary from orders where salary exceeds the minimum value from departments for the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE salary > (
SELECT MIN(value) FROM departments AS dept
WHERE dept.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "salary",
"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_10609 | train |
v2 | Schema:
items (alias: lne)(status, name, level, id)
products(id, level, salary, name)
Task: Retrieve value from items that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = lne.level
); | {
"outer_table": "items",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10610 | train |
v3 | Schema:
invoices (alias: inv)(code, value, id, salary)
shipments(date, type, id, amount)
Task: Retrieve id from invoices with amount above the MAX(salary) of shipments rows sharing the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE amount > (
SELECT MAX(salary) FROM shipments AS shp
WHERE shp.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10611 | train |
v2 | Schema:
accounts (alias: acct)(salary, amount, id, date)
invoices(value, date, name, id)
Task: Find code from accounts where a matching record exists in invoices with the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10612 | train |
v2 | Schema:
products (alias: prod)(salary, level, date, code)
categories(date, name, type, amount)
Task: Find salary from products where a matching record exists in categories with the same code.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = prod.code
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10613 | train |
v2 | Schema:
invoices (alias: inv)(id, level, name, type)
departments(type, level, status, id)
Task: Retrieve amount from invoices that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10614 | train |
v2 | Schema:
staff (alias: empl)(date, amount, value, type)
branches(amount, level, status, code)
Task: Retrieve id from staff that have at least one corresponding entry in branches sharing the same status.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10615 | train |
v1 | Schema:
staff (alias: empl)(name, date, salary, code)
schedules(code, date, name, salary)
Task: Find id from staff where level appears in schedules entries with matching level.
SQL: | SELECT id FROM staff AS empl
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10616 | train |
v1 | Schema:
shipments (alias: shp)(code, date, level, id)
departments(name, salary, value, code)
Task: Retrieve name from shipments whose code is found in departments rows where status matches the outer record.
SQL: | SELECT name FROM shipments AS shp
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10617 | train |
v3 | Schema:
schedules (alias: schd)(id, value, amount, type)
invoices(date, code, amount, type)
Task: Retrieve name from schedules with value above the MIN(salary) of invoices rows sharing the same status.
SQL: | SELECT name FROM schedules AS schd
WHERE value > (
SELECT MIN(salary) FROM invoices AS inv
WHERE inv.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10618 | train |
v1 | Schema:
staff (alias: empl)(name, type, amount, id)
regions(name, amount, salary, status)
Task: Select amount from staff where code exists in regions for the same level.
SQL: | SELECT amount FROM staff AS empl
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10619 | train |
v3 | Schema:
shipments (alias: shp)(name, date, id, amount)
requests(date, amount, status, type)
Task: Find value from shipments where amount exceeds the minimum value from requests for the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE amount > (
SELECT MIN(value) FROM requests AS ordr
WHERE ordr.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10620 | train |
v2 | Schema:
projects (alias: prj)(code, salary, type, status)
shipments(value, salary, amount, id)
Task: Retrieve salary from projects that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10621 | train |
v3 | Schema:
invoices (alias: inv)(level, name, salary, status)
managers(amount, id, value, status)
Task: Retrieve salary from invoices with salary above the MIN(salary) of managers rows sharing the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE salary > (
SELECT MIN(salary) FROM managers AS mgr
WHERE mgr.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10622 | train |
v3 | Schema:
departments (alias: dept)(status, code, date, type)
sales(date, level, amount, salary)
Task: Find code from departments where salary exceeds the total amount from sales for the same status.
SQL: | SELECT code FROM departments AS dept
WHERE salary > (
SELECT SUM(amount) FROM sales AS sale
WHERE sale.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10623 | train |
v1 | Schema:
transactions (alias: txn)(salary, value, level, type)
staff(name, level, type, value)
Task: Find value from transactions where level appears in staff entries with matching id.
SQL: | SELECT value FROM transactions AS txn
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10624 | train |
v2 | Schema:
products (alias: prod)(level, amount, code, name)
categories(id, level, type, name)
Task: Retrieve code from products that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = prod.type
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10625 | train |
v3 | Schema:
invoices (alias: inv)(type, date, id, code)
shipments(amount, code, value, name)
Task: Find id from invoices where amount exceeds the maximum amount from shipments for the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE amount > (
SELECT MAX(amount) FROM shipments AS shp
WHERE shp.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10626 | train |
v3 | Schema:
customers (alias: cust)(code, salary, value, name)
schedules(salary, date, value, name)
Task: Find value from customers where value exceeds the average amount from schedules for the same status.
SQL: | SELECT value FROM customers AS cust
WHERE value > (
SELECT AVG(amount) FROM schedules AS schd
WHERE schd.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10627 | train |
v3 | Schema:
managers (alias: mgr)(status, id, date, type)
employees(level, salary, value, code)
Task: Retrieve code from managers with amount above the MAX(value) of employees rows sharing the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE amount > (
SELECT MAX(value) FROM employees AS emp
WHERE emp.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10628 | train |
v3 | Schema:
accounts (alias: acct)(type, value, code, date)
sales(value, level, name, salary)
Task: Find amount from accounts where salary exceeds the average salary from sales for the same level.
SQL: | SELECT amount FROM accounts AS acct
WHERE salary > (
SELECT AVG(salary) FROM sales AS sale
WHERE sale.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10629 | train |
v2 | Schema:
managers (alias: mgr)(level, amount, id, name)
staff(type, id, code, name)
Task: Retrieve code from managers that have at least one corresponding entry in staff sharing the same type.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10630 | train |
v1 | Schema:
regions (alias: rgn)(value, code, id, status)
invoices(id, name, status, date)
Task: Find amount from regions where status appears in invoices entries with matching code.
SQL: | SELECT amount FROM regions AS rgn
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10631 | train |
v3 | Schema:
schedules (alias: schd)(id, value, level, amount)
products(code, salary, id, amount)
Task: Find name from schedules where value exceeds the average value from products for the same code.
SQL: | SELECT name FROM schedules AS schd
WHERE value > (
SELECT AVG(value) FROM products AS prod
WHERE prod.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10632 | train |
v2 | Schema:
requests (alias: ordr)(amount, date, id, value)
departments(amount, date, status, id)
Task: Find value from requests where a matching record exists in departments with the same level.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10633 | train |
v1 | Schema:
managers (alias: mgr)(id, date, salary, name)
items(date, id, level, status)
Task: Select name from managers where status exists in items for the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10634 | train |
v3 | Schema:
invoices (alias: inv)(level, salary, id, name)
schedules(type, name, salary, value)
Task: Retrieve value from invoices with value above the AVG(value) of schedules rows sharing the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE value > (
SELECT AVG(value) FROM schedules AS schd
WHERE schd.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10635 | train |
v2 | Schema:
departments (alias: dept)(code, value, amount, level)
transactions(name, amount, value, type)
Task: Retrieve name from departments that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10636 | train |
v1 | Schema:
managers (alias: mgr)(code, salary, amount, value)
items(name, code, type, value)
Task: Retrieve name from managers whose id is found in items rows where id matches the outer record.
SQL: | SELECT name FROM managers AS mgr
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10637 | train |
v1 | Schema:
tasks (alias: tsk)(level, date, id, amount)
items(name, code, salary, level)
Task: Find name from tasks where code appears in items entries with matching id.
SQL: | SELECT name FROM tasks AS tsk
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "items",
"outer_alias": "tsk",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_10638 | train |
v1 | Schema:
customers (alias: cust)(type, code, level, amount)
projects(value, date, code, amount)
Task: Select name from customers where status exists in projects for the same code.
SQL: | SELECT name FROM customers AS cust
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10639 | train |
v1 | Schema:
accounts (alias: acct)(salary, status, amount, value)
items(name, date, id, salary)
Task: Select salary from accounts where level exists in items for the same type.
SQL: | SELECT salary FROM accounts AS acct
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10640 | train |
v1 | Schema:
staff (alias: empl)(salary, type, status, code)
accounts(level, type, status, code)
Task: Retrieve value from staff whose id is found in accounts rows where type matches the outer record.
SQL: | SELECT value FROM staff AS empl
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10641 | train |
v2 | Schema:
categories (alias: catg)(code, name, salary, date)
invoices(value, level, date, name)
Task: Retrieve name from categories that have at least one corresponding entry in invoices sharing the same level.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10642 | train |
v3 | Schema:
invoices (alias: inv)(salary, name, status, type)
regions(id, name, value, code)
Task: Find name from invoices where salary exceeds the minimum value from regions for the same status.
SQL: | SELECT name FROM invoices AS inv
WHERE salary > (
SELECT MIN(value) FROM regions AS rgn
WHERE rgn.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10643 | train |
v2 | Schema:
branches (alias: brc)(code, id, amount, status)
staff(id, name, type, date)
Task: Find code from branches where a matching record exists in staff with the same level.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_10644 | train |
v3 | Schema:
projects (alias: prj)(id, level, code, name)
departments(value, id, code, type)
Task: Retrieve code from projects with amount above the AVG(salary) of departments rows sharing the same code.
SQL: | SELECT code FROM projects AS prj
WHERE amount > (
SELECT AVG(salary) FROM departments AS dept
WHERE dept.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10645 | train |
v3 | Schema:
transactions (alias: txn)(type, salary, level, date)
products(level, amount, salary, date)
Task: Retrieve amount from transactions with value above the SUM(value) of products rows sharing the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE value > (
SELECT SUM(value) FROM products AS prod
WHERE prod.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10646 | train |
v3 | Schema:
orders (alias: ord)(code, value, id, amount)
tasks(type, id, status, salary)
Task: Find name from orders where amount exceeds the total salary from tasks for the same code.
SQL: | SELECT name FROM orders AS ord
WHERE amount > (
SELECT SUM(salary) FROM tasks AS tsk
WHERE tsk.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10647 | train |
v1 | Schema:
managers (alias: mgr)(level, date, id, code)
accounts(code, date, status, salary)
Task: Find name from managers where status appears in accounts entries with matching code.
SQL: | SELECT name FROM managers AS mgr
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10648 | train |
v3 | Schema:
managers (alias: mgr)(date, type, level, code)
transactions(name, date, salary, code)
Task: Find salary from managers where salary exceeds the total value from transactions for the same type.
SQL: | SELECT salary FROM managers AS mgr
WHERE salary > (
SELECT SUM(value) FROM transactions AS txn
WHERE txn.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "salary",
"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_10649 | train |
v1 | Schema:
sales (alias: sale)(code, amount, type, name)
regions(salary, name, type, value)
Task: Select value from sales where type exists in regions for the same level.
SQL: | SELECT value FROM sales AS sale
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10650 | train |
v1 | Schema:
employees (alias: emp)(date, name, value, status)
requests(id, name, type, level)
Task: Select value from employees where code exists in requests for the same type.
SQL: | SELECT value FROM employees AS emp
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10651 | train |
v1 | Schema:
regions (alias: rgn)(value, salary, level, code)
customers(salary, value, name, date)
Task: Find salary from regions where type appears in customers entries with matching id.
SQL: | SELECT salary FROM regions AS rgn
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10652 | train |
v3 | Schema:
invoices (alias: inv)(id, value, salary, status)
managers(id, level, status, code)
Task: Find salary from invoices where amount exceeds the total amount from managers for the same type.
SQL: | SELECT salary FROM invoices AS inv
WHERE amount > (
SELECT SUM(amount) FROM managers AS mgr
WHERE mgr.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10653 | train |
v1 | Schema:
invoices (alias: inv)(date, name, status, code)
branches(code, value, level, name)
Task: Select code from invoices where id exists in branches for the same id.
SQL: | SELECT code FROM invoices AS inv
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10654 | train |
v3 | Schema:
sales (alias: sale)(status, type, code, name)
invoices(value, name, salary, date)
Task: Retrieve salary from sales with value above the MIN(salary) of invoices rows sharing the same code.
SQL: | SELECT salary FROM sales AS sale
WHERE value > (
SELECT MIN(salary) FROM invoices AS inv
WHERE inv.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10655 | train |
v2 | Schema:
accounts (alias: acct)(salary, type, name, status)
regions(status, date, name, type)
Task: Retrieve name from accounts that have at least one corresponding entry in regions sharing the same code.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10656 | train |
v1 | Schema:
orders (alias: ord)(status, amount, code, level)
schedules(name, date, level, id)
Task: Retrieve id from orders whose type is found in schedules rows where code matches the outer record.
SQL: | SELECT id FROM orders AS ord
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10657 | train |
v2 | Schema:
tasks (alias: tsk)(salary, type, status, amount)
orders(value, level, date, type)
Task: Retrieve name from tasks that have at least one corresponding entry in orders sharing the same status.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_10658 | train |
v3 | Schema:
regions (alias: rgn)(value, amount, level, code)
branches(date, salary, name, code)
Task: Find salary from regions where salary exceeds the minimum amount from branches for the same level.
SQL: | SELECT salary FROM regions AS rgn
WHERE salary > (
SELECT MIN(amount) FROM branches AS brc
WHERE brc.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10659 | train |
v3 | Schema:
transactions (alias: txn)(type, status, code, date)
invoices(name, date, value, id)
Task: Find amount from transactions where amount exceeds the total amount from invoices for the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE amount > (
SELECT SUM(amount) FROM invoices AS inv
WHERE inv.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10660 | train |
v1 | Schema:
customers (alias: cust)(code, level, status, id)
orders(id, status, code, name)
Task: Retrieve amount from customers whose code is found in orders rows where status matches the outer record.
SQL: | SELECT amount FROM customers AS cust
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10661 | train |
v3 | Schema:
products (alias: prod)(name, value, id, type)
departments(id, type, code, value)
Task: Find amount from products where value exceeds the total salary from departments for the same id.
SQL: | SELECT amount FROM products AS prod
WHERE value > (
SELECT SUM(salary) FROM departments AS dept
WHERE dept.id = prod.id
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10662 | train |
v3 | Schema:
branches (alias: brc)(status, code, value, amount)
sales(id, amount, name, date)
Task: Retrieve id from branches with value above the MIN(amount) of sales rows sharing the same id.
SQL: | SELECT id FROM branches AS brc
WHERE value > (
SELECT MIN(amount) FROM sales AS sale
WHERE sale.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_10663 | train |
v3 | Schema:
orders (alias: ord)(value, amount, date, level)
branches(id, type, status, name)
Task: Retrieve amount from orders with value above the MIN(amount) of branches rows sharing the same code.
SQL: | SELECT amount FROM orders AS ord
WHERE value > (
SELECT MIN(amount) FROM branches AS brc
WHERE brc.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10664 | train |
v1 | Schema:
items (alias: lne)(amount, status, type, name)
departments(code, salary, name, date)
Task: Retrieve code from items whose level is found in departments rows where level matches the outer record.
SQL: | SELECT code FROM items AS lne
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.level = lne.level
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10665 | train |
v2 | Schema:
invoices (alias: inv)(date, level, amount, code)
categories(level, date, salary, amount)
Task: Retrieve amount from invoices that have at least one corresponding entry in categories sharing the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10666 | train |
v2 | Schema:
employees (alias: emp)(id, value, salary, type)
categories(date, id, status, code)
Task: Retrieve name from employees that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10667 | train |
v1 | Schema:
projects (alias: prj)(type, amount, level, salary)
tasks(type, id, value, amount)
Task: Retrieve salary from projects whose type is found in tasks rows where type matches the outer record.
SQL: | SELECT salary FROM projects AS prj
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "prj",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10668 | train |
v1 | Schema:
regions (alias: rgn)(salary, date, code, type)
customers(value, type, date, status)
Task: Find id from regions where id appears in customers entries with matching id.
SQL: | SELECT id FROM regions AS rgn
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10669 | train |
v2 | Schema:
managers (alias: mgr)(salary, id, date, name)
customers(salary, name, level, type)
Task: Find value from managers where a matching record exists in customers with the same code.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10670 | train |
v1 | Schema:
tasks (alias: tsk)(type, code, amount, value)
schedules(value, date, amount, status)
Task: Find value from tasks where level appears in schedules entries with matching code.
SQL: | SELECT value FROM tasks AS tsk
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_10671 | train |
v2 | Schema:
projects (alias: prj)(amount, level, value, type)
branches(level, code, value, id)
Task: Find code from projects where a matching record exists in branches with the same type.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10672 | train |
v1 | Schema:
tasks (alias: tsk)(code, amount, date, id)
categories(date, value, code, salary)
Task: Find value from tasks where code appears in categories entries with matching type.
SQL: | SELECT value FROM tasks AS tsk
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_10673 | train |
v1 | Schema:
transactions (alias: txn)(status, date, salary, value)
requests(amount, salary, value, status)
Task: Retrieve amount from transactions whose level is found in requests rows where id matches the outer record.
SQL: | SELECT amount FROM transactions AS txn
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10674 | train |
v2 | Schema:
invoices (alias: inv)(type, level, salary, status)
transactions(type, id, name, date)
Task: Find code from invoices where a matching record exists in transactions with the same id.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10675 | train |
v1 | Schema:
employees (alias: emp)(status, type, date, salary)
accounts(level, id, code, salary)
Task: Retrieve name from employees whose level is found in accounts rows where type matches the outer record.
SQL: | SELECT name FROM employees AS emp
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10676 | train |
v2 | Schema:
shipments (alias: shp)(name, salary, date, value)
transactions(amount, value, name, level)
Task: Find id from shipments where a matching record exists in transactions with the same id.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10677 | train |
v1 | Schema:
invoices (alias: inv)(id, name, status, code)
tasks(status, code, date, amount)
Task: Retrieve salary from invoices whose code is found in tasks rows where id matches the outer record.
SQL: | SELECT salary FROM invoices AS inv
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10678 | train |
v1 | Schema:
projects (alias: prj)(value, status, name, level)
items(value, id, code, date)
Task: Select id from projects where level exists in items for the same status.
SQL: | SELECT id FROM projects AS prj
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10679 | train |
v1 | Schema:
orders (alias: ord)(id, type, value, date)
customers(date, code, id, salary)
Task: Select salary from orders where id exists in customers for the same level.
SQL: | SELECT salary FROM orders AS ord
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10680 | train |
v1 | Schema:
transactions (alias: txn)(name, status, code, amount)
orders(type, name, date, id)
Task: Find amount from transactions where level appears in orders entries with matching level.
SQL: | SELECT amount FROM transactions AS txn
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10681 | train |
v1 | Schema:
accounts (alias: acct)(date, value, amount, status)
sales(name, id, amount, date)
Task: Select name from accounts where code exists in sales for the same code.
SQL: | SELECT name FROM accounts AS acct
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10682 | train |
v1 | Schema:
invoices (alias: inv)(id, status, amount, code)
branches(id, value, name, level)
Task: Select name from invoices where status exists in branches for the same code.
SQL: | SELECT name FROM invoices AS inv
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10683 | train |
v1 | Schema:
tasks (alias: tsk)(level, value, code, salary)
schedules(status, value, amount, name)
Task: Select value from tasks where level exists in schedules for the same level.
SQL: | SELECT value FROM tasks AS tsk
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_10684 | train |
v2 | Schema:
categories (alias: catg)(type, value, date, salary)
regions(id, level, name, value)
Task: Retrieve code from categories that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10685 | train |
v2 | Schema:
employees (alias: emp)(name, amount, salary, id)
departments(level, salary, name, status)
Task: Find value from employees where a matching record exists in departments with the same level.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10686 | train |
v3 | Schema:
invoices (alias: inv)(date, level, type, amount)
regions(level, name, status, value)
Task: Find value from invoices where value exceeds the average amount from regions for the same status.
SQL: | SELECT value FROM invoices AS inv
WHERE value > (
SELECT AVG(amount) FROM regions AS rgn
WHERE rgn.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10687 | train |
v2 | Schema:
managers (alias: mgr)(salary, status, id, code)
sales(date, status, id, value)
Task: Retrieve value from managers that have at least one corresponding entry in sales sharing the same status.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10688 | train |
v3 | Schema:
employees (alias: emp)(id, date, type, name)
departments(id, name, amount, value)
Task: Retrieve code from employees with value above the MIN(salary) of departments rows sharing the same status.
SQL: | SELECT code FROM employees AS emp
WHERE value > (
SELECT MIN(salary) FROM departments AS dept
WHERE dept.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10689 | train |
v3 | Schema:
branches (alias: brc)(id, status, date, value)
departments(id, code, type, status)
Task: Find id from branches where value exceeds the maximum amount from departments for the same type.
SQL: | SELECT id FROM branches AS brc
WHERE value > (
SELECT MAX(amount) FROM departments AS dept
WHERE dept.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "departments",
"outer_alias": "brc",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_10690 | train |
v1 | Schema:
accounts (alias: acct)(level, type, date, code)
invoices(level, code, value, type)
Task: Select code from accounts where level exists in invoices for the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10691 | train |
v1 | Schema:
employees (alias: emp)(date, type, level, id)
items(value, salary, code, status)
Task: Retrieve id from employees whose id is found in items rows where code matches the outer record.
SQL: | SELECT id FROM employees AS emp
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10692 | train |
v1 | Schema:
invoices (alias: inv)(type, date, id, status)
sales(amount, status, type, name)
Task: Retrieve amount from invoices whose type is found in sales rows where level matches the outer record.
SQL: | SELECT amount FROM invoices AS inv
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10693 | train |
v3 | Schema:
invoices (alias: inv)(value, amount, type, salary)
products(value, level, salary, date)
Task: Find id from invoices where salary exceeds the maximum amount from products for the same type.
SQL: | SELECT id FROM invoices AS inv
WHERE salary > (
SELECT MAX(amount) FROM products AS prod
WHERE prod.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10694 | train |
v1 | Schema:
departments (alias: dept)(status, salary, level, name)
orders(code, id, type, name)
Task: Retrieve id from departments whose status is found in orders rows where id matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10695 | train |
v2 | Schema:
invoices (alias: inv)(value, amount, code, date)
branches(type, amount, date, name)
Task: Retrieve value from invoices that have at least one corresponding entry in branches sharing the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10696 | train |
v1 | Schema:
transactions (alias: txn)(name, id, type, value)
regions(amount, name, id, date)
Task: Find code from transactions where id appears in regions entries with matching code.
SQL: | SELECT code FROM transactions AS txn
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10697 | train |
v2 | Schema:
regions (alias: rgn)(amount, level, status, value)
branches(salary, level, id, value)
Task: Retrieve code from regions that have at least one corresponding entry in branches sharing the same id.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10698 | train |
v1 | Schema:
transactions (alias: txn)(amount, salary, code, status)
shipments(code, status, name, value)
Task: Select id from transactions where status exists in shipments for the same code.
SQL: | SELECT id FROM transactions AS txn
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10699 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.