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:
items (alias: lne)(type, id, amount, value)
products(id, amount, salary, value)
Task: Retrieve amount from items whose level is found in products rows where id matches the outer record.
SQL: | SELECT amount FROM items AS lne
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.id = lne.id
); | {
"outer_table": "items",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16400 | train |
v1 | Schema:
orders (alias: ord)(type, salary, id, amount)
departments(id, code, name, salary)
Task: Retrieve name from orders whose type is found in departments rows where level matches the outer record.
SQL: | SELECT name FROM orders AS ord
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16401 | train |
v3 | Schema:
orders (alias: ord)(date, amount, salary, id)
categories(amount, status, type, value)
Task: Retrieve id from orders with salary above the MAX(value) of categories rows sharing the same id.
SQL: | SELECT id FROM orders AS ord
WHERE salary > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16402 | train |
v2 | Schema:
managers (alias: mgr)(id, value, code, level)
sales(amount, type, level, date)
Task: Retrieve name from managers that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT name 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": "name",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16403 | train |
v3 | Schema:
transactions (alias: txn)(status, name, value, id)
accounts(type, amount, name, id)
Task: Retrieve code from transactions with salary above the MIN(value) of accounts rows sharing the same code.
SQL: | SELECT code FROM transactions AS txn
WHERE salary > (
SELECT MIN(value) FROM accounts AS acct
WHERE acct.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16404 | train |
v2 | Schema:
departments (alias: dept)(name, code, status, level)
customers(amount, id, name, type)
Task: Retrieve id from departments that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16405 | train |
v1 | Schema:
staff (alias: empl)(status, salary, date, name)
tasks(id, value, level, amount)
Task: Find amount from staff where id appears in tasks entries with matching type.
SQL: | SELECT amount FROM staff AS empl
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16406 | train |
v1 | Schema:
projects (alias: prj)(code, level, id, type)
sales(date, code, type, status)
Task: Select code from projects where code exists in sales for the same code.
SQL: | SELECT code FROM projects AS prj
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16407 | train |
v1 | Schema:
products (alias: prod)(salary, type, status, amount)
items(name, status, code, value)
Task: Select salary from products where level exists in items for the same level.
SQL: | SELECT salary FROM products AS prod
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.level = prod.level
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16408 | train |
v1 | Schema:
departments (alias: dept)(code, salary, amount, level)
shipments(salary, code, value, status)
Task: Select name from departments where status exists in shipments for the same level.
SQL: | SELECT name FROM departments AS dept
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16409 | train |
v3 | Schema:
branches (alias: brc)(value, id, name, status)
sales(amount, level, salary, type)
Task: Find code from branches where salary exceeds the total amount from sales for the same status.
SQL: | SELECT code FROM branches AS brc
WHERE salary > (
SELECT SUM(amount) FROM sales AS sale
WHERE sale.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16410 | train |
v1 | Schema:
staff (alias: empl)(salary, amount, status, date)
requests(name, value, level, amount)
Task: Select salary from staff where code exists in requests for the same status.
SQL: | SELECT salary FROM staff AS empl
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16411 | train |
v2 | Schema:
products (alias: prod)(amount, type, value, name)
transactions(amount, level, id, status)
Task: Retrieve name from products that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = prod.level
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16412 | train |
v1 | Schema:
employees (alias: emp)(salary, level, code, status)
departments(amount, date, level, status)
Task: Select id from employees where type exists in departments for the same status.
SQL: | SELECT id FROM employees AS emp
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16413 | train |
v2 | Schema:
transactions (alias: txn)(status, amount, code, type)
requests(type, status, name, value)
Task: Retrieve salary from transactions that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16414 | train |
v3 | Schema:
shipments (alias: shp)(id, date, name, level)
employees(value, level, type, date)
Task: Find amount from shipments where salary exceeds the average value from employees for the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE salary > (
SELECT AVG(value) FROM employees AS emp
WHERE emp.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16415 | train |
v2 | Schema:
orders (alias: ord)(name, type, code, date)
managers(value, date, name, id)
Task: Find salary from orders where a matching record exists in managers with the same type.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16416 | train |
v1 | Schema:
items (alias: lne)(value, salary, level, id)
accounts(salary, level, id, code)
Task: Find code from items where code appears in accounts entries with matching level.
SQL: | SELECT code FROM items AS lne
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.level = lne.level
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16417 | train |
v3 | Schema:
orders (alias: ord)(name, status, level, value)
sales(type, amount, salary, date)
Task: Find code from orders where value exceeds the average value from sales for the same id.
SQL: | SELECT code FROM orders AS ord
WHERE value > (
SELECT AVG(value) FROM sales AS sale
WHERE sale.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16418 | train |
v1 | Schema:
schedules (alias: schd)(name, code, type, date)
requests(name, date, code, status)
Task: Find value from schedules where code appears in requests entries with matching level.
SQL: | SELECT value FROM schedules AS schd
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16419 | train |
v3 | Schema:
schedules (alias: schd)(id, code, status, name)
tasks(code, id, salary, level)
Task: Retrieve name from schedules with amount above the SUM(salary) of tasks rows sharing the same code.
SQL: | SELECT name FROM schedules AS schd
WHERE amount > (
SELECT SUM(salary) FROM tasks AS tsk
WHERE tsk.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16420 | train |
v3 | Schema:
tasks (alias: tsk)(code, name, amount, value)
products(status, code, name, salary)
Task: Find id from tasks where value exceeds the minimum amount from products for the same type.
SQL: | SELECT id FROM tasks AS tsk
WHERE value > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16421 | train |
v2 | Schema:
managers (alias: mgr)(salary, level, id, status)
products(salary, id, status, code)
Task: Find id from managers where a matching record exists in products with the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16422 | train |
v2 | Schema:
managers (alias: mgr)(status, value, salary, level)
tasks(name, level, code, status)
Task: Find amount from managers where a matching record exists in tasks with the same type.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16423 | train |
v1 | Schema:
managers (alias: mgr)(value, id, amount, name)
customers(date, name, code, level)
Task: Select id from managers where level exists in customers for the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16424 | train |
v1 | Schema:
items (alias: lne)(status, code, date, level)
invoices(value, status, salary, type)
Task: Find value from items where id appears in invoices entries with matching code.
SQL: | SELECT value FROM items AS lne
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.code = lne.code
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16425 | train |
v3 | Schema:
departments (alias: dept)(date, level, id, amount)
sales(type, id, code, name)
Task: Retrieve salary from departments with salary above the SUM(value) of sales rows sharing the same level.
SQL: | SELECT salary FROM departments AS dept
WHERE salary > (
SELECT SUM(value) FROM sales AS sale
WHERE sale.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16426 | train |
v2 | Schema:
transactions (alias: txn)(value, code, status, name)
products(amount, code, status, level)
Task: Retrieve amount from transactions that have at least one corresponding entry in products sharing the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16427 | train |
v1 | Schema:
requests (alias: ordr)(name, amount, salary, value)
items(status, name, type, level)
Task: Select code from requests where status exists in items for the same status.
SQL: | SELECT code FROM requests AS ordr
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16428 | train |
v2 | Schema:
orders (alias: ord)(salary, value, id, amount)
accounts(status, id, code, date)
Task: Retrieve value from orders that have at least one corresponding entry in accounts sharing the same type.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16429 | train |
v2 | Schema:
projects (alias: prj)(level, name, salary, id)
shipments(type, salary, id, value)
Task: Find value from projects where a matching record exists in shipments with the same status.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16430 | train |
v1 | Schema:
orders (alias: ord)(value, name, amount, salary)
shipments(type, code, amount, salary)
Task: Retrieve code from orders whose status is found in shipments rows where type matches the outer record.
SQL: | SELECT code 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": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16431 | train |
v3 | Schema:
branches (alias: brc)(salary, level, type, value)
products(level, value, amount, code)
Task: Retrieve id from branches with amount above the MIN(amount) of products rows sharing the same code.
SQL: | SELECT id FROM branches AS brc
WHERE amount > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16432 | train |
v1 | Schema:
employees (alias: emp)(level, type, date, status)
products(code, amount, type, value)
Task: Retrieve code from employees whose status is found in products rows where code matches the outer record.
SQL: | SELECT code FROM employees AS emp
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16433 | train |
v1 | Schema:
employees (alias: emp)(type, date, id, level)
tasks(status, level, amount, code)
Task: Find name from employees where code appears in tasks entries with matching id.
SQL: | SELECT name FROM employees AS emp
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16434 | train |
v1 | Schema:
staff (alias: empl)(amount, code, date, value)
managers(value, amount, name, date)
Task: Retrieve id from staff whose type is found in managers rows where code matches the outer record.
SQL: | SELECT id FROM staff AS empl
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16435 | train |
v3 | Schema:
departments (alias: dept)(type, date, level, salary)
managers(salary, value, name, id)
Task: Find code from departments where salary exceeds the average value from managers for the same level.
SQL: | SELECT code FROM departments AS dept
WHERE salary > (
SELECT AVG(value) FROM managers AS mgr
WHERE mgr.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16436 | train |
v1 | Schema:
categories (alias: catg)(date, name, amount, value)
sales(status, salary, id, name)
Task: Select code from categories where id exists in sales for the same level.
SQL: | SELECT code FROM categories AS catg
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16437 | train |
v2 | Schema:
transactions (alias: txn)(id, status, value, type)
sales(name, type, code, date)
Task: Find amount from transactions where a matching record exists in sales with the same type.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16438 | train |
v1 | Schema:
requests (alias: ordr)(name, type, amount, salary)
branches(level, code, amount, name)
Task: Find value from requests where id appears in branches entries with matching status.
SQL: | SELECT value FROM requests AS ordr
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16439 | train |
v1 | Schema:
departments (alias: dept)(date, name, salary, code)
shipments(type, code, value, name)
Task: Find code from departments where type appears in shipments entries with matching type.
SQL: | SELECT code FROM departments AS dept
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16440 | train |
v1 | Schema:
employees (alias: emp)(type, status, id, date)
departments(value, salary, id, name)
Task: Retrieve id from employees whose level is found in departments rows where level matches the outer record.
SQL: | SELECT id FROM employees AS emp
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16441 | train |
v1 | Schema:
managers (alias: mgr)(level, code, name, date)
schedules(value, name, id, code)
Task: Retrieve salary from managers whose id is found in schedules rows where code matches the outer record.
SQL: | SELECT salary FROM managers AS mgr
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16442 | train |
v1 | Schema:
managers (alias: mgr)(value, code, salary, id)
employees(type, salary, name, date)
Task: Find id from managers where code appears in employees entries with matching status.
SQL: | SELECT id FROM managers AS mgr
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16443 | train |
v2 | Schema:
schedules (alias: schd)(status, name, date, type)
accounts(status, name, level, salary)
Task: Find code from schedules where a matching record exists in accounts with the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16444 | train |
v3 | Schema:
departments (alias: dept)(status, value, salary, code)
invoices(type, value, code, date)
Task: Find value from departments where salary exceeds the maximum amount from invoices for the same level.
SQL: | SELECT value FROM departments AS dept
WHERE salary > (
SELECT MAX(amount) FROM invoices AS inv
WHERE inv.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "invoices",
"outer_alias": "dept",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16445 | train |
v2 | Schema:
tasks (alias: tsk)(id, amount, date, status)
branches(salary, id, date, level)
Task: Find value from tasks where a matching record exists in branches with the same id.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16446 | train |
v2 | Schema:
items (alias: lne)(value, code, status, name)
regions(salary, id, name, level)
Task: Retrieve id from items that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16447 | train |
v3 | Schema:
invoices (alias: inv)(date, code, value, status)
managers(level, salary, status, amount)
Task: Retrieve value from invoices with amount above the COUNT(salary) of managers rows sharing the same id.
SQL: | SELECT value FROM invoices AS inv
WHERE amount > (
SELECT COUNT(salary) FROM managers AS mgr
WHERE mgr.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16448 | train |
v2 | Schema:
products (alias: prod)(date, amount, status, level)
customers(salary, name, level, status)
Task: Retrieve value from products that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = prod.level
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16449 | train |
v3 | Schema:
regions (alias: rgn)(code, salary, date, status)
orders(level, name, date, amount)
Task: Retrieve id from regions with salary above the MIN(salary) of orders rows sharing the same type.
SQL: | SELECT id FROM regions AS rgn
WHERE salary > (
SELECT MIN(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": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16450 | train |
v3 | Schema:
transactions (alias: txn)(amount, status, name, type)
staff(status, value, name, code)
Task: Retrieve name from transactions with amount above the SUM(salary) of staff rows sharing the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE amount > (
SELECT SUM(salary) FROM staff AS empl
WHERE empl.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16451 | train |
v1 | Schema:
shipments (alias: shp)(value, level, name, type)
sales(salary, name, type, date)
Task: Retrieve salary from shipments whose code is found in sales rows where level matches the outer record.
SQL: | SELECT salary FROM shipments AS shp
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16452 | train |
v1 | Schema:
regions (alias: rgn)(status, code, date, id)
requests(code, level, id, date)
Task: Find amount from regions where code appears in requests entries with matching status.
SQL: | SELECT amount FROM regions AS rgn
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16453 | train |
v1 | Schema:
managers (alias: mgr)(salary, code, name, status)
items(id, date, code, level)
Task: Find value from managers where level appears in items entries with matching code.
SQL: | SELECT value FROM managers AS mgr
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16454 | train |
v2 | Schema:
sales (alias: sale)(type, value, date, code)
tasks(salary, level, id, code)
Task: Retrieve id from sales that have at least one corresponding entry in tasks sharing the same status.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16455 | train |
v2 | Schema:
products (alias: prod)(name, id, amount, code)
employees(name, date, type, code)
Task: Find code from products where a matching record exists in employees with the same status.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = prod.status
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16456 | train |
v1 | Schema:
tasks (alias: tsk)(type, date, status, amount)
transactions(date, value, name, id)
Task: Retrieve name from tasks whose code is found in transactions rows where type matches the outer record.
SQL: | SELECT name FROM tasks AS tsk
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16457 | train |
v2 | Schema:
orders (alias: ord)(level, status, date, value)
invoices(salary, code, value, type)
Task: Find value from orders where a matching record exists in invoices with the same status.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16458 | train |
v3 | Schema:
customers (alias: cust)(code, type, status, salary)
schedules(date, code, value, level)
Task: Find id from customers where amount exceeds the total salary from schedules for the same level.
SQL: | SELECT id FROM customers AS cust
WHERE amount > (
SELECT SUM(salary) FROM schedules AS schd
WHERE schd.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16459 | train |
v2 | Schema:
projects (alias: prj)(value, level, amount, type)
accounts(level, code, type, id)
Task: Retrieve id from projects that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16460 | train |
v1 | Schema:
employees (alias: emp)(id, value, type, amount)
invoices(value, amount, code, date)
Task: Find amount from employees where status appears in invoices entries with matching code.
SQL: | SELECT amount FROM employees AS emp
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16461 | train |
v2 | Schema:
staff (alias: empl)(name, code, status, date)
projects(code, amount, value, name)
Task: Find value from staff where a matching record exists in projects with the same id.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16462 | train |
v1 | Schema:
staff (alias: empl)(code, value, level, amount)
customers(level, status, salary, value)
Task: Find salary from staff where code appears in customers entries with matching code.
SQL: | SELECT salary FROM staff AS empl
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16463 | train |
v3 | Schema:
schedules (alias: schd)(salary, date, level, amount)
tasks(date, status, value, code)
Task: Retrieve value from schedules with value above the SUM(value) of tasks rows sharing the same status.
SQL: | SELECT value FROM schedules AS schd
WHERE value > (
SELECT SUM(value) FROM tasks AS tsk
WHERE tsk.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16464 | train |
v1 | Schema:
orders (alias: ord)(id, code, type, name)
invoices(id, amount, date, value)
Task: Retrieve name from orders whose code is found in invoices rows where type matches the outer record.
SQL: | SELECT name FROM orders AS ord
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16465 | train |
v2 | Schema:
employees (alias: emp)(level, status, salary, name)
tasks(code, level, id, value)
Task: Find code from employees where a matching record exists in tasks with the same type.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16466 | train |
v3 | Schema:
schedules (alias: schd)(salary, name, type, code)
projects(type, id, name, date)
Task: Retrieve id from schedules with amount above the SUM(salary) of projects rows sharing the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE amount > (
SELECT SUM(salary) FROM projects AS prj
WHERE prj.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16467 | train |
v2 | Schema:
managers (alias: mgr)(id, date, code, type)
branches(status, code, id, name)
Task: Find salary from managers where a matching record exists in branches with the same id.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16468 | train |
v2 | Schema:
invoices (alias: inv)(name, salary, code, type)
managers(salary, code, name, type)
Task: Find id from invoices where a matching record exists in managers with the same type.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16469 | train |
v2 | Schema:
invoices (alias: inv)(level, code, value, amount)
sales(type, level, status, date)
Task: Retrieve id from invoices that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16470 | train |
v3 | Schema:
branches (alias: brc)(type, level, name, status)
sales(amount, level, status, value)
Task: Find id from branches where value exceeds the average value from sales for the same id.
SQL: | SELECT id FROM branches AS brc
WHERE value > (
SELECT AVG(value) FROM sales AS sale
WHERE sale.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16471 | train |
v2 | Schema:
requests (alias: ordr)(amount, level, value, code)
products(code, status, value, date)
Task: Find code from requests where a matching record exists in products with the same code.
SQL: | SELECT code 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": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16472 | train |
v2 | Schema:
orders (alias: ord)(type, date, salary, code)
products(status, id, name, salary)
Task: Retrieve value from orders that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16473 | train |
v2 | Schema:
branches (alias: brc)(value, status, name, level)
items(value, name, level, salary)
Task: Find name from branches where a matching record exists in items with the same id.
SQL: | SELECT name FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16474 | train |
v3 | Schema:
sales (alias: sale)(date, status, amount, type)
managers(id, salary, date, type)
Task: Retrieve value from sales with amount above the MIN(value) of managers rows sharing the same id.
SQL: | SELECT value FROM sales AS sale
WHERE amount > (
SELECT MIN(value) FROM managers AS mgr
WHERE mgr.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16475 | train |
v1 | Schema:
branches (alias: brc)(id, value, date, type)
tasks(amount, value, code, salary)
Task: Retrieve code from branches whose id is found in tasks rows where level matches the outer record.
SQL: | SELECT code FROM branches AS brc
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16476 | train |
v1 | Schema:
sales (alias: sale)(value, code, amount, name)
accounts(code, value, salary, name)
Task: Find id from sales where id appears in accounts entries with matching status.
SQL: | SELECT id FROM sales AS sale
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16477 | train |
v3 | Schema:
requests (alias: ordr)(type, value, id, code)
departments(status, name, date, amount)
Task: Retrieve id from requests with amount above the MIN(salary) of departments rows sharing the same status.
SQL: | SELECT id FROM requests AS ordr
WHERE amount > (
SELECT MIN(salary) FROM departments AS dept
WHERE dept.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16478 | train |
v1 | Schema:
departments (alias: dept)(value, date, salary, name)
products(amount, salary, level, code)
Task: Select salary from departments where id exists in products for the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16479 | train |
v2 | Schema:
projects (alias: prj)(value, amount, status, level)
sales(type, name, date, value)
Task: Retrieve code from projects that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16480 | train |
v2 | Schema:
departments (alias: dept)(name, code, id, type)
regions(name, date, level, code)
Task: Find id from departments where a matching record exists in regions with the same status.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16481 | train |
v2 | Schema:
items (alias: lne)(code, date, type, status)
transactions(value, code, level, status)
Task: Retrieve value from items that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = lne.id
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16482 | train |
v1 | Schema:
transactions (alias: txn)(date, level, name, status)
accounts(type, id, value, salary)
Task: Retrieve name from transactions whose status is found in accounts rows where code matches the outer record.
SQL: | SELECT name FROM transactions AS txn
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16483 | train |
v3 | Schema:
schedules (alias: schd)(id, salary, date, status)
invoices(type, amount, salary, value)
Task: Find value from schedules where value exceeds the total salary from invoices for the same status.
SQL: | SELECT value FROM schedules AS schd
WHERE value > (
SELECT SUM(salary) FROM invoices AS inv
WHERE inv.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16484 | train |
v2 | Schema:
staff (alias: empl)(status, type, code, date)
tasks(level, name, id, code)
Task: Find amount from staff where a matching record exists in tasks with the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16485 | train |
v1 | Schema:
managers (alias: mgr)(id, date, code, level)
employees(code, status, value, amount)
Task: Find value from managers where status appears in employees entries with matching id.
SQL: | SELECT value FROM managers AS mgr
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16486 | train |
v1 | Schema:
employees (alias: emp)(name, amount, date, code)
sales(date, type, code, level)
Task: Find id from employees where status appears in sales entries with matching status.
SQL: | SELECT id FROM employees AS emp
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16487 | train |
v1 | Schema:
branches (alias: brc)(type, date, level, name)
shipments(name, amount, value, date)
Task: Retrieve id from branches whose type is found in shipments rows where type matches the outer record.
SQL: | SELECT id FROM branches AS brc
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16488 | train |
v2 | Schema:
requests (alias: ordr)(level, amount, salary, type)
departments(value, amount, name, status)
Task: Retrieve name from requests that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16489 | train |
v2 | Schema:
shipments (alias: shp)(type, value, name, salary)
employees(type, id, value, salary)
Task: Find amount from shipments where a matching record exists in employees with the same code.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16490 | train |
v2 | Schema:
regions (alias: rgn)(salary, level, status, code)
schedules(amount, type, id, status)
Task: Find salary from regions where a matching record exists in schedules with the same level.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16491 | train |
v2 | Schema:
sales (alias: sale)(salary, code, date, status)
projects(value, amount, code, level)
Task: Retrieve value from sales that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16492 | train |
v3 | Schema:
items (alias: lne)(code, salary, amount, level)
orders(value, status, amount, type)
Task: Find value from items where value exceeds the minimum amount from orders for the same status.
SQL: | SELECT value FROM items AS lne
WHERE value > (
SELECT MIN(amount) FROM orders AS ord
WHERE ord.status = lne.status
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16493 | train |
v1 | Schema:
managers (alias: mgr)(value, amount, date, salary)
customers(name, amount, code, level)
Task: Retrieve code from managers whose type is found in customers rows where type matches the outer record.
SQL: | SELECT code FROM managers AS mgr
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16494 | train |
v2 | Schema:
transactions (alias: txn)(name, value, amount, date)
projects(value, level, status, amount)
Task: Retrieve amount from transactions that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16495 | train |
v2 | Schema:
staff (alias: empl)(level, status, id, amount)
customers(salary, status, name, value)
Task: Retrieve name from staff that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16496 | train |
v3 | Schema:
regions (alias: rgn)(id, level, name, status)
accounts(type, salary, date, name)
Task: Retrieve id from regions with amount above the MIN(value) of accounts rows sharing the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE amount > (
SELECT MIN(value) FROM accounts AS acct
WHERE acct.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16497 | train |
v1 | Schema:
projects (alias: prj)(salary, type, level, name)
regions(date, name, amount, level)
Task: Retrieve value from projects whose type is found in regions rows where status matches the outer record.
SQL: | SELECT value FROM projects AS prj
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16498 | train |
v1 | Schema:
sales (alias: sale)(amount, status, salary, id)
employees(status, id, amount, code)
Task: Select name from sales where code exists in employees for the same status.
SQL: | SELECT name FROM sales AS sale
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16499 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.