variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v2 | Schema:
transactions (alias: txn)(status, value, level, amount)
customers(type, code, id, status)
Task: Retrieve amount from transactions that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15400 | train |
v3 | Schema:
customers (alias: cust)(id, name, date, salary)
transactions(type, salary, value, code)
Task: Retrieve id from customers with value above the MIN(amount) of transactions rows sharing the same status.
SQL: | SELECT id FROM customers AS cust
WHERE value > (
SELECT MIN(amount) FROM transactions AS txn
WHERE txn.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15401 | train |
v3 | Schema:
orders (alias: ord)(level, name, code, id)
managers(amount, salary, status, code)
Task: Find value from orders where value exceeds the average salary from managers for the same code.
SQL: | SELECT value FROM orders AS ord
WHERE value > (
SELECT AVG(salary) FROM managers AS mgr
WHERE mgr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15402 | train |
v3 | Schema:
transactions (alias: txn)(value, amount, salary, name)
requests(type, code, level, salary)
Task: Retrieve code from transactions with amount above the SUM(value) of requests rows sharing the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE amount > (
SELECT SUM(value) FROM requests AS ordr
WHERE ordr.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15403 | train |
v2 | Schema:
employees (alias: emp)(date, value, code, name)
branches(salary, id, type, value)
Task: Retrieve salary from employees that have at least one corresponding entry in branches sharing the same level.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15404 | train |
v1 | Schema:
accounts (alias: acct)(status, level, salary, amount)
tasks(status, date, salary, code)
Task: Find amount from accounts where level appears in tasks entries with matching level.
SQL: | SELECT amount FROM accounts AS acct
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15405 | train |
v2 | Schema:
tasks (alias: tsk)(name, level, date, code)
products(status, date, name, type)
Task: Retrieve amount from tasks that have at least one corresponding entry in products sharing the same status.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_15406 | train |
v3 | Schema:
sales (alias: sale)(type, level, value, salary)
items(code, id, type, amount)
Task: Find id from sales where salary exceeds the average amount from items for the same level.
SQL: | SELECT id FROM sales AS sale
WHERE salary > (
SELECT AVG(amount) FROM items AS lne
WHERE lne.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15407 | train |
v1 | Schema:
accounts (alias: acct)(amount, code, name, date)
products(level, amount, name, code)
Task: Select amount from accounts where level exists in products for the same level.
SQL: | SELECT amount FROM accounts AS acct
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15408 | train |
v1 | Schema:
branches (alias: brc)(name, salary, level, date)
regions(level, code, id, amount)
Task: Find name from branches where status appears in regions entries with matching id.
SQL: | SELECT name FROM branches AS brc
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_15409 | train |
v2 | Schema:
requests (alias: ordr)(value, name, type, amount)
branches(status, amount, level, id)
Task: Find name from requests where a matching record exists in branches with the same code.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_15410 | train |
v2 | Schema:
orders (alias: ord)(id, salary, status, value)
employees(code, amount, value, level)
Task: Retrieve salary from orders that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15411 | train |
v1 | Schema:
categories (alias: catg)(salary, name, amount, id)
regions(salary, amount, date, value)
Task: Retrieve code from categories whose id is found in regions rows where status matches the outer record.
SQL: | SELECT code FROM categories AS catg
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15412 | train |
v3 | Schema:
categories (alias: catg)(salary, status, level, type)
customers(level, salary, amount, type)
Task: Retrieve name from categories with amount above the MAX(value) of customers rows sharing the same type.
SQL: | SELECT name FROM categories AS catg
WHERE amount > (
SELECT MAX(value) FROM customers AS cust
WHERE cust.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15413 | train |
v3 | Schema:
products (alias: prod)(type, amount, id, date)
customers(name, id, salary, code)
Task: Retrieve salary from products with salary above the COUNT(value) of customers rows sharing the same code.
SQL: | SELECT salary FROM products AS prod
WHERE salary > (
SELECT COUNT(value) FROM customers AS cust
WHERE cust.code = prod.code
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15414 | train |
v1 | Schema:
staff (alias: empl)(name, type, salary, level)
customers(value, name, amount, salary)
Task: Select salary from staff where status exists in customers for the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15415 | train |
v1 | Schema:
sales (alias: sale)(date, salary, name, value)
tasks(salary, date, amount, name)
Task: Find id from sales where level appears in tasks entries with matching level.
SQL: | SELECT id FROM sales AS sale
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15416 | train |
v3 | Schema:
projects (alias: prj)(amount, id, code, value)
invoices(level, code, type, status)
Task: Retrieve name from projects with salary above the MIN(value) of invoices rows sharing the same type.
SQL: | SELECT name FROM projects AS prj
WHERE salary > (
SELECT MIN(value) FROM invoices AS inv
WHERE inv.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15417 | train |
v3 | Schema:
orders (alias: ord)(value, status, level, amount)
transactions(name, code, level, type)
Task: Find salary from orders where value exceeds the average amount from transactions for the same code.
SQL: | SELECT salary FROM orders AS ord
WHERE value > (
SELECT AVG(amount) FROM transactions AS txn
WHERE txn.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15418 | train |
v2 | Schema:
items (alias: lne)(value, id, code, name)
managers(status, code, date, name)
Task: Retrieve amount from items that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_15419 | train |
v3 | Schema:
invoices (alias: inv)(id, status, amount, salary)
customers(level, code, value, id)
Task: Retrieve amount from invoices with value above the COUNT(value) of customers rows sharing the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE value > (
SELECT COUNT(value) FROM customers AS cust
WHERE cust.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15420 | train |
v1 | Schema:
items (alias: lne)(id, status, code, amount)
orders(value, code, id, amount)
Task: Select name from items where type exists in orders for the same code.
SQL: | SELECT name FROM items AS lne
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.code = lne.code
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_15421 | train |
v1 | Schema:
schedules (alias: schd)(value, code, name, date)
tasks(value, level, name, code)
Task: Find id from schedules where id appears in tasks entries with matching code.
SQL: | SELECT id FROM schedules AS schd
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15422 | train |
v3 | Schema:
invoices (alias: inv)(level, date, amount, type)
branches(date, id, type, code)
Task: Retrieve id from invoices with amount above the COUNT(salary) of branches rows sharing the same code.
SQL: | SELECT id FROM invoices AS inv
WHERE amount > (
SELECT COUNT(salary) FROM branches AS brc
WHERE brc.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15423 | train |
v3 | Schema:
staff (alias: empl)(date, value, level, code)
shipments(level, name, id, type)
Task: Find code from staff where salary exceeds the maximum value from shipments for the same code.
SQL: | SELECT code FROM staff AS empl
WHERE salary > (
SELECT MAX(value) FROM shipments AS shp
WHERE shp.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15424 | train |
v3 | Schema:
invoices (alias: inv)(salary, name, code, type)
branches(name, status, salary, id)
Task: Retrieve value from invoices with salary above the AVG(salary) of branches rows sharing the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE salary > (
SELECT AVG(salary) FROM branches AS brc
WHERE brc.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15425 | train |
v1 | Schema:
requests (alias: ordr)(date, value, status, type)
transactions(value, id, code, amount)
Task: Select amount from requests where id exists in transactions for the same status.
SQL: | SELECT amount FROM requests AS ordr
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_15426 | train |
v3 | Schema:
regions (alias: rgn)(salary, type, name, value)
employees(name, id, code, salary)
Task: Retrieve amount from regions with value above the SUM(salary) of employees rows sharing the same status.
SQL: | SELECT amount FROM regions AS rgn
WHERE value > (
SELECT SUM(salary) FROM employees AS emp
WHERE emp.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_15427 | train |
v2 | Schema:
categories (alias: catg)(code, status, value, salary)
requests(id, amount, date, level)
Task: Retrieve name from categories that have at least one corresponding entry in requests sharing the same id.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15428 | train |
v1 | Schema:
tasks (alias: tsk)(value, level, salary, status)
managers(name, type, code, level)
Task: Find code from tasks where type appears in managers entries with matching level.
SQL: | SELECT code FROM tasks AS tsk
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_15429 | train |
v3 | Schema:
sales (alias: sale)(type, level, id, name)
requests(status, code, id, name)
Task: Find salary from sales where value exceeds the average amount from requests for the same id.
SQL: | SELECT salary FROM sales AS sale
WHERE value > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15430 | train |
v2 | Schema:
transactions (alias: txn)(status, salary, id, name)
items(status, id, amount, level)
Task: Find value from transactions where a matching record exists in items with the same code.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15431 | train |
v1 | Schema:
shipments (alias: shp)(name, value, date, type)
regions(value, type, level, status)
Task: Select code from shipments where code exists in regions for the same code.
SQL: | SELECT code FROM shipments AS shp
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15432 | train |
v1 | Schema:
departments (alias: dept)(value, status, type, code)
staff(amount, name, id, date)
Task: Find code from departments where id appears in staff entries with matching level.
SQL: | SELECT code FROM departments AS dept
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15433 | train |
v3 | Schema:
invoices (alias: inv)(value, amount, salary, id)
items(value, code, status, name)
Task: Retrieve amount from invoices with value above the MAX(value) of items rows sharing the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE value > (
SELECT MAX(value) FROM items AS lne
WHERE lne.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15434 | train |
v1 | Schema:
departments (alias: dept)(value, code, level, type)
tasks(status, type, id, salary)
Task: Find amount from departments where code appears in tasks entries with matching level.
SQL: | SELECT amount FROM departments AS dept
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15435 | train |
v2 | Schema:
items (alias: lne)(status, salary, code, type)
accounts(salary, date, id, value)
Task: Retrieve name from items that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = lne.level
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_15436 | train |
v1 | Schema:
requests (alias: ordr)(level, name, date, amount)
items(value, type, level, name)
Task: Select name from requests where id exists in items for the same level.
SQL: | SELECT name FROM requests AS ordr
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_15437 | train |
v1 | Schema:
schedules (alias: schd)(amount, type, status, name)
accounts(level, salary, status, code)
Task: Find code from schedules where id appears in accounts entries with matching status.
SQL: | SELECT code FROM schedules AS schd
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15438 | train |
v2 | Schema:
tasks (alias: tsk)(id, level, date, code)
products(status, level, value, salary)
Task: Retrieve code from tasks that have at least one corresponding entry in products sharing the same status.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_15439 | train |
v3 | Schema:
branches (alias: brc)(code, level, id, salary)
categories(code, id, name, amount)
Task: Find salary from branches where value exceeds the minimum amount from categories for the same id.
SQL: | SELECT salary FROM branches AS brc
WHERE value > (
SELECT MIN(amount) FROM categories AS catg
WHERE catg.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_15440 | train |
v2 | Schema:
items (alias: lne)(name, value, id, salary)
staff(code, type, name, value)
Task: Find name from items where a matching record exists in staff with the same id.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = lne.id
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_15441 | train |
v1 | Schema:
employees (alias: emp)(amount, name, salary, id)
accounts(value, code, name, id)
Task: Retrieve id from employees whose status is found in accounts rows where code matches the outer record.
SQL: | SELECT id FROM employees AS emp
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15442 | train |
v3 | Schema:
requests (alias: ordr)(amount, id, name, status)
transactions(amount, status, type, id)
Task: Retrieve id from requests with salary above the COUNT(salary) of transactions rows sharing the same type.
SQL: | SELECT id FROM requests AS ordr
WHERE salary > (
SELECT COUNT(salary) FROM transactions AS txn
WHERE txn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_15443 | train |
v2 | Schema:
staff (alias: empl)(status, date, level, code)
transactions(date, code, salary, value)
Task: Retrieve amount from staff that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15444 | train |
v3 | Schema:
departments (alias: dept)(status, date, salary, type)
accounts(level, type, name, id)
Task: Find salary from departments where amount exceeds the count of amount from accounts for the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE amount > (
SELECT COUNT(amount) FROM accounts AS acct
WHERE acct.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15445 | train |
v3 | Schema:
accounts (alias: acct)(code, name, value, salary)
branches(name, level, salary, id)
Task: Find code from accounts where amount exceeds the maximum value from branches for the same id.
SQL: | SELECT code FROM accounts AS acct
WHERE amount > (
SELECT MAX(value) FROM branches AS brc
WHERE brc.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15446 | train |
v3 | Schema:
orders (alias: ord)(salary, code, status, amount)
transactions(salary, status, date, amount)
Task: Retrieve code from orders with value above the COUNT(amount) of transactions rows sharing the same status.
SQL: | SELECT code FROM orders AS ord
WHERE value > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15447 | train |
v3 | Schema:
shipments (alias: shp)(date, id, value, salary)
tasks(status, level, amount, name)
Task: Find name from shipments where value exceeds the average salary from tasks for the same level.
SQL: | SELECT name FROM shipments AS shp
WHERE value > (
SELECT AVG(salary) FROM tasks AS tsk
WHERE tsk.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15448 | train |
v2 | Schema:
products (alias: prod)(code, name, level, id)
categories(type, amount, level, code)
Task: Find amount from products where a matching record exists in categories with the same id.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = prod.id
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15449 | train |
v2 | Schema:
sales (alias: sale)(id, code, amount, level)
employees(level, status, salary, type)
Task: Retrieve amount from sales that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15450 | train |
v3 | Schema:
customers (alias: cust)(id, amount, salary, name)
transactions(date, level, id, name)
Task: Retrieve amount from customers with amount above the AVG(amount) of transactions rows sharing the same type.
SQL: | SELECT amount FROM customers AS cust
WHERE amount > (
SELECT AVG(amount) FROM transactions AS txn
WHERE txn.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15451 | train |
v3 | Schema:
shipments (alias: shp)(code, level, id, date)
schedules(type, amount, code, id)
Task: Retrieve salary from shipments with amount above the AVG(value) of schedules rows sharing the same id.
SQL: | SELECT salary FROM shipments AS shp
WHERE amount > (
SELECT AVG(value) FROM schedules AS schd
WHERE schd.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15452 | train |
v2 | Schema:
customers (alias: cust)(value, name, amount, date)
regions(name, salary, id, value)
Task: Find id from customers where a matching record exists in regions with the same level.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15453 | train |
v2 | Schema:
invoices (alias: inv)(date, level, code, salary)
managers(salary, date, id, amount)
Task: Retrieve code from invoices that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT code 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": "code",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15454 | train |
v1 | Schema:
invoices (alias: inv)(id, code, level, amount)
branches(amount, date, name, level)
Task: Retrieve amount from invoices whose type is found in branches rows where id matches the outer record.
SQL: | SELECT amount FROM invoices AS inv
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15455 | train |
v3 | Schema:
items (alias: lne)(level, date, type, amount)
transactions(salary, status, name, type)
Task: Retrieve id from items with amount above the MIN(salary) of transactions rows sharing the same status.
SQL: | SELECT id FROM items AS lne
WHERE amount > (
SELECT MIN(salary) FROM transactions AS txn
WHERE txn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_15456 | train |
v2 | Schema:
staff (alias: empl)(name, amount, status, value)
departments(salary, level, value, code)
Task: Find name from staff where a matching record exists in departments with the same code.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15457 | train |
v2 | Schema:
regions (alias: rgn)(id, amount, status, type)
categories(name, code, status, level)
Task: Retrieve amount from regions that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_15458 | train |
v2 | Schema:
staff (alias: empl)(amount, value, type, code)
managers(amount, name, value, type)
Task: Find amount from staff where a matching record exists in managers with the same type.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15459 | train |
v2 | Schema:
products (alias: prod)(level, date, status, id)
requests(level, salary, name, amount)
Task: Retrieve value from products that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = prod.code
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15460 | train |
v2 | Schema:
schedules (alias: schd)(type, amount, name, salary)
accounts(type, salary, date, id)
Task: Retrieve code from schedules that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15461 | train |
v1 | Schema:
tasks (alias: tsk)(salary, code, value, level)
shipments(status, code, date, type)
Task: Retrieve code from tasks whose id is found in shipments rows where type matches the outer record.
SQL: | SELECT code FROM tasks AS tsk
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_15462 | train |
v1 | Schema:
projects (alias: prj)(value, name, code, level)
tasks(id, level, name, date)
Task: Select salary from projects where code exists in tasks for the same id.
SQL: | SELECT salary FROM projects AS prj
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "prj",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15463 | train |
v2 | Schema:
transactions (alias: txn)(name, date, salary, amount)
departments(name, date, status, level)
Task: Retrieve salary from transactions that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15464 | train |
v3 | Schema:
shipments (alias: shp)(name, type, level, status)
orders(type, name, status, value)
Task: Retrieve code from shipments with value above the SUM(amount) of orders rows sharing the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE value > (
SELECT SUM(amount) FROM orders AS ord
WHERE ord.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15465 | train |
v1 | Schema:
projects (alias: prj)(id, amount, date, status)
accounts(date, value, name, status)
Task: Retrieve code from projects whose type is found in accounts rows where id matches the outer record.
SQL: | SELECT code FROM projects AS prj
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15466 | train |
v2 | Schema:
managers (alias: mgr)(name, amount, id, status)
regions(code, date, name, id)
Task: Find name from managers where a matching record exists in regions with the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15467 | train |
v3 | Schema:
shipments (alias: shp)(salary, name, type, value)
requests(code, value, type, date)
Task: Find amount from shipments where salary exceeds the total value from requests for the same level.
SQL: | SELECT amount FROM shipments AS shp
WHERE salary > (
SELECT SUM(value) FROM requests AS ordr
WHERE ordr.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15468 | train |
v2 | Schema:
branches (alias: brc)(name, status, salary, level)
requests(status, date, id, amount)
Task: Find name from branches where a matching record exists in requests with the same id.
SQL: | SELECT name FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_15469 | train |
v2 | Schema:
invoices (alias: inv)(date, code, salary, id)
staff(amount, salary, type, id)
Task: Retrieve value from invoices that have at least one corresponding entry in staff sharing the same level.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15470 | train |
v1 | Schema:
departments (alias: dept)(status, value, type, date)
projects(name, date, level, code)
Task: Select amount from departments where code exists in projects for the same level.
SQL: | SELECT amount FROM departments AS dept
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15471 | train |
v2 | Schema:
requests (alias: ordr)(type, level, salary, amount)
customers(code, amount, value, type)
Task: Find id from requests where a matching record exists in customers with the same level.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_15472 | train |
v1 | Schema:
schedules (alias: schd)(amount, status, value, name)
staff(name, salary, status, date)
Task: Select salary from schedules where code exists in staff for the same level.
SQL: | SELECT salary FROM schedules AS schd
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15473 | train |
v1 | Schema:
managers (alias: mgr)(salary, value, level, type)
employees(value, type, name, code)
Task: Find id from managers where status appears in employees entries with matching status.
SQL: | SELECT id FROM managers AS mgr
WHERE status IN (
SELECT status 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": "status",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15474 | train |
v3 | Schema:
items (alias: lne)(status, level, salary, name)
branches(value, code, level, name)
Task: Find value from items where salary exceeds the average salary from branches for the same id.
SQL: | SELECT value FROM items AS lne
WHERE salary > (
SELECT AVG(salary) FROM branches AS brc
WHERE brc.id = lne.id
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_15475 | train |
v2 | Schema:
categories (alias: catg)(date, name, type, code)
regions(name, status, level, id)
Task: Find name from categories where a matching record exists in regions with the same type.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15476 | train |
v3 | Schema:
transactions (alias: txn)(date, name, value, level)
accounts(name, id, status, salary)
Task: Find name from transactions where amount exceeds the total salary from accounts for the same level.
SQL: | SELECT name FROM transactions AS txn
WHERE amount > (
SELECT SUM(salary) FROM accounts AS acct
WHERE acct.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "name",
"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_15477 | train |
v3 | Schema:
transactions (alias: txn)(value, date, status, level)
invoices(status, salary, date, code)
Task: Find id from transactions where salary exceeds the average amount from invoices for the same id.
SQL: | SELECT id FROM transactions AS txn
WHERE salary > (
SELECT AVG(amount) FROM invoices AS inv
WHERE inv.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15478 | train |
v2 | Schema:
schedules (alias: schd)(id, salary, level, name)
categories(id, salary, value, name)
Task: Find amount from schedules where a matching record exists in categories with the same level.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15479 | train |
v3 | Schema:
regions (alias: rgn)(date, name, value, amount)
projects(date, value, id, name)
Task: Retrieve salary from regions with salary above the AVG(amount) of projects rows sharing the same level.
SQL: | SELECT salary FROM regions AS rgn
WHERE salary > (
SELECT AVG(amount) FROM projects AS prj
WHERE prj.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_15480 | train |
v1 | Schema:
transactions (alias: txn)(amount, level, status, id)
items(id, name, level, status)
Task: Find salary from transactions where code appears in items entries with matching status.
SQL: | SELECT salary FROM transactions AS txn
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15481 | train |
v2 | Schema:
transactions (alias: txn)(amount, level, name, value)
orders(level, code, name, value)
Task: Find name from transactions where a matching record exists in orders with the same level.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15482 | train |
v2 | Schema:
tasks (alias: tsk)(value, id, name, level)
categories(level, amount, date, value)
Task: Retrieve id from tasks that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_15483 | train |
v2 | Schema:
branches (alias: brc)(level, name, type, value)
employees(salary, amount, type, value)
Task: Find id from branches where a matching record exists in employees with the same code.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_15484 | train |
v1 | Schema:
schedules (alias: schd)(status, date, type, id)
invoices(date, value, id, status)
Task: Select name from schedules where code exists in invoices for the same level.
SQL: | SELECT name FROM schedules AS schd
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15485 | train |
v2 | Schema:
items (alias: lne)(value, type, code, status)
branches(date, amount, name, salary)
Task: Retrieve amount from items that have at least one corresponding entry in branches sharing the same code.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = lne.code
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_15486 | train |
v3 | Schema:
accounts (alias: acct)(type, amount, name, code)
transactions(date, id, name, level)
Task: Retrieve name from accounts with amount above the SUM(amount) of transactions rows sharing the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE amount > (
SELECT SUM(amount) FROM transactions AS txn
WHERE txn.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15487 | train |
v2 | Schema:
staff (alias: empl)(salary, type, amount, value)
transactions(code, salary, level, id)
Task: Retrieve salary from staff that have at least one corresponding entry in transactions sharing the same type.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15488 | train |
v3 | Schema:
sales (alias: sale)(level, code, salary, value)
orders(salary, date, status, name)
Task: Find value from sales where value exceeds the average amount from orders for the same status.
SQL: | SELECT value FROM sales AS sale
WHERE value > (
SELECT AVG(amount) FROM orders AS ord
WHERE ord.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15489 | train |
v2 | Schema:
accounts (alias: acct)(date, name, salary, level)
categories(status, id, amount, value)
Task: Find name from accounts where a matching record exists in categories with the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15490 | train |
v2 | Schema:
employees (alias: emp)(type, code, id, amount)
customers(code, id, type, level)
Task: Find name from employees where a matching record exists in customers with the same code.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15491 | train |
v1 | Schema:
regions (alias: rgn)(amount, status, date, code)
items(code, id, amount, type)
Task: Retrieve name from regions whose level is found in items rows where level matches the outer record.
SQL: | SELECT name FROM regions AS rgn
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_15492 | train |
v2 | Schema:
projects (alias: prj)(id, code, amount, status)
categories(date, amount, code, value)
Task: Retrieve value from projects that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15493 | train |
v2 | Schema:
staff (alias: empl)(code, type, status, name)
accounts(type, level, date, value)
Task: Retrieve amount from staff that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15494 | train |
v3 | Schema:
customers (alias: cust)(salary, value, level, amount)
departments(name, status, salary, amount)
Task: Retrieve name from customers with amount above the COUNT(amount) of departments rows sharing the same id.
SQL: | SELECT name FROM customers AS cust
WHERE amount > (
SELECT COUNT(amount) FROM departments AS dept
WHERE dept.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15495 | train |
v2 | Schema:
invoices (alias: inv)(value, amount, code, name)
shipments(level, code, salary, type)
Task: Find value from invoices where a matching record exists in shipments with the same level.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15496 | train |
v2 | Schema:
shipments (alias: shp)(date, value, type, amount)
schedules(value, status, type, amount)
Task: Retrieve salary from shipments that have at least one corresponding entry in schedules sharing the same level.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15497 | train |
v1 | Schema:
accounts (alias: acct)(level, value, type, amount)
staff(level, date, amount, name)
Task: Select value from accounts where level exists in staff for the same code.
SQL: | SELECT value FROM accounts AS acct
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15498 | train |
v1 | Schema:
orders (alias: ord)(code, salary, status, value)
departments(type, id, date, name)
Task: Find name from orders where type appears in departments entries with matching level.
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_15499 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.