variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v2 | Schema:
employees (alias: emp)(amount, salary, value, status)
managers(amount, id, type, name)
Task: Retrieve salary from employees that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05000 | train |
v1 | Schema:
orders (alias: ord)(code, date, amount, id)
transactions(type, value, salary, id)
Task: Find name from orders where type appears in transactions entries with matching status.
SQL: | SELECT name FROM orders AS ord
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05001 | train |
v3 | Schema:
staff (alias: empl)(level, amount, code, status)
tasks(status, level, type, id)
Task: Find code from staff where salary exceeds the minimum amount from tasks for the same type.
SQL: | SELECT code FROM staff AS empl
WHERE salary > (
SELECT MIN(amount) FROM tasks AS tsk
WHERE tsk.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05002 | train |
v2 | Schema:
accounts (alias: acct)(level, id, amount, type)
requests(value, name, id, amount)
Task: Retrieve code from accounts that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05003 | train |
v1 | Schema:
categories (alias: catg)(id, salary, value, name)
tasks(name, date, id, amount)
Task: Retrieve value from categories whose type is found in tasks rows where id matches the outer record.
SQL: | SELECT value FROM categories AS catg
WHERE type IN (
SELECT type 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": "type",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05004 | train |
v1 | Schema:
managers (alias: mgr)(id, level, type, value)
accounts(name, date, salary, amount)
Task: Select id from managers where status exists in accounts for the same type.
SQL: | SELECT id FROM managers AS mgr
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05005 | train |
v3 | Schema:
shipments (alias: shp)(name, code, amount, type)
sales(value, name, amount, id)
Task: Find id from shipments where value exceeds the maximum salary from sales for the same id.
SQL: | SELECT id FROM shipments AS shp
WHERE value > (
SELECT MAX(salary) FROM sales AS sale
WHERE sale.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05006 | train |
v3 | Schema:
managers (alias: mgr)(salary, code, name, value)
projects(level, type, status, value)
Task: Find id from managers where salary exceeds the average salary from projects for the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE salary > (
SELECT AVG(salary) FROM projects AS prj
WHERE prj.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05007 | train |
v1 | Schema:
items (alias: lne)(salary, status, level, code)
branches(amount, id, value, type)
Task: Retrieve code from items whose code is found in branches rows where level matches the outer record.
SQL: | SELECT code FROM items AS lne
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.level = lne.level
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05008 | train |
v2 | Schema:
sales (alias: sale)(date, salary, id, name)
requests(type, code, level, salary)
Task: Find value from sales where a matching record exists in requests with the same level.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05009 | train |
v2 | Schema:
projects (alias: prj)(type, status, level, date)
branches(id, status, code, type)
Task: Find salary from projects where a matching record exists in branches with the same level.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05010 | train |
v2 | Schema:
sales (alias: sale)(type, value, status, id)
tasks(level, name, status, type)
Task: Find code from sales where a matching record exists in tasks with the same code.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05011 | train |
v3 | Schema:
categories (alias: catg)(value, salary, status, code)
employees(code, type, level, salary)
Task: Find value from categories where amount exceeds the total amount from employees for the same id.
SQL: | SELECT value FROM categories AS catg
WHERE amount > (
SELECT SUM(amount) FROM employees AS emp
WHERE emp.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05012 | train |
v1 | Schema:
managers (alias: mgr)(code, date, amount, type)
sales(type, level, amount, name)
Task: Select salary from managers where status exists in sales for the same level.
SQL: | SELECT salary FROM managers AS mgr
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05013 | train |
v1 | Schema:
transactions (alias: txn)(code, name, amount, value)
shipments(level, amount, value, code)
Task: Find salary from transactions where id appears in shipments entries with matching level.
SQL: | SELECT salary FROM transactions AS txn
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05014 | train |
v3 | Schema:
customers (alias: cust)(code, name, id, level)
requests(value, status, amount, date)
Task: Find salary from customers where salary exceeds the minimum value from requests for the same status.
SQL: | SELECT salary FROM customers AS cust
WHERE salary > (
SELECT MIN(value) FROM requests AS ordr
WHERE ordr.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05015 | train |
v3 | Schema:
schedules (alias: schd)(value, level, code, salary)
projects(date, level, status, amount)
Task: Retrieve code from schedules with salary above the COUNT(salary) of projects rows sharing the same level.
SQL: | SELECT code FROM schedules AS schd
WHERE salary > (
SELECT COUNT(salary) FROM projects AS prj
WHERE prj.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05016 | train |
v3 | Schema:
shipments (alias: shp)(name, type, date, status)
categories(type, date, value, salary)
Task: Retrieve code from shipments with salary above the MAX(salary) of categories rows sharing the same level.
SQL: | SELECT code FROM shipments AS shp
WHERE salary > (
SELECT MAX(salary) FROM categories AS catg
WHERE catg.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05017 | train |
v3 | Schema:
requests (alias: ordr)(salary, name, amount, code)
orders(code, amount, id, status)
Task: Retrieve salary from requests with salary above the AVG(amount) of orders rows sharing the same type.
SQL: | SELECT salary FROM requests AS ordr
WHERE salary > (
SELECT AVG(amount) FROM orders AS ord
WHERE ord.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05018 | train |
v2 | Schema:
invoices (alias: inv)(type, amount, value, status)
schedules(status, level, code, name)
Task: Find value from invoices where a matching record exists in schedules with the same id.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05019 | train |
v1 | Schema:
departments (alias: dept)(code, status, level, value)
transactions(date, status, amount, level)
Task: Select code from departments where code exists in transactions for the same type.
SQL: | SELECT code FROM departments AS dept
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05020 | train |
v2 | Schema:
schedules (alias: schd)(name, amount, type, value)
accounts(code, status, salary, name)
Task: Find salary from schedules where a matching record exists in accounts with the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05021 | train |
v3 | Schema:
managers (alias: mgr)(code, status, id, level)
employees(code, name, value, amount)
Task: Retrieve amount from managers with value above the SUM(amount) of employees rows sharing the same id.
SQL: | SELECT amount FROM managers AS mgr
WHERE value > (
SELECT SUM(amount) FROM employees AS emp
WHERE emp.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05022 | train |
v2 | Schema:
items (alias: lne)(level, value, id, salary)
projects(amount, status, level, date)
Task: Find id from items where a matching record exists in projects with the same level.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = lne.level
); | {
"outer_table": "items",
"inner_table": "projects",
"outer_alias": "lne",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05023 | train |
v2 | Schema:
orders (alias: ord)(code, name, id, date)
tasks(value, type, amount, date)
Task: Retrieve code from orders that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05024 | train |
v2 | Schema:
staff (alias: empl)(type, name, level, amount)
accounts(code, value, salary, name)
Task: Retrieve name from staff that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05025 | train |
v3 | Schema:
items (alias: lne)(code, name, amount, date)
schedules(type, code, date, status)
Task: Retrieve amount from items with salary above the MIN(amount) of schedules rows sharing the same level.
SQL: | SELECT amount FROM items AS lne
WHERE salary > (
SELECT MIN(amount) FROM schedules AS schd
WHERE schd.level = lne.level
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05026 | train |
v3 | Schema:
departments (alias: dept)(value, level, status, type)
transactions(salary, type, level, name)
Task: Retrieve code from departments with salary above the MAX(amount) of transactions rows sharing the same id.
SQL: | SELECT code FROM departments AS dept
WHERE salary > (
SELECT MAX(amount) FROM transactions AS txn
WHERE txn.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05027 | train |
v3 | Schema:
categories (alias: catg)(id, date, value, level)
staff(amount, type, value, date)
Task: Find value from categories where salary exceeds the maximum amount from staff for the same status.
SQL: | SELECT value FROM categories AS catg
WHERE salary > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05028 | train |
v3 | Schema:
regions (alias: rgn)(level, id, date, status)
orders(amount, level, type, status)
Task: Retrieve id from regions with value above the COUNT(salary) of orders rows sharing the same type.
SQL: | SELECT id FROM regions AS rgn
WHERE value > (
SELECT COUNT(salary) FROM orders AS ord
WHERE ord.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05029 | train |
v2 | Schema:
accounts (alias: acct)(type, amount, name, code)
transactions(value, id, salary, status)
Task: Find id from accounts where a matching record exists in transactions with the same code.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05030 | train |
v3 | Schema:
departments (alias: dept)(id, status, value, type)
transactions(salary, value, type, id)
Task: Find value from departments where value exceeds the minimum amount from transactions for the same status.
SQL: | SELECT value FROM departments AS dept
WHERE value > (
SELECT MIN(amount) FROM transactions AS txn
WHERE txn.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05031 | train |
v3 | Schema:
orders (alias: ord)(value, amount, name, status)
accounts(id, value, level, status)
Task: Find value from orders where value exceeds the maximum salary from accounts for the same id.
SQL: | SELECT value FROM orders AS ord
WHERE value > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05032 | train |
v3 | Schema:
regions (alias: rgn)(id, level, status, salary)
schedules(type, salary, status, date)
Task: Retrieve name from regions with value above the COUNT(value) of schedules rows sharing the same code.
SQL: | SELECT name FROM regions AS rgn
WHERE value > (
SELECT COUNT(value) FROM schedules AS schd
WHERE schd.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05033 | train |
v2 | Schema:
accounts (alias: acct)(code, amount, type, salary)
managers(date, level, name, value)
Task: Find name from accounts where a matching record exists in managers with the same code.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05034 | train |
v3 | Schema:
categories (alias: catg)(date, amount, value, code)
managers(level, value, code, salary)
Task: Retrieve code from categories with amount above the MAX(amount) of managers rows sharing the same level.
SQL: | SELECT code FROM categories AS catg
WHERE amount > (
SELECT MAX(amount) FROM managers AS mgr
WHERE mgr.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05035 | train |
v1 | Schema:
departments (alias: dept)(id, name, salary, type)
accounts(amount, salary, status, value)
Task: Retrieve salary from departments whose code is found in accounts rows where code matches the outer record.
SQL: | SELECT salary FROM departments AS dept
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05036 | train |
v3 | Schema:
shipments (alias: shp)(status, code, date, amount)
tasks(value, amount, name, salary)
Task: Find salary from shipments where value exceeds the total value from tasks for the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE value > (
SELECT SUM(value) FROM tasks AS tsk
WHERE tsk.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05037 | train |
v2 | Schema:
accounts (alias: acct)(amount, value, code, type)
items(status, date, code, type)
Task: Retrieve name from accounts that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05038 | train |
v1 | Schema:
shipments (alias: shp)(name, type, status, id)
categories(type, level, value, amount)
Task: Retrieve name from shipments whose code is found in categories rows where code matches the outer record.
SQL: | SELECT name FROM shipments AS shp
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05039 | train |
v2 | Schema:
sales (alias: sale)(id, salary, type, date)
requests(type, salary, level, status)
Task: Retrieve amount from sales that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05040 | train |
v3 | Schema:
customers (alias: cust)(code, level, status, salary)
departments(date, value, code, name)
Task: Find name from customers where salary exceeds the count of value from departments for the same type.
SQL: | SELECT name FROM customers AS cust
WHERE salary > (
SELECT COUNT(value) FROM departments AS dept
WHERE dept.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05041 | train |
v3 | Schema:
items (alias: lne)(value, level, salary, amount)
orders(date, code, value, status)
Task: Find name from items where amount exceeds the total salary from orders for the same id.
SQL: | SELECT name FROM items AS lne
WHERE amount > (
SELECT SUM(salary) FROM orders AS ord
WHERE ord.id = lne.id
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05042 | train |
v1 | Schema:
regions (alias: rgn)(level, date, amount, value)
tasks(status, code, date, id)
Task: Find code from regions where level appears in tasks entries with matching status.
SQL: | SELECT code FROM regions AS rgn
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05043 | train |
v3 | Schema:
invoices (alias: inv)(salary, level, status, code)
requests(type, value, status, id)
Task: Retrieve name from invoices with amount above the SUM(salary) of requests rows sharing the same code.
SQL: | SELECT name FROM invoices AS inv
WHERE amount > (
SELECT SUM(salary) FROM requests AS ordr
WHERE ordr.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05044 | train |
v3 | Schema:
transactions (alias: txn)(id, value, salary, level)
invoices(name, code, status, level)
Task: Retrieve id from transactions with value above the MAX(value) of invoices rows sharing the same type.
SQL: | SELECT id FROM transactions AS txn
WHERE value > (
SELECT MAX(value) FROM invoices AS inv
WHERE inv.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05045 | train |
v3 | Schema:
orders (alias: ord)(type, status, date, name)
accounts(salary, type, name, value)
Task: Retrieve id from orders with amount above the MIN(value) of accounts rows sharing the same id.
SQL: | SELECT id FROM orders AS ord
WHERE amount > (
SELECT MIN(value) FROM accounts AS acct
WHERE acct.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05046 | train |
v2 | Schema:
orders (alias: ord)(amount, id, type, value)
items(code, value, id, status)
Task: Find name from orders where a matching record exists in items with the same id.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05047 | train |
v2 | Schema:
schedules (alias: schd)(name, value, id, type)
products(code, type, date, status)
Task: Retrieve code from schedules that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05048 | train |
v3 | Schema:
transactions (alias: txn)(value, id, name, type)
tasks(salary, value, id, level)
Task: Retrieve salary from transactions with amount above the COUNT(amount) of tasks rows sharing the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE amount > (
SELECT COUNT(amount) FROM tasks AS tsk
WHERE tsk.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05049 | train |
v3 | Schema:
customers (alias: cust)(date, salary, id, value)
categories(level, salary, name, date)
Task: Retrieve value from customers with salary above the MAX(salary) of categories rows sharing the same type.
SQL: | SELECT value FROM customers AS cust
WHERE salary > (
SELECT MAX(salary) FROM categories AS catg
WHERE catg.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05050 | train |
v1 | Schema:
regions (alias: rgn)(code, amount, id, type)
tasks(salary, id, value, amount)
Task: Select value from regions where type exists in tasks for the same level.
SQL: | SELECT value FROM regions AS rgn
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05051 | train |
v3 | Schema:
categories (alias: catg)(status, code, level, amount)
projects(code, name, amount, type)
Task: Find name from categories where amount exceeds the count of salary from projects for the same type.
SQL: | SELECT name FROM categories AS catg
WHERE amount > (
SELECT COUNT(salary) FROM projects AS prj
WHERE prj.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05052 | train |
v1 | Schema:
branches (alias: brc)(value, amount, name, id)
regions(status, type, level, salary)
Task: Find id from branches where code appears in regions entries with matching level.
SQL: | SELECT id FROM branches AS brc
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05053 | train |
v3 | Schema:
departments (alias: dept)(code, level, status, name)
products(code, level, date, amount)
Task: Find id from departments where value exceeds the total value from products for the same type.
SQL: | SELECT id FROM departments AS dept
WHERE value > (
SELECT SUM(value) 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": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05054 | train |
v1 | Schema:
shipments (alias: shp)(code, status, date, type)
tasks(id, type, amount, code)
Task: Select value from shipments where id exists in tasks for the same status.
SQL: | SELECT value FROM shipments AS shp
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05055 | train |
v1 | Schema:
customers (alias: cust)(code, type, level, date)
schedules(status, level, value, salary)
Task: Find name from customers where code appears in schedules entries with matching level.
SQL: | SELECT name FROM customers AS cust
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05056 | train |
v2 | Schema:
employees (alias: emp)(code, date, level, status)
projects(date, salary, name, type)
Task: Retrieve id from employees that have at least one corresponding entry in projects sharing the same code.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "projects",
"outer_alias": "emp",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05057 | train |
v1 | Schema:
managers (alias: mgr)(value, status, id, date)
regions(type, salary, name, value)
Task: Select id from managers where type exists in regions for the same id.
SQL: | SELECT id FROM managers AS mgr
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05058 | train |
v2 | Schema:
projects (alias: prj)(type, id, salary, code)
invoices(salary, type, name, code)
Task: Find code from projects where a matching record exists in invoices with the same level.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05059 | train |
v1 | Schema:
employees (alias: emp)(id, status, code, type)
customers(level, date, status, salary)
Task: Select id from employees where type exists in customers for the same level.
SQL: | SELECT id FROM employees AS emp
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05060 | train |
v1 | Schema:
customers (alias: cust)(date, status, salary, code)
regions(salary, value, code, id)
Task: Retrieve id from customers whose type is found in regions rows where level matches the outer record.
SQL: | SELECT id FROM customers AS cust
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05061 | train |
v1 | Schema:
regions (alias: rgn)(status, amount, code, id)
projects(value, salary, status, amount)
Task: Retrieve salary from regions whose id is found in projects rows where type matches the outer record.
SQL: | SELECT salary FROM regions AS rgn
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05062 | train |
v2 | Schema:
branches (alias: brc)(status, name, salary, amount)
customers(name, level, code, amount)
Task: Find salary from branches where a matching record exists in customers with the same status.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05063 | train |
v2 | Schema:
managers (alias: mgr)(code, amount, id, salary)
invoices(name, level, status, date)
Task: Retrieve salary from managers that have at least one corresponding entry in invoices sharing the same id.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05064 | train |
v1 | Schema:
regions (alias: rgn)(id, name, type, level)
tasks(type, level, amount, salary)
Task: Find amount from regions where level appears in tasks entries with matching id.
SQL: | SELECT amount FROM regions AS rgn
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05065 | train |
v2 | Schema:
departments (alias: dept)(status, value, code, level)
requests(level, id, status, amount)
Task: Retrieve salary from departments that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05066 | train |
v1 | Schema:
products (alias: prod)(id, type, amount, date)
categories(date, value, code, name)
Task: Retrieve value from products whose status is found in categories rows where id matches the outer record.
SQL: | SELECT value FROM products AS prod
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.id = prod.id
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05067 | train |
v1 | Schema:
branches (alias: brc)(type, value, status, id)
orders(date, amount, status, id)
Task: Select id from branches where type exists in orders for the same id.
SQL: | SELECT id FROM branches AS brc
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05068 | train |
v3 | Schema:
accounts (alias: acct)(level, amount, type, date)
sales(name, amount, code, level)
Task: Retrieve amount from accounts with amount above the AVG(amount) of sales rows sharing the same level.
SQL: | SELECT amount FROM accounts AS acct
WHERE amount > (
SELECT AVG(amount) 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": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05069 | train |
v3 | Schema:
projects (alias: prj)(level, date, type, amount)
sales(code, date, status, salary)
Task: Retrieve id from projects with amount above the AVG(value) of sales rows sharing the same id.
SQL: | SELECT id FROM projects AS prj
WHERE amount > (
SELECT AVG(value) FROM sales AS sale
WHERE sale.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05070 | train |
v3 | Schema:
branches (alias: brc)(salary, name, type, code)
schedules(value, code, name, date)
Task: Retrieve value from branches with amount above the MAX(amount) of schedules rows sharing the same type.
SQL: | SELECT value FROM branches AS brc
WHERE amount > (
SELECT MAX(amount) FROM schedules AS schd
WHERE schd.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "schedules",
"outer_alias": "brc",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05071 | train |
v3 | Schema:
items (alias: lne)(type, level, status, amount)
managers(date, amount, status, level)
Task: Find name from items where value exceeds the total salary from managers for the same code.
SQL: | SELECT name FROM items AS lne
WHERE value > (
SELECT SUM(salary) FROM managers AS mgr
WHERE mgr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05072 | train |
v2 | Schema:
categories (alias: catg)(amount, status, date, name)
accounts(code, level, name, salary)
Task: Retrieve salary from categories that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05073 | train |
v2 | Schema:
managers (alias: mgr)(status, value, id, type)
sales(status, name, value, salary)
Task: Find code from managers where a matching record exists in sales with the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05074 | train |
v1 | Schema:
managers (alias: mgr)(id, amount, date, code)
transactions(salary, date, name, code)
Task: Select code from managers where level exists in transactions for the same code.
SQL: | SELECT code FROM managers AS mgr
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05075 | train |
v2 | Schema:
products (alias: prod)(date, id, salary, code)
tasks(amount, value, type, name)
Task: Find name from products where a matching record exists in tasks with the same code.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = prod.code
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05076 | train |
v1 | Schema:
branches (alias: brc)(level, code, date, status)
departments(name, code, id, salary)
Task: Find amount from branches where level appears in departments entries with matching code.
SQL: | SELECT amount FROM branches AS brc
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "departments",
"outer_alias": "brc",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05077 | train |
v3 | Schema:
invoices (alias: inv)(value, salary, status, level)
transactions(name, date, value, code)
Task: Find id from invoices where value exceeds the maximum salary from transactions for the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE value > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05078 | train |
v2 | Schema:
branches (alias: brc)(date, level, name, amount)
categories(value, name, status, date)
Task: Find code from branches where a matching record exists in categories with the same type.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05079 | train |
v2 | Schema:
regions (alias: rgn)(code, id, level, type)
shipments(id, code, value, type)
Task: Find name from regions where a matching record exists in shipments with the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05080 | train |
v2 | Schema:
tasks (alias: tsk)(date, salary, type, amount)
products(date, level, code, status)
Task: Retrieve amount from tasks that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05081 | train |
v2 | Schema:
staff (alias: empl)(name, value, code, id)
schedules(status, code, id, type)
Task: Find code from staff where a matching record exists in schedules with the same status.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05082 | train |
v2 | Schema:
requests (alias: ordr)(id, level, code, status)
regions(status, salary, name, id)
Task: Retrieve code from requests that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05083 | train |
v1 | Schema:
orders (alias: ord)(status, value, code, id)
departments(value, date, amount, id)
Task: Select value from orders where code exists in departments for the same level.
SQL: | SELECT value FROM orders AS ord
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05084 | train |
v2 | Schema:
employees (alias: emp)(name, status, salary, level)
sales(type, id, salary, level)
Task: Find value from employees where a matching record exists in sales with the same level.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05085 | train |
v1 | Schema:
schedules (alias: schd)(name, id, code, amount)
regions(salary, status, level, date)
Task: Retrieve code from schedules whose status is found in regions rows where status matches the outer record.
SQL: | SELECT code FROM schedules AS schd
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05086 | train |
v1 | Schema:
requests (alias: ordr)(date, type, code, salary)
accounts(name, value, amount, code)
Task: Select code from requests where id exists in accounts for the same level.
SQL: | SELECT code FROM requests AS ordr
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05087 | train |
v2 | Schema:
accounts (alias: acct)(amount, salary, code, status)
shipments(date, type, code, status)
Task: Find amount from accounts where a matching record exists in shipments with the same level.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05088 | train |
v3 | Schema:
tasks (alias: tsk)(date, type, code, level)
departments(date, value, level, name)
Task: Retrieve amount from tasks with salary above the AVG(amount) of departments rows sharing the same level.
SQL: | SELECT amount FROM tasks AS tsk
WHERE salary > (
SELECT AVG(amount) FROM departments AS dept
WHERE dept.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "tsk",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05089 | train |
v1 | Schema:
projects (alias: prj)(status, type, id, name)
schedules(date, type, level, salary)
Task: Find salary from projects where code appears in schedules entries with matching type.
SQL: | SELECT salary FROM projects AS prj
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "schedules",
"outer_alias": "prj",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05090 | train |
v2 | Schema:
orders (alias: ord)(level, value, code, name)
projects(id, code, level, type)
Task: Retrieve code from orders that have at least one corresponding entry in projects sharing the same code.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05091 | train |
v2 | Schema:
tasks (alias: tsk)(code, type, salary, name)
transactions(id, value, amount, salary)
Task: Find amount from tasks where a matching record exists in transactions with the same code.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05092 | train |
v3 | Schema:
customers (alias: cust)(code, value, amount, salary)
regions(value, name, level, code)
Task: Find id from customers where salary exceeds the average salary from regions for the same id.
SQL: | SELECT id FROM customers AS cust
WHERE salary > (
SELECT AVG(salary) FROM regions AS rgn
WHERE rgn.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05093 | train |
v1 | Schema:
tasks (alias: tsk)(id, name, type, salary)
categories(date, salary, id, level)
Task: Retrieve amount from tasks whose status is found in categories rows where level matches the outer record.
SQL: | SELECT amount FROM tasks AS tsk
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05094 | train |
v1 | Schema:
accounts (alias: acct)(name, id, level, amount)
branches(amount, type, name, status)
Task: Select code from accounts where level exists in branches for the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05095 | train |
v1 | Schema:
customers (alias: cust)(code, level, date, id)
transactions(salary, code, value, id)
Task: Retrieve code from customers whose id is found in transactions rows where code matches the outer record.
SQL: | SELECT code FROM customers AS cust
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05096 | train |
v1 | Schema:
tasks (alias: tsk)(status, amount, code, id)
staff(value, id, type, date)
Task: Retrieve value from tasks whose id is found in staff rows where status matches the outer record.
SQL: | SELECT value FROM tasks AS tsk
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "staff",
"outer_alias": "tsk",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05097 | train |
v3 | Schema:
projects (alias: prj)(amount, value, level, status)
schedules(amount, salary, status, value)
Task: Find id from projects where amount exceeds the total value from schedules for the same status.
SQL: | SELECT id FROM projects AS prj
WHERE amount > (
SELECT SUM(value) FROM schedules AS schd
WHERE schd.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "schedules",
"outer_alias": "prj",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05098 | train |
v2 | Schema:
sales (alias: sale)(level, type, date, id)
branches(date, status, id, value)
Task: Retrieve value from sales that have at least one corresponding entry in branches sharing the same level.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "branches",
"outer_alias": "sale",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05099 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.