variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v1 | Schema:
transactions (alias: txn)(id, status, name, level)
products(amount, status, code, date)
Task: Retrieve value from transactions whose type is found in products rows where id matches the outer record.
SQL: | SELECT value FROM transactions AS txn
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16900 | train |
v3 | Schema:
departments (alias: dept)(name, salary, status, code)
tasks(id, name, date, value)
Task: Retrieve name from departments with value above the MAX(amount) of tasks rows sharing the same level.
SQL: | SELECT name FROM departments AS dept
WHERE value > (
SELECT MAX(amount) FROM tasks AS tsk
WHERE tsk.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16901 | train |
v3 | Schema:
orders (alias: ord)(level, id, value, code)
items(date, salary, amount, level)
Task: Retrieve code from orders with salary above the MAX(amount) of items rows sharing the same code.
SQL: | SELECT code FROM orders AS ord
WHERE salary > (
SELECT MAX(amount) FROM items AS lne
WHERE lne.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16902 | train |
v1 | Schema:
projects (alias: prj)(name, id, salary, code)
branches(code, status, amount, id)
Task: Find id from projects where code appears in branches entries with matching level.
SQL: | SELECT id FROM projects AS prj
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16903 | train |
v1 | Schema:
employees (alias: emp)(code, value, status, amount)
schedules(name, salary, value, code)
Task: Find value from employees where status appears in schedules entries with matching type.
SQL: | SELECT value FROM employees AS emp
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16904 | train |
v2 | Schema:
invoices (alias: inv)(value, code, date, amount)
tasks(status, value, level, code)
Task: Retrieve salary from invoices that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16905 | train |
v2 | Schema:
transactions (alias: txn)(type, level, salary, name)
managers(date, type, name, value)
Task: Retrieve salary from transactions that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16906 | train |
v1 | Schema:
invoices (alias: inv)(type, code, level, amount)
projects(status, name, salary, type)
Task: Retrieve id from invoices whose type is found in projects rows where status matches the outer record.
SQL: | SELECT id FROM invoices AS inv
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16907 | train |
v1 | Schema:
transactions (alias: txn)(status, date, salary, code)
items(type, value, salary, id)
Task: Find id from transactions where type appears in items entries with matching type.
SQL: | SELECT id FROM transactions AS txn
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16908 | train |
v1 | Schema:
customers (alias: cust)(salary, type, code, id)
projects(level, status, type, amount)
Task: Select salary from customers where type exists in projects for the same id.
SQL: | SELECT salary FROM customers AS cust
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16909 | train |
v3 | Schema:
requests (alias: ordr)(salary, level, date, amount)
tasks(id, status, name, amount)
Task: Find id from requests where amount exceeds the count of amount from tasks for the same type.
SQL: | SELECT id FROM requests AS ordr
WHERE amount > (
SELECT COUNT(amount) FROM tasks AS tsk
WHERE tsk.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16910 | train |
v3 | Schema:
orders (alias: ord)(level, code, status, value)
schedules(code, id, level, salary)
Task: Find name from orders where salary exceeds the total value from schedules for the same level.
SQL: | SELECT name FROM orders AS ord
WHERE salary > (
SELECT SUM(value) FROM schedules AS schd
WHERE schd.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16911 | train |
v3 | Schema:
products (alias: prod)(name, id, status, value)
requests(id, salary, value, code)
Task: Retrieve id from products with value above the COUNT(salary) of requests rows sharing the same level.
SQL: | SELECT id FROM products AS prod
WHERE value > (
SELECT COUNT(salary) FROM requests AS ordr
WHERE ordr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16912 | train |
v1 | Schema:
regions (alias: rgn)(type, salary, amount, date)
employees(level, code, value, status)
Task: Find name from regions where id appears in employees entries with matching id.
SQL: | SELECT name FROM regions AS rgn
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16913 | train |
v3 | Schema:
products (alias: prod)(salary, value, id, date)
branches(status, value, amount, date)
Task: Find id from products where amount exceeds the maximum salary from branches for the same type.
SQL: | SELECT id FROM products AS prod
WHERE amount > (
SELECT MAX(salary) FROM branches AS brc
WHERE brc.type = prod.type
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16914 | train |
v3 | Schema:
staff (alias: empl)(level, amount, name, salary)
managers(amount, type, code, id)
Task: Retrieve amount from staff with value above the MAX(amount) of managers rows sharing the same level.
SQL: | SELECT amount FROM staff AS empl
WHERE value > (
SELECT MAX(amount) FROM managers AS mgr
WHERE mgr.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16915 | train |
v3 | Schema:
requests (alias: ordr)(salary, status, code, date)
regions(date, value, level, amount)
Task: Find salary from requests where amount exceeds the count of value from regions for the same id.
SQL: | SELECT salary FROM requests AS ordr
WHERE amount > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16916 | train |
v3 | Schema:
requests (alias: ordr)(level, amount, code, value)
customers(name, type, id, salary)
Task: Find code from requests where value exceeds the count of amount from customers for the same type.
SQL: | SELECT code FROM requests AS ordr
WHERE value > (
SELECT COUNT(amount) FROM customers AS cust
WHERE cust.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16917 | train |
v3 | Schema:
accounts (alias: acct)(status, date, code, type)
requests(value, level, name, id)
Task: Retrieve value from accounts with salary above the MIN(amount) of requests rows sharing the same status.
SQL: | SELECT value FROM accounts AS acct
WHERE salary > (
SELECT MIN(amount) FROM requests AS ordr
WHERE ordr.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16918 | train |
v2 | Schema:
branches (alias: brc)(salary, name, code, date)
sales(value, type, id, salary)
Task: Find value from branches where a matching record exists in sales with the same status.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16919 | train |
v1 | Schema:
categories (alias: catg)(status, code, salary, value)
departments(value, salary, type, id)
Task: Select name from categories where code exists in departments for the same level.
SQL: | SELECT name FROM categories AS catg
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16920 | train |
v2 | Schema:
accounts (alias: acct)(amount, code, id, date)
orders(id, salary, code, value)
Task: Find code from accounts where a matching record exists in orders with the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16921 | train |
v3 | Schema:
regions (alias: rgn)(type, amount, name, code)
items(level, id, code, salary)
Task: Find name from regions where salary exceeds the minimum value from items for the same code.
SQL: | SELECT name FROM regions AS rgn
WHERE salary > (
SELECT MIN(value) FROM items AS lne
WHERE lne.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16922 | train |
v3 | Schema:
departments (alias: dept)(code, name, id, amount)
products(date, amount, id, level)
Task: Find amount from departments where value exceeds the count of salary from products for the same id.
SQL: | SELECT amount FROM departments AS dept
WHERE value > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16923 | train |
v1 | Schema:
branches (alias: brc)(id, level, code, status)
transactions(code, level, date, status)
Task: Select name from branches where id exists in transactions for the same code.
SQL: | SELECT name FROM branches AS brc
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "transactions",
"outer_alias": "brc",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16924 | train |
v3 | Schema:
customers (alias: cust)(amount, status, name, level)
accounts(date, type, name, status)
Task: Find value from customers where value exceeds the average value from accounts for the same id.
SQL: | SELECT value FROM customers AS cust
WHERE value > (
SELECT AVG(value) FROM accounts AS acct
WHERE acct.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16925 | train |
v1 | Schema:
products (alias: prod)(salary, id, type, date)
items(name, status, code, date)
Task: Retrieve id from products whose type is found in items rows where id matches the outer record.
SQL: | SELECT id FROM products AS prod
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.id = prod.id
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16926 | train |
v1 | Schema:
tasks (alias: tsk)(name, status, amount, salary)
employees(name, code, id, date)
Task: Select amount from tasks where level exists in employees for the same id.
SQL: | SELECT amount FROM tasks AS tsk
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "tsk",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16927 | train |
v1 | Schema:
projects (alias: prj)(code, id, value, amount)
products(date, value, code, level)
Task: Select value from projects where type exists in products for the same type.
SQL: | SELECT value FROM projects AS prj
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16928 | train |
v3 | Schema:
categories (alias: catg)(id, date, amount, type)
departments(amount, salary, status, name)
Task: Find name from categories where value exceeds the total amount from departments for the same code.
SQL: | SELECT name FROM categories AS catg
WHERE value > (
SELECT SUM(amount) FROM departments AS dept
WHERE dept.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16929 | train |
v2 | Schema:
employees (alias: emp)(level, type, value, status)
categories(amount, value, level, id)
Task: Find id from employees where a matching record exists in categories with the same level.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16930 | train |
v3 | Schema:
orders (alias: ord)(name, value, type, code)
sales(value, amount, id, name)
Task: Find id from orders where salary exceeds the minimum salary from sales for the same id.
SQL: | SELECT id FROM orders AS ord
WHERE salary > (
SELECT MIN(salary) FROM sales AS sale
WHERE sale.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16931 | train |
v2 | Schema:
departments (alias: dept)(salary, name, type, amount)
employees(amount, id, status, value)
Task: Retrieve code from departments that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16932 | train |
v2 | Schema:
invoices (alias: inv)(value, id, level, date)
departments(type, id, amount, status)
Task: Retrieve name from invoices that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16933 | train |
v1 | Schema:
projects (alias: prj)(id, date, value, name)
categories(status, level, date, value)
Task: Retrieve code from projects whose level is found in categories rows where level matches the outer record.
SQL: | SELECT code FROM projects AS prj
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16934 | train |
v3 | Schema:
tasks (alias: tsk)(value, level, code, amount)
accounts(id, name, type, code)
Task: Retrieve name from tasks with value above the SUM(amount) of accounts rows sharing the same status.
SQL: | SELECT name FROM tasks AS tsk
WHERE value > (
SELECT SUM(amount) FROM accounts AS acct
WHERE acct.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16935 | train |
v2 | Schema:
regions (alias: rgn)(id, name, date, level)
accounts(status, id, code, name)
Task: Find id from regions where a matching record exists in accounts with the same type.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16936 | train |
v3 | Schema:
customers (alias: cust)(status, salary, amount, date)
employees(status, amount, type, value)
Task: Find value from customers where value exceeds the minimum amount from employees for the same status.
SQL: | SELECT value FROM customers AS cust
WHERE value > (
SELECT MIN(amount) FROM employees AS emp
WHERE emp.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "value",
"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_16937 | train |
v3 | Schema:
tasks (alias: tsk)(salary, level, id, code)
transactions(name, code, id, value)
Task: Retrieve value from tasks with amount above the MIN(amount) of transactions rows sharing the same status.
SQL: | SELECT value FROM tasks AS tsk
WHERE amount > (
SELECT MIN(amount) FROM transactions AS txn
WHERE txn.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16938 | train |
v1 | Schema:
shipments (alias: shp)(salary, date, name, type)
tasks(type, amount, date, status)
Task: Find salary from shipments where code appears in tasks entries with matching code.
SQL: | SELECT salary FROM shipments AS shp
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16939 | train |
v2 | Schema:
managers (alias: mgr)(salary, name, id, level)
tasks(code, name, type, value)
Task: Find code from managers where a matching record exists in tasks with the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16940 | train |
v3 | Schema:
staff (alias: empl)(id, value, type, amount)
transactions(salary, code, level, name)
Task: Retrieve id from staff with salary above the MAX(salary) of transactions rows sharing the same type.
SQL: | SELECT id FROM staff AS empl
WHERE salary > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16941 | train |
v3 | Schema:
requests (alias: ordr)(level, status, code, date)
customers(name, status, id, code)
Task: Find value from requests where amount exceeds the minimum amount from customers for the same code.
SQL: | SELECT value FROM requests AS ordr
WHERE amount > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16942 | train |
v2 | Schema:
categories (alias: catg)(name, date, value, id)
items(level, salary, type, status)
Task: Retrieve amount from categories that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16943 | train |
v1 | Schema:
regions (alias: rgn)(type, salary, value, date)
projects(status, value, name, code)
Task: Retrieve id from regions whose status is found in projects rows where level matches the outer record.
SQL: | SELECT id FROM regions AS rgn
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16944 | train |
v3 | Schema:
categories (alias: catg)(id, type, salary, amount)
departments(type, amount, date, value)
Task: Find amount from categories where amount exceeds the average salary from departments for the same level.
SQL: | SELECT amount FROM categories AS catg
WHERE amount > (
SELECT AVG(salary) FROM departments AS dept
WHERE dept.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16945 | train |
v2 | Schema:
schedules (alias: schd)(amount, code, value, salary)
departments(status, code, level, amount)
Task: Find id from schedules where a matching record exists in departments with the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16946 | train |
v1 | Schema:
regions (alias: rgn)(amount, id, level, code)
transactions(value, amount, name, status)
Task: Find id from regions where id appears in transactions entries with matching type.
SQL: | SELECT id FROM regions AS rgn
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16947 | train |
v3 | Schema:
staff (alias: empl)(id, type, name, amount)
departments(value, level, date, type)
Task: Find salary from staff where salary exceeds the count of salary from departments for the same code.
SQL: | SELECT salary FROM staff AS empl
WHERE salary > (
SELECT COUNT(salary) FROM departments AS dept
WHERE dept.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16948 | train |
v3 | Schema:
regions (alias: rgn)(value, type, status, date)
projects(code, value, status, salary)
Task: Retrieve amount from regions with amount above the SUM(amount) of projects rows sharing the same level.
SQL: | SELECT amount FROM regions AS rgn
WHERE amount > (
SELECT SUM(amount) FROM projects AS prj
WHERE prj.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16949 | train |
v2 | Schema:
sales (alias: sale)(name, type, status, id)
transactions(value, id, type, status)
Task: Retrieve value from sales that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16950 | train |
v3 | Schema:
tasks (alias: tsk)(status, code, amount, value)
projects(type, id, level, date)
Task: Retrieve code from tasks with amount above the COUNT(value) of projects rows sharing the same code.
SQL: | SELECT code FROM tasks AS tsk
WHERE amount > (
SELECT COUNT(value) FROM projects AS prj
WHERE prj.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16951 | train |
v1 | Schema:
accounts (alias: acct)(code, type, value, amount)
employees(salary, date, status, code)
Task: Select id from accounts where status exists in employees for the same type.
SQL: | SELECT id FROM accounts AS acct
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16952 | train |
v2 | Schema:
items (alias: lne)(type, level, code, amount)
requests(salary, status, id, type)
Task: Retrieve id from items that have at least one corresponding entry in requests sharing the same id.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = lne.id
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16953 | train |
v3 | Schema:
customers (alias: cust)(level, status, salary, amount)
regions(name, status, level, value)
Task: Find id from customers where salary exceeds the total value from regions for the same level.
SQL: | SELECT id FROM customers AS cust
WHERE salary > (
SELECT SUM(value) FROM regions AS rgn
WHERE rgn.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16954 | train |
v1 | Schema:
accounts (alias: acct)(code, salary, name, amount)
regions(status, code, type, level)
Task: Select value from accounts where id exists in regions for the same status.
SQL: | SELECT value FROM accounts AS acct
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16955 | train |
v2 | Schema:
requests (alias: ordr)(salary, amount, level, value)
transactions(date, id, value, name)
Task: Find value from requests where a matching record exists in transactions with the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16956 | train |
v1 | Schema:
orders (alias: ord)(status, name, salary, type)
products(type, id, salary, date)
Task: Retrieve name from orders whose status is found in products rows where code matches the outer record.
SQL: | SELECT name FROM orders AS ord
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16957 | train |
v2 | Schema:
customers (alias: cust)(salary, date, code, name)
transactions(name, id, status, code)
Task: Find value from customers where a matching record exists in transactions with the same status.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16958 | train |
v3 | Schema:
shipments (alias: shp)(date, salary, amount, id)
items(value, type, name, id)
Task: Retrieve value from shipments with value above the MIN(salary) of items rows sharing the same code.
SQL: | SELECT value FROM shipments AS shp
WHERE value > (
SELECT MIN(salary) FROM items AS lne
WHERE lne.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16959 | train |
v1 | Schema:
shipments (alias: shp)(date, type, status, level)
tasks(id, type, code, date)
Task: Retrieve name from shipments whose level is found in tasks rows where status matches the outer record.
SQL: | SELECT name FROM shipments AS shp
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16960 | train |
v2 | Schema:
tasks (alias: tsk)(code, level, amount, status)
orders(salary, status, type, name)
Task: Retrieve value from tasks that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16961 | train |
v2 | Schema:
branches (alias: brc)(value, type, date, status)
shipments(code, status, type, id)
Task: Find value from branches where a matching record exists in shipments with the same level.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16962 | train |
v1 | Schema:
departments (alias: dept)(code, date, level, name)
categories(amount, code, id, type)
Task: Retrieve amount from departments whose code is found in categories rows where status matches the outer record.
SQL: | SELECT amount FROM departments AS dept
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16963 | train |
v2 | Schema:
requests (alias: ordr)(code, type, name, level)
invoices(amount, salary, status, code)
Task: Find value from requests where a matching record exists in invoices with the same level.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16964 | train |
v2 | Schema:
departments (alias: dept)(amount, id, type, name)
regions(date, type, level, status)
Task: Find code from departments where a matching record exists in regions with the same status.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16965 | train |
v2 | Schema:
customers (alias: cust)(type, date, name, amount)
schedules(id, name, code, date)
Task: Retrieve amount from customers that have at least one corresponding entry in schedules sharing the same level.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16966 | train |
v2 | Schema:
transactions (alias: txn)(date, type, code, amount)
managers(code, type, salary, id)
Task: Find value from transactions where a matching record exists in managers with the same type.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16967 | train |
v2 | Schema:
invoices (alias: inv)(code, name, value, amount)
departments(code, status, level, type)
Task: Find amount from invoices where a matching record exists in departments with the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16968 | train |
v3 | Schema:
regions (alias: rgn)(level, amount, salary, value)
schedules(level, amount, status, type)
Task: Retrieve id from regions with salary above the SUM(salary) of schedules rows sharing the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE salary > (
SELECT SUM(salary) FROM schedules AS schd
WHERE schd.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16969 | train |
v1 | Schema:
sales (alias: sale)(amount, level, code, salary)
requests(name, type, status, amount)
Task: Select name from sales where status exists in requests for the same code.
SQL: | SELECT name FROM sales AS sale
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16970 | train |
v3 | Schema:
invoices (alias: inv)(type, level, value, id)
transactions(date, name, id, level)
Task: Retrieve amount from invoices with value above the AVG(salary) of transactions rows sharing the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE value > (
SELECT AVG(salary) FROM transactions AS txn
WHERE txn.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16971 | train |
v2 | Schema:
customers (alias: cust)(level, salary, date, value)
schedules(type, code, amount, date)
Task: Retrieve value from customers that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16972 | train |
v1 | Schema:
managers (alias: mgr)(value, salary, level, name)
regions(code, amount, salary, status)
Task: Select code from managers where type exists in regions for the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16973 | train |
v2 | Schema:
regions (alias: rgn)(value, amount, level, type)
items(amount, value, level, type)
Task: Find id from regions where a matching record exists in items with the same code.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16974 | train |
v2 | Schema:
staff (alias: empl)(date, code, id, name)
accounts(salary, type, amount, code)
Task: Retrieve value from staff that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16975 | train |
v3 | Schema:
transactions (alias: txn)(name, value, level, id)
sales(amount, name, date, id)
Task: Retrieve code from transactions with amount above the MIN(value) of sales rows sharing the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE amount > (
SELECT MIN(value) FROM sales AS sale
WHERE sale.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16976 | train |
v1 | Schema:
branches (alias: brc)(date, value, id, salary)
schedules(salary, type, id, date)
Task: Select salary from branches where type exists in schedules for the same id.
SQL: | SELECT salary FROM branches AS brc
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "schedules",
"outer_alias": "brc",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16977 | train |
v3 | Schema:
customers (alias: cust)(status, type, name, code)
regions(name, salary, type, date)
Task: Retrieve name from customers with salary above the MAX(salary) of regions rows sharing the same code.
SQL: | SELECT name FROM customers AS cust
WHERE salary > (
SELECT MAX(salary) FROM regions AS rgn
WHERE rgn.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16978 | train |
v3 | Schema:
accounts (alias: acct)(date, type, value, name)
shipments(amount, date, status, level)
Task: Find amount from accounts where salary exceeds the count of value from shipments for the same code.
SQL: | SELECT amount FROM accounts AS acct
WHERE salary > (
SELECT COUNT(value) FROM shipments AS shp
WHERE shp.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16979 | train |
v2 | Schema:
shipments (alias: shp)(salary, id, date, name)
branches(date, type, level, value)
Task: Retrieve amount from shipments that have at least one corresponding entry in branches sharing the same type.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16980 | train |
v1 | Schema:
items (alias: lne)(status, value, id, code)
accounts(type, date, amount, id)
Task: Find salary from items where status appears in accounts entries with matching 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_16981 | train |
v2 | Schema:
orders (alias: ord)(level, name, value, date)
branches(date, name, salary, amount)
Task: Find name from orders where a matching record exists in branches with the same type.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16982 | train |
v1 | Schema:
projects (alias: prj)(status, type, date, code)
customers(type, id, level, date)
Task: Select code from projects where id exists in customers for the same id.
SQL: | SELECT code FROM projects AS prj
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "prj",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16983 | train |
v1 | Schema:
projects (alias: prj)(status, date, value, code)
schedules(amount, code, id, value)
Task: Find amount from projects where code appears in schedules entries with matching code.
SQL: | SELECT amount FROM projects AS prj
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "schedules",
"outer_alias": "prj",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16984 | train |
v3 | Schema:
invoices (alias: inv)(value, name, id, salary)
managers(id, date, value, salary)
Task: Find amount from invoices where amount exceeds the count of salary from managers for the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE amount > (
SELECT COUNT(salary) FROM managers AS mgr
WHERE mgr.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16985 | train |
v3 | Schema:
staff (alias: empl)(amount, status, level, date)
shipments(date, amount, id, value)
Task: Retrieve code from staff with amount above the AVG(salary) of shipments rows sharing the same code.
SQL: | SELECT code FROM staff AS empl
WHERE amount > (
SELECT AVG(salary) 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": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16986 | train |
v3 | Schema:
orders (alias: ord)(salary, id, code, type)
shipments(date, code, id, salary)
Task: Find value from orders where value exceeds the count of salary from shipments for the same level.
SQL: | SELECT value FROM orders AS ord
WHERE value > (
SELECT COUNT(salary) FROM shipments AS shp
WHERE shp.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16987 | train |
v1 | Schema:
tasks (alias: tsk)(amount, code, salary, date)
requests(date, level, type, name)
Task: Select amount from tasks where status exists in requests for the same status.
SQL: | SELECT amount FROM tasks AS tsk
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16988 | train |
v3 | Schema:
departments (alias: dept)(type, id, date, level)
items(type, code, id, amount)
Task: Retrieve code from departments with amount above the AVG(amount) of items rows sharing the same level.
SQL: | SELECT code FROM departments AS dept
WHERE amount > (
SELECT AVG(amount) FROM items AS lne
WHERE lne.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16989 | train |
v1 | Schema:
accounts (alias: acct)(level, status, name, type)
projects(status, id, salary, value)
Task: Find value from accounts where code appears in projects entries with matching code.
SQL: | SELECT value FROM accounts AS acct
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16990 | train |
v1 | Schema:
requests (alias: ordr)(code, date, type, amount)
items(id, date, status, code)
Task: Select code from requests where level exists in items for the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16991 | train |
v1 | Schema:
customers (alias: cust)(status, value, type, level)
staff(salary, amount, id, value)
Task: Select value from customers where status exists in staff for the same id.
SQL: | SELECT value FROM customers AS cust
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16992 | train |
v3 | Schema:
regions (alias: rgn)(status, salary, amount, level)
transactions(code, date, level, type)
Task: Find salary from regions where salary exceeds the minimum amount from transactions for the same type.
SQL: | SELECT salary FROM regions AS rgn
WHERE salary > (
SELECT MIN(amount) FROM transactions AS txn
WHERE txn.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16993 | train |
v1 | Schema:
tasks (alias: tsk)(salary, value, type, level)
schedules(status, salary, amount, id)
Task: Select name from tasks where id exists in schedules for the same id.
SQL: | SELECT name FROM tasks AS tsk
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16994 | train |
v1 | Schema:
products (alias: prod)(amount, status, id, value)
managers(level, id, value, amount)
Task: Find id from products where type appears in managers entries with matching level.
SQL: | SELECT id FROM products AS prod
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16995 | train |
v3 | Schema:
items (alias: lne)(name, amount, date, level)
sales(code, value, date, id)
Task: Retrieve amount from items with value above the AVG(value) of sales rows sharing the same code.
SQL: | SELECT amount FROM items AS lne
WHERE value > (
SELECT AVG(value) FROM sales AS sale
WHERE sale.code = lne.code
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16996 | train |
v1 | Schema:
projects (alias: prj)(id, salary, name, amount)
accounts(id, level, amount, type)
Task: Retrieve name from projects whose id is found in accounts rows where id matches the outer record.
SQL: | SELECT name FROM projects AS prj
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16997 | train |
v3 | Schema:
tasks (alias: tsk)(code, status, date, id)
staff(code, status, amount, name)
Task: Retrieve id from tasks with value above the AVG(value) of staff rows sharing the same id.
SQL: | SELECT id FROM tasks AS tsk
WHERE value > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "staff",
"outer_alias": "tsk",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16998 | train |
v1 | Schema:
items (alias: lne)(id, status, date, amount)
tasks(code, level, date, salary)
Task: Select code from items where id exists in tasks for the same level.
SQL: | SELECT code FROM items AS lne
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.level = lne.level
); | {
"outer_table": "items",
"inner_table": "tasks",
"outer_alias": "lne",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16999 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.