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:
branches (alias: brc)(date, id, status, amount)
schedules(level, code, value, status)
Task: Find id from branches where id appears in schedules entries with matching code.
SQL: | SELECT id FROM branches AS brc
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "schedules",
"outer_alias": "brc",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12600 | train |
v3 | Schema:
departments (alias: dept)(value, date, name, type)
products(name, amount, code, value)
Task: Find id from departments where amount exceeds the minimum salary from products for the same type.
SQL: | SELECT id FROM departments AS dept
WHERE amount > (
SELECT MIN(salary) FROM products AS prod
WHERE prod.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12601 | train |
v1 | Schema:
staff (alias: empl)(id, level, salary, date)
regions(code, status, amount, salary)
Task: Retrieve code from staff whose code is found in regions rows where id matches the outer record.
SQL: | SELECT code FROM staff AS empl
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_12602 | train |
v3 | Schema:
items (alias: lne)(value, date, type, level)
categories(value, id, salary, type)
Task: Find value from items where amount exceeds the minimum value from categories for the same level.
SQL: | SELECT value FROM items AS lne
WHERE amount > (
SELECT MIN(value) FROM categories AS catg
WHERE catg.level = lne.level
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12603 | train |
v3 | Schema:
schedules (alias: schd)(value, code, id, type)
tasks(date, name, level, code)
Task: Find value from schedules where value exceeds the count of salary from tasks for the same id.
SQL: | SELECT value FROM schedules AS schd
WHERE value > (
SELECT COUNT(salary) FROM tasks AS tsk
WHERE tsk.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12604 | train |
v3 | Schema:
branches (alias: brc)(type, code, status, level)
sales(level, salary, date, amount)
Task: Find name from branches where salary exceeds the minimum value from sales for the same id.
SQL: | SELECT name FROM branches AS brc
WHERE salary > (
SELECT MIN(value) FROM sales AS sale
WHERE sale.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12605 | train |
v3 | Schema:
staff (alias: empl)(salary, id, type, name)
schedules(code, date, name, salary)
Task: Find amount from staff where value exceeds the maximum value from schedules for the same level.
SQL: | SELECT amount FROM staff AS empl
WHERE value > (
SELECT MAX(value) FROM schedules AS schd
WHERE schd.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_12606 | train |
v3 | Schema:
orders (alias: ord)(type, level, name, status)
managers(status, name, salary, level)
Task: Retrieve value from orders with amount above the SUM(salary) of managers rows sharing the same id.
SQL: | SELECT value FROM orders AS ord
WHERE amount > (
SELECT SUM(salary) FROM managers AS mgr
WHERE mgr.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12607 | train |
v1 | Schema:
invoices (alias: inv)(date, type, salary, level)
tasks(salary, code, amount, level)
Task: Find name from invoices where id appears in tasks entries with matching code.
SQL: | SELECT name FROM invoices AS inv
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12608 | train |
v3 | Schema:
transactions (alias: txn)(salary, name, id, level)
projects(status, code, salary, date)
Task: Retrieve id from transactions with amount above the AVG(value) of projects rows sharing the same level.
SQL: | SELECT id FROM transactions AS txn
WHERE amount > (
SELECT AVG(value) FROM projects AS prj
WHERE prj.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12609 | train |
v2 | Schema:
orders (alias: ord)(name, type, value, id)
customers(value, name, code, salary)
Task: Find amount from orders where a matching record exists in customers with the same code.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12610 | train |
v3 | Schema:
employees (alias: emp)(date, salary, code, name)
schedules(status, value, name, amount)
Task: Retrieve salary from employees with value above the COUNT(amount) of schedules rows sharing the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE value > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12611 | train |
v3 | Schema:
accounts (alias: acct)(name, level, type, date)
orders(date, code, name, salary)
Task: Retrieve salary from accounts with amount above the MAX(amount) of orders rows sharing the same level.
SQL: | SELECT salary FROM accounts AS acct
WHERE amount > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12612 | train |
v3 | Schema:
items (alias: lne)(status, code, date, amount)
invoices(status, amount, date, type)
Task: Find amount from items where amount exceeds the minimum salary from invoices for the same id.
SQL: | SELECT amount FROM items AS lne
WHERE amount > (
SELECT MIN(salary) FROM invoices AS inv
WHERE inv.id = lne.id
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12613 | train |
v3 | Schema:
sales (alias: sale)(date, amount, status, code)
orders(status, value, id, level)
Task: Retrieve salary from sales with value above the MAX(salary) of orders rows sharing the same id.
SQL: | SELECT salary FROM sales AS sale
WHERE value > (
SELECT MAX(salary) FROM orders AS ord
WHERE ord.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12614 | train |
v2 | Schema:
customers (alias: cust)(salary, level, id, date)
staff(date, id, status, name)
Task: Find value from customers where a matching record exists in staff with the same code.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12615 | train |
v1 | Schema:
employees (alias: emp)(status, salary, amount, level)
accounts(value, date, status, code)
Task: Select salary from employees where status exists in accounts for the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12616 | train |
v2 | Schema:
branches (alias: brc)(status, name, level, id)
staff(status, name, value, code)
Task: Find salary from branches where a matching record exists in staff with the same id.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12617 | train |
v2 | Schema:
schedules (alias: schd)(id, level, name, status)
orders(salary, type, value, level)
Task: Find amount from schedules where a matching record exists in orders with the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12618 | train |
v3 | Schema:
branches (alias: brc)(type, date, salary, code)
products(amount, code, value, date)
Task: Find salary from branches where value exceeds the minimum salary from products for the same type.
SQL: | SELECT salary FROM branches AS brc
WHERE value > (
SELECT MIN(salary) FROM products AS prod
WHERE prod.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12619 | train |
v2 | Schema:
transactions (alias: txn)(type, id, code, date)
products(code, status, id, type)
Task: Retrieve id from transactions that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12620 | train |
v1 | Schema:
requests (alias: ordr)(id, level, code, value)
orders(salary, status, id, amount)
Task: Select amount from requests where id exists in orders for the same status.
SQL: | SELECT amount FROM requests AS ordr
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12621 | train |
v2 | Schema:
tasks (alias: tsk)(date, amount, id, name)
employees(value, status, date, salary)
Task: Retrieve id from tasks that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "tsk",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_12622 | train |
v1 | Schema:
accounts (alias: acct)(salary, id, level, date)
items(name, code, date, status)
Task: Retrieve value from accounts whose type is found in items rows where type matches the outer record.
SQL: | SELECT value FROM accounts AS acct
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12623 | train |
v2 | Schema:
sales (alias: sale)(type, date, id, code)
orders(name, type, salary, id)
Task: Retrieve value from sales that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12624 | train |
v3 | Schema:
projects (alias: prj)(salary, date, level, code)
branches(value, name, salary, type)
Task: Retrieve id from projects with amount above the SUM(value) of branches rows sharing the same type.
SQL: | SELECT id FROM projects AS prj
WHERE amount > (
SELECT SUM(value) FROM branches AS brc
WHERE brc.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_12625 | train |
v1 | Schema:
categories (alias: catg)(date, id, amount, type)
employees(value, name, level, amount)
Task: Retrieve value from categories whose type is found in employees rows where status matches the outer record.
SQL: | SELECT value FROM categories AS catg
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12626 | train |
v3 | Schema:
accounts (alias: acct)(level, type, code, date)
categories(salary, id, status, amount)
Task: Find salary from accounts where salary exceeds the maximum value from categories for the same type.
SQL: | SELECT salary FROM accounts AS acct
WHERE salary > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12627 | train |
v1 | Schema:
schedules (alias: schd)(level, salary, type, code)
invoices(code, name, id, salary)
Task: Find amount from schedules where status appears in invoices entries with matching status.
SQL: | SELECT amount FROM schedules AS schd
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12628 | train |
v2 | Schema:
shipments (alias: shp)(salary, value, date, name)
requests(code, level, type, id)
Task: Find name from shipments where a matching record exists in requests with the same status.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_12629 | train |
v1 | Schema:
requests (alias: ordr)(amount, level, value, type)
shipments(amount, salary, level, code)
Task: Retrieve name from requests whose level is found in shipments rows where status matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12630 | train |
v3 | Schema:
projects (alias: prj)(amount, value, level, id)
sales(date, status, type, name)
Task: Retrieve code from projects with salary above the MIN(value) of sales rows sharing the same type.
SQL: | SELECT code FROM projects AS prj
WHERE salary > (
SELECT MIN(value) FROM sales AS sale
WHERE sale.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_12631 | train |
v2 | Schema:
regions (alias: rgn)(code, level, name, status)
orders(level, id, date, code)
Task: Retrieve code from regions that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_12632 | train |
v2 | Schema:
managers (alias: mgr)(amount, level, id, date)
branches(date, code, name, type)
Task: Retrieve id from managers that have at least one corresponding entry in branches sharing the same id.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12633 | train |
v3 | Schema:
projects (alias: prj)(id, date, value, name)
customers(type, name, status, salary)
Task: Retrieve id from projects with salary above the MAX(amount) of customers rows sharing the same level.
SQL: | SELECT id FROM projects AS prj
WHERE salary > (
SELECT MAX(amount) FROM customers AS cust
WHERE cust.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "prj",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_12634 | train |
v2 | Schema:
employees (alias: emp)(id, status, date, amount)
requests(value, level, name, code)
Task: Find code from employees where a matching record exists in requests with the same level.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12635 | train |
v1 | Schema:
accounts (alias: acct)(salary, type, code, date)
customers(amount, id, code, type)
Task: Retrieve id from accounts whose status is found in customers rows where status matches the outer record.
SQL: | SELECT id FROM accounts AS acct
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12636 | train |
v3 | Schema:
departments (alias: dept)(salary, type, id, code)
regions(code, amount, name, level)
Task: Retrieve salary from departments with value above the SUM(amount) of regions rows sharing the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE value > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12637 | train |
v1 | Schema:
products (alias: prod)(status, name, amount, date)
schedules(date, type, id, level)
Task: Select id from products where id exists in schedules for the same type.
SQL: | SELECT id FROM products AS prod
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.type = prod.type
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12638 | train |
v3 | Schema:
categories (alias: catg)(level, status, salary, value)
requests(id, code, date, status)
Task: Retrieve amount from categories with salary above the COUNT(value) of requests rows sharing the same id.
SQL: | SELECT amount FROM categories AS catg
WHERE salary > (
SELECT COUNT(value) FROM requests AS ordr
WHERE ordr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12639 | train |
v3 | Schema:
branches (alias: brc)(code, date, value, name)
tasks(date, amount, code, id)
Task: Find id from branches where amount exceeds the maximum value from tasks for the same status.
SQL: | SELECT id FROM branches AS brc
WHERE amount > (
SELECT MAX(value) FROM tasks AS tsk
WHERE tsk.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12640 | train |
v3 | Schema:
products (alias: prod)(date, value, level, salary)
shipments(id, amount, date, code)
Task: Find name from products where amount exceeds the maximum amount from shipments for the same id.
SQL: | SELECT name FROM products AS prod
WHERE amount > (
SELECT MAX(amount) FROM shipments AS shp
WHERE shp.id = prod.id
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12641 | train |
v1 | Schema:
categories (alias: catg)(code, level, date, salary)
tasks(status, level, value, name)
Task: Retrieve name from categories whose id is found in tasks rows where type matches the outer record.
SQL: | SELECT name FROM categories AS catg
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12642 | train |
v3 | Schema:
orders (alias: ord)(salary, type, status, date)
schedules(status, salary, type, value)
Task: Find id from orders where amount exceeds the count of amount from schedules for the same status.
SQL: | SELECT id FROM orders AS ord
WHERE amount > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12643 | train |
v2 | Schema:
transactions (alias: txn)(id, amount, name, salary)
schedules(salary, type, value, name)
Task: Find code from transactions where a matching record exists in schedules with the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12644 | train |
v2 | Schema:
tasks (alias: tsk)(name, id, date, type)
products(code, date, value, name)
Task: Retrieve value from tasks that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_12645 | train |
v2 | Schema:
items (alias: lne)(date, type, amount, id)
schedules(code, date, status, id)
Task: Retrieve id from items that have at least one corresponding entry in schedules sharing the same id.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = lne.id
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12646 | train |
v1 | Schema:
requests (alias: ordr)(type, value, level, code)
shipments(salary, id, value, level)
Task: Retrieve amount from requests whose id is found in shipments rows where status matches the outer record.
SQL: | SELECT amount FROM requests AS ordr
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12647 | train |
v3 | Schema:
requests (alias: ordr)(type, code, name, date)
customers(id, name, salary, code)
Task: Retrieve id from requests with value above the MAX(salary) of customers rows sharing the same id.
SQL: | SELECT id FROM requests AS ordr
WHERE value > (
SELECT MAX(salary) FROM customers AS cust
WHERE cust.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12648 | train |
v3 | Schema:
invoices (alias: inv)(level, id, date, name)
accounts(value, level, code, amount)
Task: Find code from invoices where salary exceeds the average value from accounts for the same id.
SQL: | SELECT code FROM invoices AS inv
WHERE salary > (
SELECT AVG(value) FROM accounts AS acct
WHERE acct.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12649 | train |
v2 | Schema:
invoices (alias: inv)(level, status, type, code)
schedules(salary, type, name, amount)
Task: Find salary from invoices where a matching record exists in schedules with the same status.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12650 | train |
v2 | Schema:
regions (alias: rgn)(value, name, status, type)
departments(name, value, code, status)
Task: Retrieve id from regions that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_12651 | train |
v3 | Schema:
regions (alias: rgn)(salary, date, name, amount)
employees(value, amount, date, id)
Task: Find name from regions where value exceeds the average value from employees for the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE value > (
SELECT AVG(value) FROM employees AS emp
WHERE emp.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_12652 | train |
v1 | Schema:
projects (alias: prj)(date, type, name, code)
branches(name, id, type, value)
Task: Find salary from projects where id appears in branches entries with matching id.
SQL: | SELECT salary FROM projects AS prj
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_12653 | train |
v2 | Schema:
customers (alias: cust)(code, status, amount, id)
categories(level, status, amount, date)
Task: Retrieve amount from customers that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12654 | train |
v3 | Schema:
branches (alias: brc)(code, status, salary, level)
products(name, value, code, status)
Task: Retrieve code from branches with value above the MIN(value) of products rows sharing the same type.
SQL: | SELECT code FROM branches AS brc
WHERE value > (
SELECT MIN(value) FROM products AS prod
WHERE prod.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12655 | train |
v1 | Schema:
projects (alias: prj)(amount, name, value, date)
requests(status, salary, level, amount)
Task: Find amount from projects where level appears in requests entries with matching id.
SQL: | SELECT amount FROM projects AS prj
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_12656 | train |
v3 | Schema:
managers (alias: mgr)(value, amount, code, level)
departments(name, amount, date, type)
Task: Retrieve name from managers with salary above the AVG(value) of departments rows sharing the same level.
SQL: | SELECT name FROM managers AS mgr
WHERE salary > (
SELECT AVG(value) FROM departments AS dept
WHERE dept.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12657 | train |
v3 | Schema:
employees (alias: emp)(name, code, date, id)
projects(level, salary, amount, value)
Task: Find code from employees where amount exceeds the maximum value from projects for the same type.
SQL: | SELECT code FROM employees AS emp
WHERE amount > (
SELECT MAX(value) FROM projects AS prj
WHERE prj.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "projects",
"outer_alias": "emp",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12658 | train |
v3 | Schema:
shipments (alias: shp)(date, amount, code, level)
tasks(level, id, date, salary)
Task: Retrieve value from shipments with salary above the AVG(salary) of tasks rows sharing the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE salary > (
SELECT AVG(salary) FROM tasks AS tsk
WHERE tsk.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_12659 | train |
v3 | Schema:
items (alias: lne)(type, id, amount, level)
regions(level, value, status, salary)
Task: Find value from items where value exceeds the maximum amount from regions for the same code.
SQL: | SELECT value FROM items AS lne
WHERE value > (
SELECT MAX(amount) FROM regions AS rgn
WHERE rgn.code = lne.code
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12660 | train |
v3 | Schema:
projects (alias: prj)(level, status, amount, id)
items(code, value, id, status)
Task: Find id from projects where value exceeds the maximum salary from items for the same level.
SQL: | SELECT id FROM projects AS prj
WHERE value > (
SELECT MAX(salary) FROM items AS lne
WHERE lne.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_12661 | train |
v2 | Schema:
departments (alias: dept)(status, value, code, level)
transactions(status, date, level, code)
Task: Retrieve code from departments that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT code 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": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12662 | train |
v2 | Schema:
tasks (alias: tsk)(date, name, code, type)
managers(salary, type, name, status)
Task: Find code from tasks where a matching record exists in managers with the same level.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_12663 | train |
v3 | Schema:
products (alias: prod)(name, amount, salary, code)
projects(date, type, name, salary)
Task: Find code from products where salary exceeds the average salary from projects for the same code.
SQL: | SELECT code FROM products AS prod
WHERE salary > (
SELECT AVG(salary) FROM projects AS prj
WHERE prj.code = prod.code
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "prod",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12664 | train |
v3 | Schema:
transactions (alias: txn)(value, id, date, amount)
customers(status, level, code, id)
Task: Find id from transactions where value exceeds the maximum salary from customers for the same level.
SQL: | SELECT id FROM transactions AS txn
WHERE value > (
SELECT MAX(salary) FROM customers AS cust
WHERE cust.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12665 | train |
v2 | Schema:
categories (alias: catg)(type, code, name, date)
accounts(value, id, name, date)
Task: Retrieve name from categories that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12666 | train |
v1 | Schema:
items (alias: lne)(date, status, code, value)
schedules(amount, value, level, id)
Task: Select value from items where type exists in schedules for the same code.
SQL: | SELECT value FROM items AS lne
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.code = lne.code
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12667 | train |
v2 | Schema:
employees (alias: emp)(value, salary, level, amount)
accounts(amount, status, date, value)
Task: Find id from employees where a matching record exists in accounts with the same id.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12668 | train |
v3 | Schema:
categories (alias: catg)(level, type, amount, value)
tasks(status, value, salary, level)
Task: Retrieve value from categories with value above the AVG(value) of tasks rows sharing the same id.
SQL: | SELECT value FROM categories AS catg
WHERE value > (
SELECT AVG(value) FROM tasks AS tsk
WHERE tsk.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12669 | train |
v2 | Schema:
staff (alias: empl)(value, type, name, level)
invoices(type, date, id, code)
Task: Retrieve id from staff that have at least one corresponding entry in invoices sharing the same level.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_12670 | train |
v3 | Schema:
products (alias: prod)(id, status, value, date)
categories(code, status, type, date)
Task: Retrieve salary from products with amount above the SUM(amount) of categories rows sharing the same id.
SQL: | SELECT salary FROM products AS prod
WHERE amount > (
SELECT SUM(amount) FROM categories AS catg
WHERE catg.id = prod.id
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12671 | train |
v1 | Schema:
shipments (alias: shp)(salary, level, type, id)
categories(date, name, salary, level)
Task: Select id from shipments where status exists in categories for the same type.
SQL: | SELECT id FROM shipments AS shp
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_12672 | train |
v1 | Schema:
categories (alias: catg)(value, type, id, status)
regions(name, id, type, value)
Task: Find salary from categories where id appears in regions entries with matching type.
SQL: | SELECT salary FROM categories AS catg
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12673 | train |
v3 | Schema:
products (alias: prod)(value, level, status, code)
staff(type, status, date, level)
Task: Retrieve salary from products with value above the AVG(amount) of staff rows sharing the same id.
SQL: | SELECT salary FROM products AS prod
WHERE value > (
SELECT AVG(amount) FROM staff AS empl
WHERE empl.id = prod.id
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12674 | train |
v1 | Schema:
customers (alias: cust)(level, type, code, salary)
schedules(date, name, type, salary)
Task: Find code from customers where id appears in schedules entries with matching type.
SQL: | SELECT code FROM customers AS cust
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12675 | train |
v1 | Schema:
projects (alias: prj)(name, amount, value, level)
regions(salary, type, id, name)
Task: Find amount from projects where code appears in regions entries with matching status.
SQL: | SELECT amount FROM projects AS prj
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_12676 | train |
v1 | Schema:
departments (alias: dept)(amount, type, salary, name)
schedules(salary, value, type, level)
Task: Find salary from departments where level appears in schedules entries with matching code.
SQL: | SELECT salary FROM departments AS dept
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12677 | train |
v2 | Schema:
shipments (alias: shp)(value, id, level, date)
orders(value, type, amount, id)
Task: Retrieve code from shipments that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_12678 | train |
v1 | Schema:
requests (alias: ordr)(name, code, status, type)
sales(name, level, type, value)
Task: Find amount from requests where level appears in sales entries with matching code.
SQL: | SELECT amount FROM requests AS ordr
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12679 | train |
v3 | Schema:
items (alias: lne)(id, salary, level, name)
accounts(status, type, amount, date)
Task: Retrieve id from items with amount above the MIN(salary) of accounts rows sharing the same type.
SQL: | SELECT id FROM items AS lne
WHERE amount > (
SELECT MIN(salary) FROM accounts AS acct
WHERE acct.type = lne.type
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12680 | train |
v3 | Schema:
sales (alias: sale)(salary, level, type, code)
employees(name, status, salary, type)
Task: Find code from sales where amount exceeds the maximum value from employees for the same level.
SQL: | SELECT code FROM sales AS sale
WHERE amount > (
SELECT MAX(value) FROM employees AS emp
WHERE emp.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12681 | train |
v3 | Schema:
branches (alias: brc)(amount, id, date, level)
transactions(amount, value, type, id)
Task: Retrieve name from branches with salary above the MIN(salary) of transactions rows sharing the same level.
SQL: | SELECT name FROM branches AS brc
WHERE salary > (
SELECT MIN(salary) FROM transactions AS txn
WHERE txn.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "transactions",
"outer_alias": "brc",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12682 | train |
v2 | Schema:
products (alias: prod)(type, amount, status, code)
regions(id, name, value, date)
Task: Retrieve salary from products that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = prod.id
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12683 | train |
v2 | Schema:
departments (alias: dept)(name, value, date, salary)
tasks(type, value, name, level)
Task: Retrieve code from departments that have at least one corresponding entry in tasks sharing the same level.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12684 | train |
v1 | Schema:
categories (alias: catg)(id, date, salary, type)
requests(name, date, id, level)
Task: Select amount from categories where status exists in requests for the same type.
SQL: | SELECT amount FROM categories AS catg
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12685 | train |
v1 | Schema:
invoices (alias: inv)(date, value, code, amount)
shipments(code, salary, name, level)
Task: Find id from invoices where level appears in shipments entries with matching level.
SQL: | SELECT id FROM invoices AS inv
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12686 | train |
v1 | Schema:
orders (alias: ord)(id, salary, date, code)
schedules(status, salary, type, amount)
Task: Retrieve salary from orders whose type is found in schedules rows where id matches the outer record.
SQL: | SELECT salary FROM orders AS ord
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12687 | train |
v1 | Schema:
orders (alias: ord)(name, id, code, date)
shipments(code, value, date, type)
Task: Find amount from orders where status appears in shipments entries with matching status.
SQL: | SELECT amount FROM orders AS ord
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12688 | train |
v3 | Schema:
staff (alias: empl)(date, id, code, salary)
branches(id, date, amount, type)
Task: Find amount from staff where amount exceeds the minimum salary from branches for the same type.
SQL: | SELECT amount FROM staff AS empl
WHERE amount > (
SELECT MIN(salary) FROM branches AS brc
WHERE brc.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_12689 | train |
v2 | Schema:
schedules (alias: schd)(type, amount, salary, date)
requests(name, code, date, id)
Task: Find name from schedules where a matching record exists in requests with the same level.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12690 | train |
v2 | Schema:
tasks (alias: tsk)(amount, value, code, name)
transactions(salary, value, name, status)
Task: Find amount from tasks where a matching record exists in transactions with the same type.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_12691 | train |
v2 | Schema:
sales (alias: sale)(type, date, value, id)
shipments(status, level, value, salary)
Task: Find code from sales where a matching record exists in shipments with the same id.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12692 | train |
v3 | Schema:
items (alias: lne)(date, name, level, salary)
transactions(name, amount, date, status)
Task: Find amount from items where amount exceeds the total amount from transactions for the same status.
SQL: | SELECT amount FROM items AS lne
WHERE amount > (
SELECT SUM(amount) FROM transactions AS txn
WHERE txn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12693 | train |
v3 | Schema:
sales (alias: sale)(value, status, date, level)
staff(status, type, name, date)
Task: Find value from sales where salary exceeds the average amount from staff for the same type.
SQL: | SELECT value FROM sales AS sale
WHERE salary > (
SELECT AVG(amount) FROM staff AS empl
WHERE empl.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "value",
"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_12694 | train |
v1 | Schema:
branches (alias: brc)(salary, date, name, status)
staff(id, date, value, name)
Task: Find id from branches where code appears in staff entries with matching type.
SQL: | SELECT id FROM branches AS brc
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12695 | train |
v3 | Schema:
customers (alias: cust)(id, code, salary, level)
transactions(id, amount, status, type)
Task: Retrieve amount from customers with value above the SUM(salary) of transactions rows sharing the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE value > (
SELECT SUM(salary) FROM transactions AS txn
WHERE txn.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12696 | train |
v1 | Schema:
accounts (alias: acct)(level, name, status, value)
orders(salary, amount, date, type)
Task: Select amount from accounts where code exists in orders for the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12697 | train |
v2 | Schema:
managers (alias: mgr)(date, level, id, status)
orders(amount, id, salary, date)
Task: Find id from managers where a matching record exists in orders with the same id.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12698 | train |
v1 | Schema:
shipments (alias: shp)(id, amount, value, level)
staff(salary, date, amount, type)
Task: Find value from shipments where id appears in staff entries with matching status.
SQL: | SELECT value FROM shipments AS shp
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_12699 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.