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 |
|---|---|---|---|---|---|---|
v3 | Schema:
items (alias: lne)(value, code, level, id)
customers(name, amount, level, salary)
Task: Retrieve salary from items with value above the COUNT(value) of customers rows sharing the same level.
SQL: | SELECT salary FROM items AS lne
WHERE value > (
SELECT COUNT(value) FROM customers AS cust
WHERE cust.level = lne.level
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11700 | train |
v3 | Schema:
projects (alias: prj)(value, date, level, type)
categories(amount, name, value, level)
Task: Retrieve id from projects with salary above the MIN(amount) of categories rows sharing the same type.
SQL: | SELECT id FROM projects AS prj
WHERE salary > (
SELECT MIN(amount) FROM categories AS catg
WHERE catg.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11701 | train |
v3 | Schema:
departments (alias: dept)(name, date, id, level)
accounts(id, type, code, date)
Task: Find code from departments where value exceeds the average amount from accounts for the same level.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT AVG(amount) FROM accounts AS acct
WHERE acct.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11702 | train |
v1 | Schema:
accounts (alias: acct)(amount, salary, name, id)
orders(date, type, level, name)
Task: Select value from accounts where id exists in orders for the same status.
SQL: | SELECT value FROM accounts AS acct
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11703 | train |
v1 | Schema:
employees (alias: emp)(value, code, date, status)
staff(name, date, id, amount)
Task: Select code from employees where level exists in staff for the same code.
SQL: | SELECT code FROM employees AS emp
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11704 | train |
v1 | Schema:
sales (alias: sale)(salary, date, level, type)
transactions(name, date, status, id)
Task: Select amount from sales where type exists in transactions for the same status.
SQL: | SELECT amount FROM sales AS sale
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11705 | train |
v3 | Schema:
products (alias: prod)(code, level, amount, value)
invoices(salary, level, type, name)
Task: Find salary from products where salary exceeds the maximum amount from invoices for the same code.
SQL: | SELECT salary FROM products AS prod
WHERE salary > (
SELECT MAX(amount) FROM invoices AS inv
WHERE inv.code = prod.code
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11706 | train |
v3 | Schema:
employees (alias: emp)(value, salary, name, id)
orders(id, amount, salary, level)
Task: Find value from employees where value exceeds the minimum value from orders for the same status.
SQL: | SELECT value FROM employees AS emp
WHERE value > (
SELECT MIN(value) FROM orders AS ord
WHERE ord.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11707 | train |
v2 | Schema:
items (alias: lne)(value, amount, status, date)
transactions(id, salary, value, type)
Task: Find value from items where a matching record exists in transactions with 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_11708 | train |
v2 | Schema:
regions (alias: rgn)(amount, value, id, status)
branches(value, date, status, salary)
Task: Retrieve amount from regions that have at least one corresponding entry in branches sharing the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11709 | train |
v3 | Schema:
sales (alias: sale)(salary, id, level, amount)
employees(name, salary, id, date)
Task: Retrieve amount from sales with value above the COUNT(value) of employees rows sharing the same status.
SQL: | SELECT amount FROM sales AS sale
WHERE value > (
SELECT COUNT(value) FROM employees AS emp
WHERE emp.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11710 | train |
v1 | Schema:
sales (alias: sale)(type, value, name, status)
requests(level, amount, code, date)
Task: Select amount from sales where id exists in requests for the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11711 | train |
v3 | Schema:
tasks (alias: tsk)(salary, date, amount, id)
items(type, code, status, level)
Task: Retrieve amount from tasks with value above the COUNT(value) of items rows sharing the same status.
SQL: | SELECT amount FROM tasks AS tsk
WHERE value > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "items",
"outer_alias": "tsk",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11712 | train |
v1 | Schema:
items (alias: lne)(code, salary, amount, value)
accounts(level, amount, id, name)
Task: Select salary from items where status exists in accounts for the same id.
SQL: | SELECT salary FROM items AS lne
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.id = lne.id
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11713 | train |
v1 | Schema:
invoices (alias: inv)(type, status, date, salary)
managers(value, name, date, salary)
Task: Select value from invoices where level exists in managers for the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11714 | train |
v2 | Schema:
branches (alias: brc)(level, code, id, type)
requests(level, salary, amount, type)
Task: Retrieve amount from branches that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11715 | train |
v2 | Schema:
staff (alias: empl)(status, name, level, id)
departments(level, date, name, id)
Task: Retrieve amount from staff that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11716 | train |
v3 | Schema:
regions (alias: rgn)(code, value, date, amount)
items(status, id, amount, date)
Task: Retrieve name from regions with amount above the AVG(amount) of items rows sharing the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE amount > (
SELECT AVG(amount) FROM items AS lne
WHERE lne.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11717 | train |
v1 | Schema:
accounts (alias: acct)(value, status, name, type)
invoices(type, name, salary, value)
Task: Retrieve value from accounts whose level is found in invoices rows where id matches the outer record.
SQL: | SELECT value FROM accounts AS acct
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11718 | train |
v1 | Schema:
orders (alias: ord)(salary, value, date, amount)
employees(name, code, amount, salary)
Task: Select name from orders where status exists in employees for the same type.
SQL: | SELECT name FROM orders AS ord
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11719 | train |
v3 | Schema:
categories (alias: catg)(name, salary, type, status)
accounts(level, name, status, date)
Task: Retrieve code from categories with value above the MIN(salary) of accounts rows sharing the same id.
SQL: | SELECT code FROM categories AS catg
WHERE value > (
SELECT MIN(salary) FROM accounts AS acct
WHERE acct.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11720 | train |
v2 | Schema:
tasks (alias: tsk)(level, id, name, date)
employees(salary, value, id, code)
Task: Find salary from tasks where a matching record exists in employees with the same type.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "tsk",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11721 | train |
v3 | Schema:
shipments (alias: shp)(status, name, id, amount)
departments(name, code, level, type)
Task: Find name from shipments where salary exceeds the minimum amount from departments for the same level.
SQL: | SELECT name FROM shipments AS shp
WHERE salary > (
SELECT MIN(amount) FROM departments AS dept
WHERE dept.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11722 | train |
v2 | Schema:
invoices (alias: inv)(status, name, id, code)
employees(amount, type, value, date)
Task: Retrieve value from invoices that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11723 | train |
v3 | Schema:
accounts (alias: acct)(salary, status, value, type)
employees(type, amount, code, status)
Task: Find name from accounts where salary exceeds the maximum salary from employees for the same level.
SQL: | SELECT name FROM accounts AS acct
WHERE salary > (
SELECT MAX(salary) FROM employees AS emp
WHERE emp.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11724 | train |
v1 | Schema:
items (alias: lne)(value, amount, status, date)
categories(salary, code, date, amount)
Task: Select salary from items where level exists in categories for the same id.
SQL: | SELECT salary FROM items AS lne
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.id = lne.id
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11725 | train |
v3 | Schema:
orders (alias: ord)(status, level, date, salary)
employees(code, salary, value, date)
Task: Retrieve code from orders with salary above the MIN(salary) of employees rows sharing the same status.
SQL: | SELECT code FROM orders AS ord
WHERE salary > (
SELECT MIN(salary) FROM employees AS emp
WHERE emp.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11726 | train |
v3 | Schema:
accounts (alias: acct)(date, status, level, code)
categories(type, name, value, level)
Task: Find name from accounts where value exceeds the average salary from categories for the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE value > (
SELECT AVG(salary) FROM categories AS catg
WHERE catg.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11727 | train |
v2 | Schema:
transactions (alias: txn)(date, type, id, status)
sales(value, name, date, level)
Task: Find salary from transactions where a matching record exists in sales with the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11728 | train |
v3 | Schema:
items (alias: lne)(level, date, amount, code)
shipments(status, code, value, salary)
Task: Find name from items where salary exceeds the maximum salary from shipments for the same level.
SQL: | SELECT name FROM items AS lne
WHERE salary > (
SELECT MAX(salary) FROM shipments AS shp
WHERE shp.level = lne.level
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11729 | train |
v3 | Schema:
items (alias: lne)(id, salary, value, type)
sales(value, salary, code, type)
Task: Retrieve value from items with amount above the MAX(amount) of sales rows sharing the same id.
SQL: | SELECT value FROM items AS lne
WHERE amount > (
SELECT MAX(amount) FROM sales AS sale
WHERE sale.id = lne.id
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11730 | train |
v2 | Schema:
projects (alias: prj)(type, status, code, level)
items(status, salary, type, id)
Task: Retrieve id from projects that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11731 | train |
v3 | Schema:
staff (alias: empl)(amount, salary, type, date)
requests(salary, type, status, id)
Task: Retrieve id from staff with salary above the AVG(value) of requests rows sharing the same code.
SQL: | SELECT id FROM staff AS empl
WHERE salary > (
SELECT AVG(value) FROM requests AS ordr
WHERE ordr.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11732 | train |
v3 | Schema:
regions (alias: rgn)(type, salary, status, level)
items(status, code, salary, value)
Task: Retrieve amount from regions with salary above the SUM(amount) of items rows sharing the same level.
SQL: | SELECT amount FROM regions AS rgn
WHERE salary > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11733 | train |
v3 | Schema:
projects (alias: prj)(status, value, type, id)
tasks(amount, value, salary, status)
Task: Find name from projects where value exceeds the maximum salary from tasks for the same code.
SQL: | SELECT name FROM projects AS prj
WHERE value > (
SELECT MAX(salary) FROM tasks AS tsk
WHERE tsk.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "prj",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11734 | train |
v1 | Schema:
regions (alias: rgn)(type, amount, id, status)
staff(type, code, salary, amount)
Task: Select amount from regions where id exists in staff for the same id.
SQL: | SELECT amount FROM regions AS rgn
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11735 | train |
v1 | Schema:
accounts (alias: acct)(code, date, id, status)
sales(type, date, level, code)
Task: Retrieve salary from accounts whose type is found in sales rows where id matches the outer record.
SQL: | SELECT salary FROM accounts AS acct
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11736 | train |
v3 | Schema:
sales (alias: sale)(code, level, amount, id)
products(code, id, level, type)
Task: Find amount from sales where value exceeds the count of salary from products for the same code.
SQL: | SELECT amount FROM sales AS sale
WHERE value > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11737 | train |
v3 | Schema:
projects (alias: prj)(date, name, salary, code)
customers(date, name, code, value)
Task: Retrieve name from projects with value above the MIN(salary) of customers rows sharing the same status.
SQL: | SELECT name FROM projects AS prj
WHERE value > (
SELECT MIN(salary) FROM customers AS cust
WHERE cust.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "prj",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11738 | train |
v2 | Schema:
categories (alias: catg)(status, code, date, amount)
projects(amount, salary, code, type)
Task: Retrieve salary from categories that have at least one corresponding entry in projects sharing the same level.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11739 | train |
v3 | Schema:
shipments (alias: shp)(amount, level, status, id)
staff(id, salary, type, status)
Task: Retrieve salary from shipments with amount above the COUNT(salary) of staff rows sharing the same status.
SQL: | SELECT salary FROM shipments AS shp
WHERE amount > (
SELECT COUNT(salary) FROM staff AS empl
WHERE empl.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11740 | train |
v3 | Schema:
sales (alias: sale)(level, date, type, id)
transactions(salary, date, id, amount)
Task: Find code from sales where value exceeds the total value from transactions for the same code.
SQL: | SELECT code FROM sales AS sale
WHERE value > (
SELECT SUM(value) FROM transactions AS txn
WHERE txn.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11741 | train |
v1 | Schema:
sales (alias: sale)(code, type, name, status)
managers(value, type, name, status)
Task: Select amount from sales where level exists in managers for the same id.
SQL: | SELECT amount FROM sales AS sale
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11742 | train |
v1 | Schema:
departments (alias: dept)(id, salary, date, amount)
items(level, type, name, amount)
Task: Retrieve salary from departments whose code is found in items rows where type matches the outer record.
SQL: | SELECT salary FROM departments AS dept
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11743 | train |
v2 | Schema:
orders (alias: ord)(type, level, id, salary)
managers(code, value, level, salary)
Task: Find amount from orders where a matching record exists in managers with the same code.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11744 | train |
v2 | Schema:
accounts (alias: acct)(code, value, level, date)
requests(value, amount, date, status)
Task: Find name from accounts where a matching record exists in requests with the same status.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11745 | train |
v1 | Schema:
regions (alias: rgn)(salary, code, level, amount)
orders(value, level, status, type)
Task: Select id from regions where code exists in orders for the same status.
SQL: | SELECT id FROM regions AS rgn
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11746 | train |
v1 | Schema:
orders (alias: ord)(name, code, status, level)
items(value, name, level, date)
Task: Select amount from orders where type exists in items for the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11747 | train |
v2 | Schema:
accounts (alias: acct)(salary, amount, code, id)
managers(value, amount, salary, type)
Task: Find amount from accounts where a matching record exists in managers with the same status.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11748 | train |
v2 | Schema:
regions (alias: rgn)(id, code, salary, status)
categories(code, id, name, type)
Task: Retrieve code from regions that have at least one corresponding entry in categories sharing the same level.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11749 | train |
v1 | Schema:
employees (alias: emp)(name, status, level, type)
managers(level, id, type, code)
Task: Retrieve value from employees whose type is found in managers rows where id matches the outer record.
SQL: | SELECT value FROM employees AS emp
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11750 | train |
v1 | Schema:
tasks (alias: tsk)(salary, status, amount, id)
items(level, salary, name, type)
Task: Find code from tasks where code appears in items entries with matching type.
SQL: | SELECT code FROM tasks AS tsk
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "items",
"outer_alias": "tsk",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11751 | train |
v1 | Schema:
departments (alias: dept)(date, id, value, salary)
regions(status, name, date, value)
Task: Retrieve value from departments whose code is found in regions rows where status matches the outer record.
SQL: | SELECT value FROM departments AS dept
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11752 | train |
v1 | Schema:
managers (alias: mgr)(salary, type, date, id)
invoices(level, id, status, amount)
Task: Find salary from managers where code appears in invoices entries with matching type.
SQL: | SELECT salary FROM managers AS mgr
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11753 | train |
v3 | Schema:
managers (alias: mgr)(amount, id, type, salary)
items(level, value, salary, amount)
Task: Retrieve salary from managers with value above the AVG(amount) of items rows sharing the same id.
SQL: | SELECT salary FROM managers AS mgr
WHERE value > (
SELECT AVG(amount) FROM items AS lne
WHERE lne.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11754 | train |
v1 | Schema:
customers (alias: cust)(level, id, salary, status)
invoices(level, status, date, code)
Task: Retrieve salary from customers whose status is found in invoices rows where id matches the outer record.
SQL: | SELECT salary FROM customers AS cust
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11755 | train |
v2 | Schema:
customers (alias: cust)(code, amount, salary, date)
shipments(value, name, salary, code)
Task: Retrieve name from customers that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11756 | train |
v1 | Schema:
items (alias: lne)(name, level, code, id)
departments(date, code, amount, type)
Task: Find id from items where id appears in departments entries with matching level.
SQL: | SELECT id FROM items AS lne
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.level = lne.level
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11757 | train |
v1 | Schema:
requests (alias: ordr)(code, date, value, type)
employees(status, amount, name, code)
Task: Retrieve salary from requests whose level is found in employees rows where code matches the outer record.
SQL: | SELECT salary FROM requests AS ordr
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11758 | train |
v1 | Schema:
departments (alias: dept)(level, type, date, code)
accounts(amount, salary, id, name)
Task: Find name from departments where id appears in accounts entries with matching type.
SQL: | SELECT name FROM departments AS dept
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11759 | train |
v2 | Schema:
shipments (alias: shp)(value, amount, name, date)
employees(id, salary, value, status)
Task: Find amount from shipments where a matching record exists in employees with the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11760 | train |
v3 | Schema:
departments (alias: dept)(amount, level, code, id)
schedules(type, status, date, id)
Task: Find name from departments where value exceeds the maximum amount from schedules for the same status.
SQL: | SELECT name FROM departments AS dept
WHERE value > (
SELECT MAX(amount) FROM schedules AS schd
WHERE schd.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11761 | train |
v3 | Schema:
regions (alias: rgn)(amount, name, code, salary)
categories(salary, status, level, amount)
Task: Retrieve amount from regions with amount above the COUNT(value) of categories rows sharing the same id.
SQL: | SELECT amount FROM regions AS rgn
WHERE amount > (
SELECT COUNT(value) FROM categories AS catg
WHERE catg.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11762 | train |
v3 | Schema:
regions (alias: rgn)(salary, value, status, name)
shipments(name, amount, date, salary)
Task: Retrieve id from regions with amount above the MAX(value) of shipments rows sharing the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE amount > (
SELECT MAX(value) FROM shipments AS shp
WHERE shp.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11763 | train |
v1 | Schema:
departments (alias: dept)(type, amount, id, code)
requests(id, level, status, amount)
Task: Retrieve code from departments whose status is found in requests rows where code matches the outer record.
SQL: | SELECT code FROM departments AS dept
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11764 | train |
v3 | Schema:
schedules (alias: schd)(status, code, level, id)
staff(value, status, amount, code)
Task: Retrieve name from schedules with salary above the AVG(salary) of staff rows sharing the same level.
SQL: | SELECT name FROM schedules AS schd
WHERE salary > (
SELECT AVG(salary) FROM staff AS empl
WHERE empl.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11765 | train |
v3 | Schema:
branches (alias: brc)(amount, type, code, salary)
shipments(level, type, name, id)
Task: Retrieve id from branches with value above the AVG(amount) of shipments rows sharing the same level.
SQL: | SELECT id FROM branches AS brc
WHERE value > (
SELECT AVG(amount) FROM shipments AS shp
WHERE shp.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11766 | train |
v3 | Schema:
departments (alias: dept)(status, type, level, amount)
branches(value, amount, status, salary)
Task: Find value from departments where value exceeds the maximum value from branches for the same code.
SQL: | SELECT value FROM departments AS dept
WHERE value > (
SELECT MAX(value) FROM branches AS brc
WHERE brc.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11767 | train |
v1 | Schema:
departments (alias: dept)(type, salary, value, code)
staff(code, status, amount, name)
Task: Retrieve salary from departments whose type is found in staff rows where id matches the outer record.
SQL: | SELECT salary FROM departments AS dept
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11768 | train |
v2 | Schema:
staff (alias: empl)(amount, type, level, id)
schedules(value, salary, amount, date)
Task: Find salary from staff where a matching record exists in schedules with the same id.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11769 | train |
v3 | Schema:
projects (alias: prj)(code, id, value, status)
regions(date, name, code, type)
Task: Retrieve name from projects with value above the COUNT(value) of regions rows sharing the same type.
SQL: | SELECT name FROM projects AS prj
WHERE value > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11770 | train |
v1 | Schema:
schedules (alias: schd)(date, type, amount, code)
tasks(level, salary, id, code)
Task: Select id from schedules where type exists in tasks for the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11771 | train |
v3 | Schema:
shipments (alias: shp)(value, status, id, level)
staff(salary, level, code, type)
Task: Retrieve amount from shipments with amount above the AVG(value) of staff rows sharing the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE amount > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "amount",
"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_11772 | train |
v2 | Schema:
departments (alias: dept)(name, date, type, amount)
customers(level, id, status, code)
Task: Find salary from departments where a matching record exists in customers with the same level.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11773 | train |
v2 | Schema:
items (alias: lne)(name, code, date, value)
orders(code, salary, type, name)
Task: Retrieve amount from items that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = lne.type
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11774 | train |
v1 | Schema:
accounts (alias: acct)(code, salary, date, value)
items(status, type, salary, value)
Task: Select amount from accounts where id exists in items for the same status.
SQL: | SELECT amount FROM accounts AS acct
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11775 | train |
v2 | Schema:
transactions (alias: txn)(status, amount, date, id)
accounts(salary, level, value, date)
Task: Find salary from transactions where a matching record exists in accounts with the same type.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11776 | train |
v1 | Schema:
employees (alias: emp)(name, type, amount, date)
products(status, value, level, date)
Task: Select value from employees where level exists in products for the same status.
SQL: | SELECT value FROM employees AS emp
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11777 | train |
v1 | Schema:
branches (alias: brc)(code, amount, type, status)
invoices(status, type, level, salary)
Task: Retrieve name from branches whose type is found in invoices rows where code matches the outer record.
SQL: | SELECT name FROM branches AS brc
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11778 | train |
v1 | Schema:
invoices (alias: inv)(amount, status, id, name)
transactions(id, status, code, level)
Task: Retrieve value from invoices whose type is found in transactions rows where id matches the outer record.
SQL: | SELECT value FROM invoices AS inv
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11779 | train |
v2 | Schema:
staff (alias: empl)(name, date, code, status)
employees(salary, id, name, type)
Task: Find salary from staff where a matching record exists in employees with the same id.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11780 | train |
v3 | Schema:
projects (alias: prj)(value, status, id, salary)
invoices(code, value, status, name)
Task: Find name from projects where amount exceeds the minimum amount from invoices for the same code.
SQL: | SELECT name FROM projects AS prj
WHERE amount > (
SELECT MIN(amount) FROM invoices AS inv
WHERE inv.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11781 | train |
v1 | Schema:
transactions (alias: txn)(name, status, amount, value)
accounts(type, amount, id, salary)
Task: Select code from transactions where level exists in accounts for the same id.
SQL: | SELECT code FROM transactions AS txn
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11782 | train |
v3 | Schema:
categories (alias: catg)(id, status, date, level)
items(type, amount, name, status)
Task: Retrieve name from categories with value above the MAX(salary) of items rows sharing the same type.
SQL: | SELECT name FROM categories AS catg
WHERE value > (
SELECT MAX(salary) FROM items AS lne
WHERE lne.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11783 | train |
v3 | Schema:
orders (alias: ord)(type, code, id, date)
customers(amount, id, value, salary)
Task: Retrieve amount from orders with salary above the AVG(value) of customers rows sharing the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE salary > (
SELECT AVG(value) FROM customers AS cust
WHERE cust.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11784 | train |
v2 | Schema:
transactions (alias: txn)(level, status, date, salary)
invoices(value, name, id, level)
Task: Retrieve id from transactions that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11785 | train |
v1 | Schema:
departments (alias: dept)(name, amount, value, level)
requests(name, salary, level, id)
Task: Find salary from departments where type appears in requests entries with matching id.
SQL: | SELECT salary FROM departments AS dept
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11786 | train |
v1 | Schema:
customers (alias: cust)(status, value, code, amount)
departments(type, name, level, salary)
Task: Retrieve id from customers whose level is found in departments rows where code matches the outer record.
SQL: | SELECT id FROM customers AS cust
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11787 | train |
v2 | Schema:
customers (alias: cust)(status, date, name, value)
shipments(name, value, type, id)
Task: Retrieve value from customers that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11788 | train |
v2 | Schema:
sales (alias: sale)(status, amount, date, salary)
branches(value, status, id, code)
Task: Retrieve name from sales that have at least one corresponding entry in branches sharing the same code.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "branches",
"outer_alias": "sale",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11789 | train |
v1 | Schema:
managers (alias: mgr)(salary, amount, level, date)
customers(salary, code, amount, status)
Task: Select name from managers where status exists in customers for the same type.
SQL: | SELECT name FROM managers AS mgr
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11790 | train |
v2 | Schema:
transactions (alias: txn)(level, salary, code, amount)
schedules(type, name, date, id)
Task: Retrieve id from transactions that have at least one corresponding entry in schedules sharing the same type.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11791 | train |
v3 | Schema:
projects (alias: prj)(code, status, name, type)
tasks(status, amount, name, type)
Task: Find id from projects where amount exceeds the total value from tasks for the same level.
SQL: | SELECT id FROM projects AS prj
WHERE amount > (
SELECT SUM(value) FROM tasks AS tsk
WHERE tsk.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "prj",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11792 | train |
v3 | Schema:
transactions (alias: txn)(date, salary, id, name)
schedules(name, level, date, id)
Task: Find id from transactions where salary exceeds the average value from schedules for the same code.
SQL: | SELECT id FROM transactions AS txn
WHERE salary > (
SELECT AVG(value) FROM schedules AS schd
WHERE schd.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11793 | train |
v2 | Schema:
shipments (alias: shp)(amount, date, salary, code)
accounts(type, id, name, amount)
Task: Find amount from shipments where a matching record exists in accounts with the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11794 | train |
v2 | Schema:
staff (alias: empl)(type, amount, value, level)
managers(type, level, value, status)
Task: Find amount from staff where a matching record exists in managers with the same level.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11795 | train |
v1 | Schema:
sales (alias: sale)(value, id, salary, date)
requests(value, status, date, code)
Task: Find salary from sales where type appears in requests entries with matching type.
SQL: | SELECT salary FROM sales AS sale
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11796 | train |
v3 | Schema:
projects (alias: prj)(date, type, name, value)
products(type, salary, id, name)
Task: Find salary from projects where salary exceeds the maximum salary from products for the same code.
SQL: | SELECT salary FROM projects AS prj
WHERE salary > (
SELECT MAX(salary) FROM products AS prod
WHERE prod.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11797 | train |
v1 | Schema:
items (alias: lne)(name, amount, type, level)
projects(level, status, salary, id)
Task: Retrieve name from items whose type is found in projects rows where type matches the outer record.
SQL: | SELECT name FROM items AS lne
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.type = lne.type
); | {
"outer_table": "items",
"inner_table": "projects",
"outer_alias": "lne",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11798 | train |
v3 | Schema:
customers (alias: cust)(name, type, level, code)
categories(salary, type, status, level)
Task: Retrieve id from customers with salary above the SUM(salary) of categories rows sharing the same code.
SQL: | SELECT id FROM customers AS cust
WHERE salary > (
SELECT SUM(salary) FROM categories AS catg
WHERE catg.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11799 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.