variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v1 | Schema:
products (alias: prod)(level, salary, type, id)
categories(id, name, date, level)
Task: Find name from products where id appears in categories entries with matching id.
SQL: | SELECT name FROM products AS prod
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.id = prod.id
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11100 | train |
v2 | Schema:
employees (alias: emp)(name, id, status, amount)
schedules(id, name, type, code)
Task: Find value from employees where a matching record exists in schedules with the same type.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11101 | train |
v2 | Schema:
shipments (alias: shp)(type, value, name, status)
customers(value, level, name, date)
Task: Retrieve id from shipments that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11102 | train |
v3 | Schema:
products (alias: prod)(level, type, status, name)
branches(code, name, salary, level)
Task: Find name from products where salary exceeds the average amount from branches for the same type.
SQL: | SELECT name FROM products AS prod
WHERE salary > (
SELECT AVG(amount) FROM branches AS brc
WHERE brc.type = prod.type
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11103 | train |
v1 | Schema:
schedules (alias: schd)(status, value, type, salary)
managers(value, status, salary, type)
Task: Retrieve amount from schedules whose id is found in managers rows where code matches the outer record.
SQL: | SELECT amount FROM schedules AS schd
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11104 | train |
v1 | Schema:
invoices (alias: inv)(value, name, status, level)
accounts(status, date, level, type)
Task: Retrieve id from invoices whose level is found in accounts rows where status matches the outer record.
SQL: | SELECT id FROM invoices AS inv
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11105 | train |
v3 | Schema:
tasks (alias: tsk)(name, status, code, salary)
accounts(status, salary, code, type)
Task: Find amount from tasks where amount exceeds the maximum amount from accounts for the same status.
SQL: | SELECT amount FROM tasks AS tsk
WHERE amount > (
SELECT MAX(amount) FROM accounts AS acct
WHERE acct.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11106 | train |
v1 | Schema:
categories (alias: catg)(code, status, salary, date)
transactions(type, name, id, date)
Task: Find value from categories where status appears in transactions entries with matching code.
SQL: | SELECT value FROM categories AS catg
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11107 | train |
v3 | Schema:
tasks (alias: tsk)(name, date, code, level)
products(id, code, name, level)
Task: Find name from tasks where value exceeds the average amount from products for the same status.
SQL: | SELECT name FROM tasks AS tsk
WHERE value > (
SELECT AVG(amount) FROM products AS prod
WHERE prod.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11108 | train |
v3 | Schema:
departments (alias: dept)(type, amount, name, date)
tasks(level, salary, id, type)
Task: Retrieve amount from departments with amount above the AVG(salary) of tasks rows sharing the same code.
SQL: | SELECT amount FROM departments AS dept
WHERE amount > (
SELECT AVG(salary) FROM tasks AS tsk
WHERE tsk.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11109 | train |
v1 | Schema:
categories (alias: catg)(date, name, amount, salary)
items(salary, code, value, status)
Task: Select name from categories where id exists in items for the same type.
SQL: | SELECT name FROM categories AS catg
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11110 | train |
v2 | Schema:
projects (alias: prj)(value, type, date, amount)
categories(status, name, type, value)
Task: Find id from projects where a matching record exists in categories with the same id.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11111 | train |
v1 | Schema:
managers (alias: mgr)(status, type, value, name)
products(amount, name, salary, status)
Task: Find value from managers where id appears in products entries with matching type.
SQL: | SELECT value FROM managers AS mgr
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11112 | train |
v3 | Schema:
customers (alias: cust)(name, id, amount, code)
accounts(value, type, salary, name)
Task: Find name from customers where amount exceeds the total value from accounts for the same code.
SQL: | SELECT name FROM customers AS cust
WHERE amount > (
SELECT SUM(value) FROM accounts AS acct
WHERE acct.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11113 | train |
v2 | Schema:
transactions (alias: txn)(value, code, salary, amount)
tasks(date, type, salary, level)
Task: Find amount from transactions where a matching record exists in tasks with the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11114 | train |
v3 | Schema:
items (alias: lne)(value, code, date, name)
schedules(amount, date, name, value)
Task: Find name from items where salary exceeds the minimum salary from schedules for the same type.
SQL: | SELECT name FROM items AS lne
WHERE salary > (
SELECT MIN(salary) FROM schedules AS schd
WHERE schd.type = lne.type
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11115 | train |
v3 | Schema:
departments (alias: dept)(level, value, salary, name)
transactions(status, value, code, level)
Task: Retrieve name from departments with amount above the MIN(value) of transactions rows sharing the same code.
SQL: | SELECT name FROM departments AS dept
WHERE amount > (
SELECT MIN(value) FROM transactions AS txn
WHERE txn.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11116 | train |
v2 | Schema:
employees (alias: emp)(date, value, salary, status)
items(name, level, date, value)
Task: Find id from employees where a matching record exists in items with the same level.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11117 | train |
v3 | Schema:
sales (alias: sale)(value, salary, amount, id)
invoices(level, type, name, status)
Task: Find code from sales where value exceeds the total amount from invoices for the same code.
SQL: | SELECT code FROM sales AS sale
WHERE value > (
SELECT SUM(amount) FROM invoices AS inv
WHERE inv.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11118 | train |
v3 | Schema:
sales (alias: sale)(value, salary, id, level)
employees(value, id, name, status)
Task: Find name from sales where value exceeds the minimum value from employees for the same level.
SQL: | SELECT name FROM sales AS sale
WHERE value > (
SELECT MIN(value) FROM employees AS emp
WHERE emp.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11119 | train |
v3 | Schema:
departments (alias: dept)(code, salary, level, name)
orders(date, code, type, amount)
Task: Retrieve amount from departments with amount above the COUNT(amount) of orders rows sharing the same id.
SQL: | SELECT amount FROM departments AS dept
WHERE amount > (
SELECT COUNT(amount) FROM orders AS ord
WHERE ord.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11120 | train |
v1 | Schema:
shipments (alias: shp)(salary, code, status, amount)
products(type, value, date, salary)
Task: Find code from shipments where level appears in products entries with matching status.
SQL: | SELECT code FROM shipments AS shp
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11121 | train |
v2 | Schema:
schedules (alias: schd)(value, salary, status, code)
departments(date, id, name, amount)
Task: Find code from schedules where a matching record exists in departments with the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11122 | train |
v2 | Schema:
staff (alias: empl)(name, status, date, amount)
managers(status, salary, type, value)
Task: Retrieve amount from staff that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11123 | train |
v1 | Schema:
accounts (alias: acct)(level, name, value, code)
transactions(value, code, date, name)
Task: Find name from accounts where type appears in transactions entries with matching code.
SQL: | SELECT name FROM accounts AS acct
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11124 | train |
v1 | Schema:
employees (alias: emp)(name, code, salary, value)
accounts(id, amount, value, status)
Task: Find code from employees where id appears in accounts entries with matching id.
SQL: | SELECT code FROM employees AS emp
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11125 | train |
v2 | Schema:
invoices (alias: inv)(level, salary, code, status)
requests(id, value, type, level)
Task: Retrieve id from invoices that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11126 | train |
v1 | Schema:
staff (alias: empl)(amount, date, code, id)
schedules(id, name, code, level)
Task: Select name from staff where type exists in schedules for the same code.
SQL: | SELECT name FROM staff AS empl
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11127 | train |
v1 | Schema:
orders (alias: ord)(date, name, code, salary)
categories(level, code, date, status)
Task: Select name from orders where level exists in categories for the same id.
SQL: | SELECT name FROM orders AS ord
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11128 | train |
v1 | Schema:
products (alias: prod)(salary, type, id, date)
requests(type, id, name, level)
Task: Find value from products where status appears in requests entries with matching level.
SQL: | SELECT value FROM products AS prod
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11129 | train |
v1 | Schema:
customers (alias: cust)(type, status, id, name)
managers(date, code, value, amount)
Task: Select salary from customers where id exists in managers for the same status.
SQL: | SELECT salary FROM customers AS cust
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11130 | train |
v2 | Schema:
regions (alias: rgn)(status, salary, id, type)
staff(status, value, name, type)
Task: Retrieve code from regions that have at least one corresponding entry in staff sharing the same level.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11131 | train |
v3 | Schema:
managers (alias: mgr)(amount, salary, level, status)
invoices(id, status, value, type)
Task: Retrieve code from managers with salary above the MIN(amount) of invoices rows sharing the same type.
SQL: | SELECT code FROM managers AS mgr
WHERE salary > (
SELECT MIN(amount) FROM invoices AS inv
WHERE inv.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11132 | train |
v3 | Schema:
categories (alias: catg)(salary, value, type, date)
staff(amount, type, status, value)
Task: Retrieve salary from categories with amount above the SUM(amount) of staff rows sharing the same level.
SQL: | SELECT salary FROM categories AS catg
WHERE amount > (
SELECT SUM(amount) FROM staff AS empl
WHERE empl.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11133 | train |
v1 | Schema:
employees (alias: emp)(status, amount, name, date)
orders(date, id, status, type)
Task: Find value from employees where status appears in orders entries with matching id.
SQL: | SELECT value FROM employees AS emp
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11134 | train |
v2 | Schema:
sales (alias: sale)(name, salary, value, code)
items(value, type, id, name)
Task: Retrieve name from sales that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11135 | train |
v2 | Schema:
invoices (alias: inv)(amount, date, value, name)
requests(status, id, salary, type)
Task: Retrieve salary from invoices that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11136 | train |
v1 | Schema:
orders (alias: ord)(amount, id, value, status)
shipments(name, id, level, value)
Task: Retrieve amount from orders whose status is found in shipments rows where type matches the outer record.
SQL: | SELECT amount FROM orders AS ord
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11137 | train |
v2 | Schema:
accounts (alias: acct)(date, id, type, code)
regions(level, date, name, id)
Task: Retrieve value from accounts that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11138 | train |
v3 | Schema:
requests (alias: ordr)(amount, level, id, type)
sales(status, level, code, type)
Task: Find name from requests where amount exceeds the count of salary from sales for the same id.
SQL: | SELECT name FROM requests AS ordr
WHERE amount > (
SELECT COUNT(salary) FROM sales AS sale
WHERE sale.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11139 | train |
v3 | Schema:
invoices (alias: inv)(status, amount, level, code)
customers(type, level, id, name)
Task: Find salary from invoices where amount exceeds the total salary from customers for the same type.
SQL: | SELECT salary FROM invoices AS inv
WHERE amount > (
SELECT SUM(salary) FROM customers AS cust
WHERE cust.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11140 | train |
v1 | Schema:
accounts (alias: acct)(level, code, value, date)
employees(value, type, salary, level)
Task: Select salary from accounts where type exists in employees for the same type.
SQL: | SELECT salary FROM accounts AS acct
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11141 | train |
v1 | Schema:
items (alias: lne)(salary, type, value, status)
schedules(salary, name, type, date)
Task: Select id from items where code exists in schedules for the same code.
SQL: | SELECT id FROM items AS lne
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.code = lne.code
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11142 | train |
v1 | Schema:
sales (alias: sale)(salary, id, date, value)
invoices(level, date, status, amount)
Task: Find value from sales where code appears in invoices entries with matching status.
SQL: | SELECT value FROM sales AS sale
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11143 | train |
v1 | Schema:
categories (alias: catg)(name, code, amount, type)
projects(name, salary, value, status)
Task: Retrieve name from categories whose type is found in projects rows where code matches the outer record.
SQL: | SELECT name FROM categories AS catg
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11144 | train |
v1 | Schema:
projects (alias: prj)(type, amount, code, status)
regions(level, amount, id, value)
Task: Find amount from projects where level appears in regions entries with matching type.
SQL: | SELECT amount FROM projects AS prj
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11145 | train |
v2 | Schema:
accounts (alias: acct)(amount, type, code, id)
departments(level, type, salary, status)
Task: Retrieve value from accounts that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11146 | train |
v1 | Schema:
accounts (alias: acct)(date, type, amount, level)
managers(salary, date, id, status)
Task: Retrieve id from accounts whose level is found in managers rows where status matches the outer record.
SQL: | SELECT id FROM accounts AS acct
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11147 | train |
v3 | Schema:
employees (alias: emp)(code, type, id, value)
requests(status, salary, name, id)
Task: Retrieve code from employees with amount above the MAX(amount) of requests rows sharing the same status.
SQL: | SELECT code FROM employees AS emp
WHERE amount > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11148 | train |
v3 | Schema:
employees (alias: emp)(name, type, amount, salary)
departments(status, code, id, level)
Task: Retrieve id from employees with value above the MIN(amount) of departments rows sharing the same id.
SQL: | SELECT id FROM employees AS emp
WHERE value > (
SELECT MIN(amount) FROM departments AS dept
WHERE dept.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11149 | train |
v3 | Schema:
categories (alias: catg)(type, date, name, salary)
managers(date, salary, amount, level)
Task: Find salary from categories where value exceeds the total salary from managers for the same level.
SQL: | SELECT salary FROM categories AS catg
WHERE value > (
SELECT SUM(salary) FROM managers AS mgr
WHERE mgr.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11150 | train |
v1 | Schema:
employees (alias: emp)(amount, type, value, date)
sales(amount, level, type, value)
Task: Retrieve code from employees whose id is found in sales rows where type matches the outer record.
SQL: | SELECT code FROM employees AS emp
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11151 | train |
v1 | Schema:
projects (alias: prj)(amount, type, id, code)
items(value, amount, id, date)
Task: Select amount from projects where level exists in items for the same id.
SQL: | SELECT amount FROM projects AS prj
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11152 | train |
v1 | Schema:
schedules (alias: schd)(amount, level, id, code)
projects(value, status, code, date)
Task: Find salary from schedules where level appears in projects entries with matching type.
SQL: | SELECT salary FROM schedules AS schd
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11153 | train |
v3 | Schema:
schedules (alias: schd)(value, status, level, date)
invoices(date, level, code, status)
Task: Retrieve id from schedules with salary above the MIN(salary) of invoices rows sharing the same level.
SQL: | SELECT id FROM schedules AS schd
WHERE salary > (
SELECT MIN(salary) FROM invoices AS inv
WHERE inv.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11154 | train |
v3 | Schema:
staff (alias: empl)(value, level, amount, name)
categories(code, amount, level, name)
Task: Find amount from staff where value exceeds the minimum salary from categories for the same type.
SQL: | SELECT amount FROM staff AS empl
WHERE value > (
SELECT MIN(salary) FROM categories AS catg
WHERE catg.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11155 | train |
v3 | Schema:
sales (alias: sale)(level, type, amount, status)
managers(value, date, salary, amount)
Task: Retrieve value from sales with amount above the AVG(salary) of managers rows sharing the same code.
SQL: | SELECT value FROM sales AS sale
WHERE amount > (
SELECT AVG(salary) FROM managers AS mgr
WHERE mgr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11156 | train |
v2 | Schema:
departments (alias: dept)(name, amount, code, salary)
projects(id, code, status, level)
Task: Retrieve salary from departments that have at least one corresponding entry in projects sharing the same code.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11157 | train |
v2 | Schema:
shipments (alias: shp)(date, amount, id, type)
products(name, code, id, amount)
Task: Retrieve salary from shipments that have at least one corresponding entry in products sharing the same code.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11158 | train |
v2 | Schema:
requests (alias: ordr)(status, value, date, type)
products(date, level, id, code)
Task: Find amount from requests where a matching record exists in products with the same code.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11159 | train |
v1 | Schema:
orders (alias: ord)(name, salary, type, value)
requests(code, amount, status, id)
Task: Select amount from orders where type exists in requests for the same code.
SQL: | SELECT amount FROM orders AS ord
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11160 | train |
v1 | Schema:
departments (alias: dept)(code, name, id, amount)
staff(value, date, salary, id)
Task: Find name from departments where id appears in staff entries with matching code.
SQL: | SELECT name FROM departments AS dept
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11161 | train |
v1 | Schema:
employees (alias: emp)(type, status, id, code)
items(salary, id, value, level)
Task: Retrieve name from employees whose level is found in items rows where code matches the outer record.
SQL: | SELECT name FROM employees AS emp
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11162 | train |
v3 | Schema:
orders (alias: ord)(amount, type, level, value)
regions(status, date, amount, level)
Task: Find code from orders where value exceeds the maximum value from regions for the same id.
SQL: | SELECT code FROM orders AS ord
WHERE value > (
SELECT MAX(value) FROM regions AS rgn
WHERE rgn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11163 | train |
v3 | Schema:
departments (alias: dept)(level, type, status, amount)
sales(value, status, code, level)
Task: Find amount from departments where value exceeds the minimum salary from sales for the same type.
SQL: | SELECT amount FROM departments AS dept
WHERE value > (
SELECT MIN(salary) FROM sales AS sale
WHERE sale.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11164 | train |
v1 | Schema:
schedules (alias: schd)(value, salary, amount, id)
sales(status, date, value, name)
Task: Find name from schedules where type appears in sales entries with matching level.
SQL: | SELECT name FROM schedules AS schd
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11165 | train |
v2 | Schema:
requests (alias: ordr)(level, amount, code, name)
categories(status, name, level, type)
Task: Retrieve name from requests that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11166 | train |
v3 | Schema:
schedules (alias: schd)(code, status, type, salary)
employees(date, amount, code, value)
Task: Find code from schedules where amount exceeds the count of amount from employees for the same code.
SQL: | SELECT code FROM schedules AS schd
WHERE amount > (
SELECT COUNT(amount) FROM employees AS emp
WHERE emp.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11167 | train |
v3 | Schema:
branches (alias: brc)(status, level, code, salary)
staff(id, amount, salary, code)
Task: Retrieve id from branches with amount above the SUM(salary) of staff rows sharing the same type.
SQL: | SELECT id FROM branches AS brc
WHERE amount > (
SELECT SUM(salary) 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": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11168 | train |
v3 | Schema:
accounts (alias: acct)(name, value, type, status)
items(level, value, date, status)
Task: Retrieve code from accounts with value above the COUNT(salary) of items rows sharing the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE value > (
SELECT COUNT(salary) FROM items AS lne
WHERE lne.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11169 | train |
v3 | Schema:
items (alias: lne)(amount, status, id, level)
branches(type, salary, amount, value)
Task: Find value from items where salary exceeds the total amount from branches for the same code.
SQL: | SELECT value FROM items AS lne
WHERE salary > (
SELECT SUM(amount) FROM branches AS brc
WHERE brc.code = lne.code
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11170 | train |
v2 | Schema:
invoices (alias: inv)(value, type, id, level)
customers(name, amount, code, salary)
Task: Find salary from invoices where a matching record exists in customers with the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11171 | train |
v3 | Schema:
managers (alias: mgr)(value, status, type, id)
branches(salary, amount, date, value)
Task: Retrieve code from managers with amount above the AVG(salary) of branches rows sharing the same code.
SQL: | SELECT code FROM managers AS mgr
WHERE amount > (
SELECT AVG(salary) FROM branches AS brc
WHERE brc.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11172 | train |
v2 | Schema:
sales (alias: sale)(amount, value, id, level)
orders(type, value, status, id)
Task: Retrieve value from sales that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11173 | train |
v3 | Schema:
regions (alias: rgn)(id, amount, name, type)
sales(name, code, type, value)
Task: Find name from regions where value exceeds the average value from sales for the same code.
SQL: | SELECT name FROM regions AS rgn
WHERE value > (
SELECT AVG(value) FROM sales AS sale
WHERE sale.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11174 | train |
v2 | Schema:
categories (alias: catg)(code, value, name, salary)
sales(type, code, date, salary)
Task: Retrieve salary from categories that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11175 | train |
v2 | Schema:
tasks (alias: tsk)(name, value, code, type)
transactions(name, code, id, type)
Task: Retrieve id from tasks that have at least one corresponding entry in transactions sharing the same code.
SQL: | SELECT id 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": "id",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11176 | train |
v3 | Schema:
tasks (alias: tsk)(id, value, status, code)
departments(amount, type, id, status)
Task: Retrieve id from tasks with amount above the COUNT(amount) of departments rows sharing the same type.
SQL: | SELECT id FROM tasks AS tsk
WHERE amount > (
SELECT COUNT(amount) FROM departments AS dept
WHERE dept.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "tsk",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11177 | train |
v3 | Schema:
transactions (alias: txn)(value, level, id, code)
requests(code, status, amount, type)
Task: Find id from transactions where amount exceeds the total salary from requests for the same level.
SQL: | SELECT id FROM transactions AS txn
WHERE amount > (
SELECT SUM(salary) FROM requests AS ordr
WHERE ordr.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11178 | train |
v1 | Schema:
tasks (alias: tsk)(level, value, id, code)
managers(value, salary, name, id)
Task: Select salary from tasks where status exists in managers for the same type.
SQL: | SELECT salary FROM tasks AS tsk
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11179 | train |
v1 | Schema:
staff (alias: empl)(amount, date, id, status)
items(value, type, status, id)
Task: Find name from staff where id appears in items entries with matching level.
SQL: | SELECT name FROM staff AS empl
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11180 | train |
v3 | Schema:
projects (alias: prj)(status, level, name, amount)
customers(amount, name, level, salary)
Task: Find code from projects where salary exceeds the minimum amount from customers for the same code.
SQL: | SELECT code FROM projects AS prj
WHERE salary > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "prj",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11181 | train |
v3 | Schema:
shipments (alias: shp)(salary, type, level, value)
schedules(level, name, salary, value)
Task: Find name from shipments where amount exceeds the count of value from schedules for the same code.
SQL: | SELECT name FROM shipments AS shp
WHERE amount > (
SELECT COUNT(value) FROM schedules AS schd
WHERE schd.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11182 | train |
v3 | Schema:
transactions (alias: txn)(value, level, date, status)
products(date, value, status, id)
Task: Retrieve value from transactions with amount above the MIN(salary) of products rows sharing the same id.
SQL: | SELECT value FROM transactions AS txn
WHERE amount > (
SELECT MIN(salary) FROM products AS prod
WHERE prod.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11183 | train |
v1 | Schema:
departments (alias: dept)(name, type, level, date)
employees(status, salary, amount, type)
Task: Select salary from departments where type exists in employees for the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11184 | train |
v3 | Schema:
departments (alias: dept)(value, id, status, name)
regions(value, status, code, name)
Task: Retrieve code from departments with salary above the COUNT(salary) of regions rows sharing the same code.
SQL: | SELECT code FROM departments AS dept
WHERE salary > (
SELECT COUNT(salary) FROM regions AS rgn
WHERE rgn.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11185 | train |
v3 | Schema:
departments (alias: dept)(date, type, name, status)
managers(code, type, value, date)
Task: Retrieve id from departments with value above the MIN(value) of managers rows sharing the same id.
SQL: | SELECT id FROM departments AS dept
WHERE value > (
SELECT MIN(value) FROM managers AS mgr
WHERE mgr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11186 | train |
v3 | Schema:
invoices (alias: inv)(type, amount, salary, id)
orders(date, id, name, salary)
Task: Retrieve code from invoices with amount above the SUM(amount) of orders rows sharing the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE amount > (
SELECT SUM(amount) FROM orders AS ord
WHERE ord.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11187 | train |
v1 | Schema:
transactions (alias: txn)(value, type, code, date)
requests(type, name, id, code)
Task: Retrieve code from transactions whose type is found in requests rows where id matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11188 | train |
v2 | Schema:
projects (alias: prj)(type, date, status, name)
staff(amount, value, salary, id)
Task: Retrieve name from projects that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "staff",
"outer_alias": "prj",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11189 | train |
v1 | Schema:
invoices (alias: inv)(status, code, level, amount)
items(salary, level, code, value)
Task: Select value from invoices where id exists in items for the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11190 | train |
v3 | Schema:
staff (alias: empl)(id, amount, code, status)
orders(code, salary, value, status)
Task: Find salary from staff where amount exceeds the count of amount from orders for the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE amount > (
SELECT COUNT(amount) FROM orders AS ord
WHERE ord.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11191 | train |
v2 | Schema:
employees (alias: emp)(date, value, id, status)
projects(amount, type, salary, name)
Task: Retrieve id from employees that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "projects",
"outer_alias": "emp",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11192 | train |
v1 | Schema:
transactions (alias: txn)(id, salary, type, level)
products(amount, type, code, salary)
Task: Select code from transactions where level exists in products for the same id.
SQL: | SELECT code FROM transactions AS txn
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11193 | train |
v3 | Schema:
products (alias: prod)(type, amount, salary, code)
managers(amount, salary, id, name)
Task: Retrieve amount from products with value above the MAX(salary) of managers rows sharing the same level.
SQL: | SELECT amount FROM products AS prod
WHERE value > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11194 | train |
v2 | Schema:
managers (alias: mgr)(status, name, date, type)
requests(status, type, name, code)
Task: Find id from managers where a matching record exists in requests with the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11195 | train |
v1 | Schema:
schedules (alias: schd)(level, name, salary, type)
departments(level, name, code, id)
Task: Find code from schedules where id appears in departments entries with matching type.
SQL: | SELECT code FROM schedules AS schd
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11196 | train |
v3 | Schema:
schedules (alias: schd)(name, date, type, amount)
requests(id, salary, type, level)
Task: Retrieve id from schedules with value above the AVG(amount) of requests rows sharing the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE value > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11197 | train |
v3 | Schema:
tasks (alias: tsk)(amount, code, type, value)
categories(type, code, salary, value)
Task: Find amount from tasks where amount exceeds the average amount from categories for the same level.
SQL: | SELECT amount FROM tasks AS tsk
WHERE amount > (
SELECT AVG(amount) 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": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11198 | train |
v1 | Schema:
managers (alias: mgr)(amount, level, value, type)
sales(level, type, salary, name)
Task: Retrieve value from managers whose id is found in sales rows where type matches the outer record.
SQL: | SELECT value FROM managers AS mgr
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11199 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.