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)(code, type, id, status)
departments(salary, type, name, code)
Task: Retrieve id from transactions whose status is found in departments rows where code matches the outer record.
SQL: | SELECT id FROM transactions AS txn
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14800 | train |
v3 | Schema:
invoices (alias: inv)(level, type, status, date)
categories(salary, level, date, name)
Task: Retrieve value from invoices with salary above the COUNT(value) of categories rows sharing the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE salary > (
SELECT COUNT(value) FROM categories AS catg
WHERE catg.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14801 | train |
v3 | Schema:
transactions (alias: txn)(salary, name, date, amount)
managers(name, value, status, salary)
Task: Retrieve salary from transactions with amount above the AVG(value) of managers rows sharing the same status.
SQL: | SELECT salary FROM transactions AS txn
WHERE amount > (
SELECT AVG(value) FROM managers AS mgr
WHERE mgr.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14802 | train |
v2 | Schema:
shipments (alias: shp)(code, level, name, amount)
sales(level, date, salary, name)
Task: Find name from shipments where a matching record exists in sales with the same type.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14803 | train |
v1 | Schema:
staff (alias: empl)(type, salary, name, amount)
managers(date, level, amount, code)
Task: Find amount from staff where type appears in managers entries with matching status.
SQL: | SELECT amount FROM staff AS empl
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14804 | train |
v2 | Schema:
categories (alias: catg)(level, status, value, date)
projects(type, code, level, id)
Task: Find code from categories where a matching record exists in projects with the same id.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14805 | train |
v1 | Schema:
departments (alias: dept)(date, salary, id, status)
categories(type, salary, code, value)
Task: Find code from departments where level appears in categories entries with matching id.
SQL: | SELECT code FROM departments AS dept
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14806 | train |
v2 | Schema:
items (alias: lne)(salary, id, date, code)
accounts(code, salary, id, amount)
Task: Retrieve id from items that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = lne.code
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14807 | train |
v1 | Schema:
accounts (alias: acct)(amount, name, code, status)
categories(status, level, amount, salary)
Task: Retrieve salary from accounts whose id is found in categories rows where id matches the outer record.
SQL: | SELECT salary FROM accounts AS acct
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14808 | train |
v2 | Schema:
projects (alias: prj)(code, name, date, amount)
tasks(amount, value, name, status)
Task: Retrieve code from projects that have at least one corresponding entry in tasks sharing the same status.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "prj",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14809 | train |
v2 | Schema:
categories (alias: catg)(salary, date, name, level)
schedules(level, status, code, amount)
Task: Retrieve amount from categories that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14810 | train |
v2 | Schema:
customers (alias: cust)(date, salary, type, name)
schedules(level, date, amount, salary)
Task: Find value from customers where a matching record exists in schedules with the same status.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14811 | train |
v1 | Schema:
projects (alias: prj)(date, amount, salary, level)
schedules(value, salary, amount, level)
Task: Find code from projects where status appears in schedules entries with matching code.
SQL: | SELECT code FROM projects AS prj
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "schedules",
"outer_alias": "prj",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14812 | train |
v2 | Schema:
orders (alias: ord)(salary, level, type, status)
regions(type, name, value, level)
Task: Find name from orders where a matching record exists in regions with the same id.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14813 | train |
v3 | Schema:
departments (alias: dept)(value, status, level, id)
employees(status, code, id, name)
Task: Retrieve name from departments with value above the SUM(salary) of employees rows sharing the same status.
SQL: | SELECT name FROM departments AS dept
WHERE value > (
SELECT SUM(salary) FROM employees AS emp
WHERE emp.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14814 | train |
v3 | Schema:
customers (alias: cust)(value, salary, code, date)
tasks(salary, amount, code, value)
Task: Retrieve name from customers with value above the AVG(value) of tasks rows sharing the same type.
SQL: | SELECT name FROM customers AS cust
WHERE value > (
SELECT AVG(value) FROM tasks AS tsk
WHERE tsk.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "tasks",
"outer_alias": "cust",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14815 | train |
v3 | Schema:
customers (alias: cust)(code, level, status, date)
accounts(value, code, level, id)
Task: Retrieve name from customers with salary above the COUNT(value) of accounts rows sharing the same code.
SQL: | SELECT name FROM customers AS cust
WHERE salary > (
SELECT COUNT(value) FROM accounts AS acct
WHERE acct.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14816 | train |
v3 | Schema:
invoices (alias: inv)(id, amount, status, level)
orders(date, id, type, level)
Task: Find value from invoices where amount exceeds the count of amount from orders for the same id.
SQL: | SELECT value FROM invoices AS inv
WHERE amount > (
SELECT COUNT(amount) FROM orders AS ord
WHERE ord.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14817 | train |
v1 | Schema:
managers (alias: mgr)(type, code, id, name)
invoices(salary, level, id, code)
Task: Retrieve salary from managers whose status is found in invoices rows where id matches the outer record.
SQL: | SELECT salary FROM managers AS mgr
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14818 | train |
v2 | Schema:
staff (alias: empl)(date, type, id, code)
schedules(code, value, status, date)
Task: Find value from staff where a matching record exists in schedules with the same type.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14819 | train |
v3 | Schema:
items (alias: lne)(name, type, status, amount)
employees(name, id, salary, amount)
Task: Retrieve salary from items with amount above the MIN(amount) of employees rows sharing the same id.
SQL: | SELECT salary FROM items AS lne
WHERE amount > (
SELECT MIN(amount) FROM employees AS emp
WHERE emp.id = lne.id
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14820 | train |
v3 | Schema:
categories (alias: catg)(name, salary, status, type)
shipments(name, date, status, id)
Task: Retrieve salary from categories with value above the MAX(value) of shipments rows sharing the same id.
SQL: | SELECT salary FROM categories AS catg
WHERE value > (
SELECT MAX(value) FROM shipments AS shp
WHERE shp.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14821 | train |
v2 | Schema:
invoices (alias: inv)(date, salary, id, name)
items(value, amount, id, salary)
Task: Retrieve name from invoices that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14822 | train |
v2 | Schema:
regions (alias: rgn)(salary, name, amount, status)
branches(name, status, value, date)
Task: Retrieve id from regions that have at least one corresponding entry in branches sharing the same code.
SQL: | SELECT id 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": "id",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14823 | train |
v3 | Schema:
projects (alias: prj)(date, salary, value, id)
departments(status, name, amount, value)
Task: Retrieve salary from projects with amount above the COUNT(salary) of departments rows sharing the same code.
SQL: | SELECT salary FROM projects AS prj
WHERE amount > (
SELECT COUNT(salary) FROM departments AS dept
WHERE dept.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14824 | train |
v2 | Schema:
orders (alias: ord)(code, status, value, name)
regions(code, value, date, level)
Task: Retrieve code from orders that have at least one corresponding entry in regions sharing the same code.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14825 | train |
v2 | Schema:
tasks (alias: tsk)(salary, amount, level, type)
schedules(amount, date, code, id)
Task: Find code from tasks where a matching record exists in schedules with the same status.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14826 | train |
v2 | Schema:
departments (alias: dept)(date, salary, type, status)
schedules(date, id, status, value)
Task: Find name from departments where a matching record exists in schedules with the same type.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14827 | train |
v3 | Schema:
staff (alias: empl)(salary, type, id, name)
departments(name, date, salary, level)
Task: Retrieve amount from staff with value above the AVG(amount) of departments rows sharing the same level.
SQL: | SELECT amount FROM staff AS empl
WHERE value > (
SELECT AVG(amount) FROM departments AS dept
WHERE dept.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14828 | train |
v1 | Schema:
customers (alias: cust)(name, salary, amount, date)
shipments(status, code, value, amount)
Task: Retrieve amount from customers whose id is found in shipments rows where status matches the outer record.
SQL: | SELECT amount FROM customers AS cust
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14829 | train |
v2 | Schema:
products (alias: prod)(name, status, amount, type)
employees(name, value, id, code)
Task: Find value from products where a matching record exists in employees with the same code.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = prod.code
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14830 | train |
v3 | Schema:
transactions (alias: txn)(amount, type, code, level)
sales(id, value, date, status)
Task: Retrieve value from transactions with amount above the SUM(amount) of sales rows sharing the same code.
SQL: | SELECT value FROM transactions AS txn
WHERE amount > (
SELECT SUM(amount) FROM sales AS sale
WHERE sale.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14831 | train |
v3 | Schema:
categories (alias: catg)(id, salary, code, level)
accounts(type, amount, code, value)
Task: Retrieve code from categories with value above the MIN(value) of accounts rows sharing the same code.
SQL: | SELECT code FROM categories AS catg
WHERE value > (
SELECT MIN(value) FROM accounts AS acct
WHERE acct.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14832 | train |
v1 | Schema:
branches (alias: brc)(amount, status, code, date)
customers(code, date, level, id)
Task: Select amount from branches where id exists in customers for the same code.
SQL: | SELECT amount FROM branches AS brc
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14833 | train |
v3 | Schema:
shipments (alias: shp)(date, level, value, code)
departments(name, type, code, date)
Task: Find name from shipments where amount exceeds the minimum amount from departments for the same type.
SQL: | SELECT name FROM shipments AS shp
WHERE amount > (
SELECT MIN(amount) FROM departments AS dept
WHERE dept.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14834 | train |
v2 | Schema:
projects (alias: prj)(code, id, level, value)
categories(status, date, type, amount)
Task: Find id from projects where a matching record exists in categories with the same level.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14835 | train |
v1 | Schema:
employees (alias: emp)(salary, date, type, level)
regions(amount, type, id, name)
Task: Select value from employees where id exists in regions for the same level.
SQL: | SELECT value FROM employees AS emp
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14836 | train |
v3 | Schema:
employees (alias: emp)(level, date, code, name)
items(amount, code, date, type)
Task: Retrieve salary from employees with amount above the SUM(value) of items rows sharing the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE amount > (
SELECT SUM(value) FROM items AS lne
WHERE lne.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14837 | train |
v1 | Schema:
staff (alias: empl)(status, salary, value, type)
requests(salary, amount, code, type)
Task: Find code from staff where id appears in requests entries with matching level.
SQL: | SELECT code FROM staff AS empl
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14838 | train |
v2 | Schema:
shipments (alias: shp)(code, salary, level, type)
schedules(type, value, id, status)
Task: Retrieve code from shipments that have at least one corresponding entry in schedules sharing the same type.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14839 | train |
v3 | Schema:
staff (alias: empl)(date, amount, type, salary)
requests(type, status, salary, date)
Task: Find salary from staff where amount exceeds the average salary from requests for the same id.
SQL: | SELECT salary FROM staff AS empl
WHERE amount > (
SELECT AVG(salary) FROM requests AS ordr
WHERE ordr.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14840 | train |
v2 | Schema:
invoices (alias: inv)(value, name, status, salary)
schedules(status, salary, amount, type)
Task: Retrieve salary from invoices that have at least one corresponding entry in schedules sharing the same id.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14841 | train |
v3 | Schema:
shipments (alias: shp)(type, salary, name, code)
branches(code, name, level, type)
Task: Retrieve name from shipments with amount above the MAX(salary) of branches rows sharing the same code.
SQL: | SELECT name FROM shipments AS shp
WHERE amount > (
SELECT MAX(salary) FROM branches AS brc
WHERE brc.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14842 | train |
v2 | Schema:
regions (alias: rgn)(date, type, level, code)
branches(level, status, type, value)
Task: Retrieve value from regions that have at least one corresponding entry in branches sharing the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14843 | train |
v1 | Schema:
departments (alias: dept)(date, salary, code, status)
regions(level, salary, code, name)
Task: Retrieve name from departments whose id is found in regions rows where level matches the outer record.
SQL: | SELECT name FROM departments AS dept
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14844 | train |
v2 | Schema:
products (alias: prod)(salary, amount, code, type)
tasks(level, id, value, date)
Task: Retrieve name from products that have at least one corresponding entry in tasks sharing the same id.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = prod.id
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14845 | train |
v2 | Schema:
branches (alias: brc)(salary, code, amount, level)
tasks(value, name, amount, id)
Task: Retrieve amount from branches that have at least one corresponding entry in tasks sharing the same code.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14846 | train |
v2 | Schema:
categories (alias: catg)(salary, value, name, date)
requests(level, date, id, salary)
Task: Find salary from categories where a matching record exists in requests with the same status.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14847 | train |
v1 | Schema:
customers (alias: cust)(name, status, code, id)
branches(name, level, salary, date)
Task: Retrieve code from customers whose level is found in branches rows where code matches the outer record.
SQL: | SELECT code FROM customers AS cust
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "branches",
"outer_alias": "cust",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14848 | train |
v3 | Schema:
orders (alias: ord)(amount, name, type, salary)
tasks(name, id, date, level)
Task: Find value from orders where amount exceeds the total value from tasks for the same level.
SQL: | SELECT value FROM orders AS ord
WHERE amount > (
SELECT SUM(value) FROM tasks AS tsk
WHERE tsk.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14849 | train |
v2 | Schema:
projects (alias: prj)(date, id, type, amount)
branches(date, name, code, status)
Task: Find value from projects where a matching record exists in branches with the same id.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14850 | train |
v3 | Schema:
employees (alias: emp)(value, id, status, salary)
accounts(type, salary, level, name)
Task: Retrieve salary from employees with value above the AVG(amount) of accounts rows sharing the same id.
SQL: | SELECT salary FROM employees AS emp
WHERE value > (
SELECT AVG(amount) FROM accounts AS acct
WHERE acct.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14851 | train |
v3 | Schema:
projects (alias: prj)(value, level, amount, salary)
employees(date, id, amount, type)
Task: Find salary from projects where salary exceeds the minimum amount from employees for the same code.
SQL: | SELECT salary FROM projects AS prj
WHERE salary > (
SELECT MIN(amount) FROM employees AS emp
WHERE emp.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14852 | train |
v3 | Schema:
transactions (alias: txn)(amount, status, salary, name)
accounts(salary, name, level, amount)
Task: Find name from transactions where value exceeds the average amount from accounts for the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE value > (
SELECT AVG(amount) FROM accounts AS acct
WHERE acct.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14853 | train |
v3 | Schema:
items (alias: lne)(id, amount, code, salary)
departments(code, date, amount, salary)
Task: Retrieve name from items with value above the MAX(salary) of departments rows sharing the same status.
SQL: | SELECT name FROM items AS lne
WHERE value > (
SELECT MAX(salary) FROM departments AS dept
WHERE dept.status = lne.status
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14854 | train |
v3 | Schema:
invoices (alias: inv)(name, date, code, id)
customers(value, id, code, salary)
Task: Retrieve name from invoices with value above the SUM(amount) of customers rows sharing the same level.
SQL: | SELECT name FROM invoices AS inv
WHERE value > (
SELECT SUM(amount) FROM customers AS cust
WHERE cust.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14855 | train |
v3 | Schema:
schedules (alias: schd)(salary, code, id, level)
customers(value, level, amount, salary)
Task: Retrieve value from schedules with value above the MAX(amount) of customers rows sharing the same type.
SQL: | SELECT value FROM schedules AS schd
WHERE value > (
SELECT MAX(amount) FROM customers AS cust
WHERE cust.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14856 | train |
v2 | Schema:
categories (alias: catg)(level, name, status, type)
departments(date, type, amount, name)
Task: Find value from categories where a matching record exists in departments with the same code.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14857 | train |
v2 | Schema:
shipments (alias: shp)(status, salary, level, code)
customers(type, value, amount, level)
Task: Find salary from shipments where a matching record exists in customers with the same status.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14858 | train |
v1 | Schema:
products (alias: prod)(date, name, code, level)
orders(date, value, level, status)
Task: Retrieve name from products whose code is found in orders rows where id matches the outer record.
SQL: | SELECT name FROM products AS prod
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.id = prod.id
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14859 | train |
v3 | Schema:
requests (alias: ordr)(type, salary, id, amount)
projects(code, id, date, level)
Task: Retrieve code from requests with salary above the MIN(amount) of projects rows sharing the same type.
SQL: | SELECT code FROM requests AS ordr
WHERE salary > (
SELECT MIN(amount) FROM projects AS prj
WHERE prj.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14860 | train |
v3 | Schema:
managers (alias: mgr)(amount, value, name, level)
employees(name, level, value, code)
Task: Retrieve id from managers with value above the COUNT(value) of employees rows sharing the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE value > (
SELECT COUNT(value) FROM employees AS emp
WHERE emp.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14861 | train |
v3 | Schema:
tasks (alias: tsk)(status, value, salary, name)
orders(status, amount, value, code)
Task: Find salary from tasks where amount exceeds the count of amount from orders for the same type.
SQL: | SELECT salary FROM tasks AS tsk
WHERE amount > (
SELECT COUNT(amount) FROM orders AS ord
WHERE ord.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14862 | train |
v2 | Schema:
orders (alias: ord)(value, id, date, code)
categories(type, id, code, value)
Task: Find code from orders where a matching record exists in categories with the same code.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14863 | train |
v2 | Schema:
staff (alias: empl)(code, date, name, level)
schedules(value, level, name, code)
Task: Find value from staff where a matching record exists in schedules with the same id.
SQL: | SELECT value 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": "value",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14864 | train |
v2 | Schema:
categories (alias: catg)(id, code, type, amount)
transactions(amount, id, date, salary)
Task: Retrieve amount from categories that have at least one corresponding entry in transactions sharing the same code.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14865 | train |
v2 | Schema:
regions (alias: rgn)(value, type, date, id)
invoices(date, name, value, type)
Task: Retrieve code from regions that have at least one corresponding entry in invoices sharing the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14866 | train |
v3 | Schema:
categories (alias: catg)(salary, status, code, id)
schedules(type, status, id, salary)
Task: Find value from categories where value exceeds the count of value from schedules for the same type.
SQL: | SELECT value FROM categories AS catg
WHERE value > (
SELECT COUNT(value) FROM schedules AS schd
WHERE schd.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14867 | train |
v1 | Schema:
invoices (alias: inv)(value, type, name, amount)
managers(date, code, amount, level)
Task: Retrieve code from invoices whose level is found in managers rows where type matches the outer record.
SQL: | SELECT code 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": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14868 | train |
v3 | Schema:
accounts (alias: acct)(code, value, date, type)
transactions(amount, code, name, date)
Task: Retrieve value from accounts with salary above the COUNT(salary) of transactions rows sharing the same status.
SQL: | SELECT value FROM accounts AS acct
WHERE salary > (
SELECT COUNT(salary) FROM transactions AS txn
WHERE txn.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14869 | train |
v1 | Schema:
items (alias: lne)(salary, level, date, type)
invoices(name, amount, code, level)
Task: Find code from items where type appears in invoices entries with matching id.
SQL: | SELECT code FROM items AS lne
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.id = lne.id
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14870 | train |
v2 | Schema:
invoices (alias: inv)(code, amount, name, status)
shipments(date, salary, name, value)
Task: Find code from invoices where a matching record exists in shipments with the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14871 | train |
v2 | Schema:
transactions (alias: txn)(date, type, value, name)
requests(name, amount, salary, type)
Task: Retrieve salary from transactions that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14872 | train |
v2 | Schema:
accounts (alias: acct)(amount, code, value, level)
orders(type, value, status, code)
Task: Find code from accounts where a matching record exists in orders with the same status.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14873 | train |
v2 | Schema:
branches (alias: brc)(salary, name, code, value)
items(type, name, date, salary)
Task: Find amount from branches where a matching record exists in items with the same type.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14874 | train |
v2 | Schema:
schedules (alias: schd)(level, status, value, salary)
projects(level, type, salary, name)
Task: Retrieve salary from schedules that have at least one corresponding entry in projects sharing the same code.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14875 | train |
v1 | Schema:
projects (alias: prj)(value, name, salary, type)
employees(name, salary, date, amount)
Task: Retrieve salary from projects whose level is found in employees rows where status matches the outer record.
SQL: | SELECT salary FROM projects AS prj
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14876 | train |
v3 | Schema:
invoices (alias: inv)(code, value, amount, level)
products(level, type, id, value)
Task: Find amount from invoices where salary exceeds the count of salary from products for the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE salary > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14877 | train |
v2 | Schema:
staff (alias: empl)(salary, date, name, status)
requests(level, status, id, salary)
Task: Retrieve value from staff that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14878 | train |
v2 | Schema:
invoices (alias: inv)(name, status, amount, level)
products(id, value, amount, status)
Task: Find value from invoices where a matching record exists in products with the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14879 | train |
v2 | Schema:
branches (alias: brc)(id, salary, status, value)
customers(status, name, code, salary)
Task: Retrieve value from branches that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14880 | train |
v1 | Schema:
employees (alias: emp)(amount, id, status, date)
accounts(id, salary, status, level)
Task: Find code from employees where code appears in accounts entries with matching type.
SQL: | SELECT code FROM employees AS emp
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14881 | train |
v1 | Schema:
employees (alias: emp)(status, id, level, date)
products(id, code, level, amount)
Task: Retrieve value from employees whose level is found in products rows where status matches the outer record.
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_14882 | train |
v1 | Schema:
orders (alias: ord)(amount, id, value, type)
projects(level, status, date, value)
Task: Retrieve salary from orders whose id is found in projects rows where type matches the outer record.
SQL: | SELECT salary FROM orders AS ord
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14883 | train |
v2 | Schema:
products (alias: prod)(name, salary, date, code)
employees(value, code, name, date)
Task: Find value from products where a matching record exists in employees with the same code.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = prod.code
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14884 | train |
v1 | Schema:
accounts (alias: acct)(amount, code, name, value)
items(code, type, date, status)
Task: Find code from accounts where status appears in items entries with matching id.
SQL: | SELECT code FROM accounts AS acct
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14885 | train |
v3 | Schema:
branches (alias: brc)(name, type, date, code)
managers(status, code, type, amount)
Task: Retrieve value from branches with salary above the MIN(salary) of managers rows sharing the same level.
SQL: | SELECT value FROM branches AS brc
WHERE salary > (
SELECT MIN(salary) FROM managers AS mgr
WHERE mgr.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "managers",
"outer_alias": "brc",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14886 | train |
v2 | Schema:
managers (alias: mgr)(salary, amount, id, value)
invoices(status, value, name, code)
Task: Find id from managers where a matching record exists in invoices with the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14887 | train |
v1 | Schema:
shipments (alias: shp)(level, type, salary, status)
staff(status, id, code, salary)
Task: Retrieve name from shipments whose code is found in staff rows where id matches the outer record.
SQL: | SELECT name FROM shipments AS shp
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14888 | train |
v2 | Schema:
sales (alias: sale)(amount, type, id, status)
categories(date, id, code, value)
Task: Retrieve amount from sales that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14889 | train |
v3 | Schema:
employees (alias: emp)(type, amount, id, level)
branches(value, salary, type, level)
Task: Retrieve code from employees with value above the SUM(salary) of branches rows sharing the same code.
SQL: | SELECT code FROM employees AS emp
WHERE value > (
SELECT SUM(salary) FROM branches AS brc
WHERE brc.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14890 | train |
v3 | Schema:
transactions (alias: txn)(salary, name, amount, value)
orders(type, code, id, status)
Task: Find value from transactions where value exceeds the total salary from orders for the same level.
SQL: | SELECT value FROM transactions AS txn
WHERE value > (
SELECT SUM(salary) FROM orders AS ord
WHERE ord.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14891 | train |
v2 | Schema:
schedules (alias: schd)(type, amount, name, date)
orders(code, level, name, date)
Task: Retrieve name from schedules that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14892 | train |
v3 | Schema:
customers (alias: cust)(code, salary, value, date)
products(level, code, type, name)
Task: Retrieve amount from customers with value above the MAX(amount) of products rows sharing the same id.
SQL: | SELECT amount FROM customers AS cust
WHERE value > (
SELECT MAX(amount) FROM products AS prod
WHERE prod.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14893 | train |
v2 | Schema:
categories (alias: catg)(code, id, value, salary)
employees(value, name, status, type)
Task: Find code from categories where a matching record exists in employees with the same type.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14894 | train |
v1 | Schema:
customers (alias: cust)(type, code, name, level)
regions(date, status, salary, value)
Task: Retrieve value from customers whose status is found in regions rows where status matches the outer record.
SQL: | SELECT value FROM customers AS cust
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14895 | train |
v2 | Schema:
managers (alias: mgr)(amount, code, salary, id)
sales(status, code, name, value)
Task: Find value from managers where a matching record exists in sales with the same code.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14896 | train |
v3 | Schema:
accounts (alias: acct)(salary, date, type, value)
orders(name, status, level, date)
Task: Retrieve id from accounts with value above the SUM(salary) of orders rows sharing the same level.
SQL: | SELECT id FROM accounts AS acct
WHERE value > (
SELECT SUM(salary) FROM orders AS ord
WHERE ord.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14897 | train |
v1 | Schema:
projects (alias: prj)(code, value, date, salary)
staff(name, date, id, amount)
Task: Find name from projects where status appears in staff entries with matching status.
SQL: | SELECT name FROM projects AS prj
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "staff",
"outer_alias": "prj",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14898 | train |
v3 | Schema:
requests (alias: ordr)(date, level, name, salary)
items(salary, level, code, type)
Task: Find code from requests where value exceeds the count of value from items for the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE value > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14899 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.