variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v2 | Schema:
sales (alias: sale)(name, salary, code, id)
managers(status, level, code, id)
Task: Find amount from sales where a matching record exists in managers with the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09900 | train |
v3 | Schema:
items (alias: lne)(id, status, name, value)
departments(date, code, name, value)
Task: Find amount from items where salary exceeds the count of salary from departments for the same level.
SQL: | SELECT amount FROM items AS lne
WHERE salary > (
SELECT COUNT(salary) FROM departments AS dept
WHERE dept.level = lne.level
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_09901 | train |
v3 | Schema:
sales (alias: sale)(status, salary, id, code)
shipments(id, level, value, code)
Task: Retrieve salary from sales with amount above the MAX(amount) of shipments rows sharing the same code.
SQL: | SELECT salary FROM sales AS sale
WHERE amount > (
SELECT MAX(amount) FROM shipments AS shp
WHERE shp.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09902 | train |
v1 | Schema:
products (alias: prod)(value, code, type, salary)
orders(date, value, level, name)
Task: Select name from products where id exists in orders for the same id.
SQL: | SELECT name FROM products AS prod
WHERE id IN (
SELECT id 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": "id",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09903 | train |
v1 | Schema:
departments (alias: dept)(id, status, amount, level)
employees(status, salary, id, type)
Task: Retrieve code from departments whose level is found in employees rows where status matches the outer record.
SQL: | SELECT code FROM departments AS dept
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09904 | train |
v2 | Schema:
shipments (alias: shp)(value, code, name, level)
regions(amount, level, id, salary)
Task: Find value from shipments where a matching record exists in regions with the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09905 | train |
v1 | Schema:
orders (alias: ord)(amount, code, value, type)
employees(level, code, status, salary)
Task: Retrieve code from orders whose status is found in employees rows where code matches the outer record.
SQL: | SELECT code FROM orders AS ord
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09906 | train |
v1 | Schema:
tasks (alias: tsk)(date, status, code, salary)
items(salary, value, date, level)
Task: Retrieve id from tasks whose type is found in items rows where level matches the outer record.
SQL: | SELECT id FROM tasks AS tsk
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "items",
"outer_alias": "tsk",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_09907 | train |
v1 | Schema:
transactions (alias: txn)(type, level, value, id)
products(code, date, type, value)
Task: Select name from transactions where level exists in products for the same level.
SQL: | SELECT name FROM transactions AS txn
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09908 | train |
v2 | Schema:
transactions (alias: txn)(amount, status, value, date)
requests(level, name, status, type)
Task: Retrieve amount from transactions that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09909 | train |
v1 | Schema:
items (alias: lne)(amount, type, code, date)
orders(amount, status, date, value)
Task: Select value from items where id exists in orders for the same code.
SQL: | SELECT value FROM items AS lne
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.code = lne.code
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_09910 | train |
v1 | Schema:
shipments (alias: shp)(salary, value, amount, name)
tasks(amount, status, type, level)
Task: Select salary from shipments where id exists in tasks for the same level.
SQL: | SELECT salary FROM shipments AS shp
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09911 | train |
v3 | Schema:
items (alias: lne)(type, date, amount, code)
managers(status, type, code, level)
Task: Retrieve salary from items with value above the COUNT(salary) of managers rows sharing the same status.
SQL: | SELECT salary FROM items AS lne
WHERE value > (
SELECT COUNT(salary) FROM managers AS mgr
WHERE mgr.status = lne.status
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_09912 | train |
v2 | Schema:
departments (alias: dept)(code, id, type, amount)
orders(date, amount, name, salary)
Task: Retrieve name from departments that have at least one corresponding entry in orders sharing the same status.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09913 | train |
v3 | Schema:
departments (alias: dept)(amount, code, salary, id)
orders(code, value, level, date)
Task: Find id from departments where salary exceeds the minimum amount from orders for the same id.
SQL: | SELECT id FROM departments AS dept
WHERE salary > (
SELECT MIN(amount) FROM orders AS ord
WHERE ord.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09914 | train |
v3 | Schema:
projects (alias: prj)(status, value, amount, salary)
accounts(value, status, id, amount)
Task: Find salary from projects where amount exceeds the average value from accounts for the same code.
SQL: | SELECT salary FROM projects AS prj
WHERE amount > (
SELECT AVG(value) FROM accounts AS acct
WHERE acct.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_09915 | train |
v3 | Schema:
tasks (alias: tsk)(date, status, id, salary)
categories(salary, status, value, name)
Task: Retrieve code from tasks with value above the MIN(salary) of categories rows sharing the same code.
SQL: | SELECT code FROM tasks AS tsk
WHERE value > (
SELECT MIN(salary) FROM categories AS catg
WHERE catg.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_09916 | train |
v1 | Schema:
categories (alias: catg)(level, status, salary, date)
orders(name, level, amount, status)
Task: Find value from categories where status appears in orders entries with matching status.
SQL: | SELECT value FROM categories AS catg
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09917 | train |
v3 | Schema:
accounts (alias: acct)(date, code, amount, value)
tasks(code, id, value, date)
Task: Find value from accounts where value exceeds the minimum salary from tasks for the same code.
SQL: | SELECT value FROM accounts AS acct
WHERE value > (
SELECT MIN(salary) FROM tasks AS tsk
WHERE tsk.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09918 | train |
v2 | Schema:
accounts (alias: acct)(level, salary, id, value)
schedules(amount, code, salary, id)
Task: Find id from accounts where a matching record exists in schedules with the same code.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09919 | train |
v2 | Schema:
transactions (alias: txn)(value, id, type, amount)
branches(level, date, amount, salary)
Task: Retrieve salary from transactions that have at least one corresponding entry in branches sharing the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09920 | train |
v3 | Schema:
managers (alias: mgr)(status, type, level, value)
employees(date, level, code, type)
Task: Find value from managers where salary exceeds the minimum amount from employees for the same status.
SQL: | SELECT value FROM managers AS mgr
WHERE salary > (
SELECT MIN(amount) FROM employees AS emp
WHERE emp.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09921 | train |
v3 | Schema:
departments (alias: dept)(level, salary, value, type)
categories(type, code, value, date)
Task: Find value from departments where value exceeds the count of amount from categories for the same code.
SQL: | SELECT value FROM departments AS dept
WHERE value > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09922 | train |
v3 | Schema:
staff (alias: empl)(name, amount, id, status)
requests(amount, code, id, value)
Task: Retrieve code from staff with amount above the MIN(value) of requests rows sharing the same id.
SQL: | SELECT code FROM staff AS empl
WHERE amount > (
SELECT MIN(value) FROM requests AS ordr
WHERE ordr.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_09923 | train |
v3 | Schema:
accounts (alias: acct)(type, name, salary, date)
departments(level, value, salary, id)
Task: Retrieve code from accounts with salary above the AVG(salary) of departments rows sharing the same id.
SQL: | SELECT code FROM accounts AS acct
WHERE salary > (
SELECT AVG(salary) FROM departments AS dept
WHERE dept.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09924 | train |
v1 | Schema:
schedules (alias: schd)(amount, date, status, level)
categories(code, salary, date, level)
Task: Select name from schedules where type exists in categories for the same code.
SQL: | SELECT name FROM schedules AS schd
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09925 | train |
v3 | Schema:
schedules (alias: schd)(status, amount, value, salary)
branches(type, id, name, salary)
Task: Retrieve code from schedules with value above the AVG(salary) of branches rows sharing the same code.
SQL: | SELECT code FROM schedules AS schd
WHERE value > (
SELECT AVG(salary) FROM branches AS brc
WHERE brc.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09926 | train |
v2 | Schema:
staff (alias: empl)(status, salary, code, date)
accounts(name, type, status, salary)
Task: Find id from staff where a matching record exists in accounts with the same status.
SQL: | SELECT id 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": "id",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_09927 | train |
v2 | Schema:
departments (alias: dept)(code, status, value, id)
employees(salary, name, code, date)
Task: Retrieve code from departments that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09928 | train |
v1 | Schema:
managers (alias: mgr)(salary, type, amount, level)
sales(id, name, level, value)
Task: Find id from managers where level appears in sales entries with matching level.
SQL: | SELECT id FROM managers AS mgr
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09929 | train |
v3 | Schema:
requests (alias: ordr)(level, date, type, name)
transactions(salary, status, level, id)
Task: Retrieve code from requests with salary above the MIN(amount) of transactions rows sharing the same level.
SQL: | SELECT code FROM requests AS ordr
WHERE salary > (
SELECT MIN(amount) FROM transactions AS txn
WHERE txn.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_09930 | train |
v1 | Schema:
departments (alias: dept)(salary, code, level, name)
tasks(code, value, id, amount)
Task: Retrieve value from departments whose type is found in tasks rows where id matches the outer record.
SQL: | SELECT value FROM departments AS dept
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09931 | train |
v3 | Schema:
tasks (alias: tsk)(value, salary, code, name)
products(amount, salary, name, status)
Task: Retrieve value from tasks with salary above the MIN(amount) of products rows sharing the same status.
SQL: | SELECT value FROM tasks AS tsk
WHERE salary > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_09932 | train |
v1 | Schema:
departments (alias: dept)(id, salary, value, code)
orders(type, value, code, level)
Task: Find code from departments where code appears in orders entries with matching id.
SQL: | SELECT code FROM departments AS dept
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09933 | train |
v1 | Schema:
tasks (alias: tsk)(date, name, status, level)
projects(amount, level, date, name)
Task: Select value from tasks where type exists in projects for the same id.
SQL: | SELECT value FROM tasks AS tsk
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_09934 | train |
v2 | Schema:
requests (alias: ordr)(id, value, salary, status)
schedules(amount, status, type, value)
Task: Retrieve code from requests that have at least one corresponding entry in schedules sharing the same type.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_09935 | train |
v2 | Schema:
orders (alias: ord)(salary, name, id, date)
customers(level, salary, date, status)
Task: Retrieve value from orders that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09936 | train |
v1 | Schema:
accounts (alias: acct)(id, amount, salary, code)
shipments(amount, status, code, value)
Task: Select id from accounts where code exists in shipments for the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09937 | train |
v2 | Schema:
shipments (alias: shp)(level, status, code, value)
sales(value, salary, type, status)
Task: Find id from shipments where a matching record exists in sales with the same id.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09938 | train |
v2 | Schema:
branches (alias: brc)(value, status, salary, name)
orders(type, status, code, amount)
Task: Retrieve amount from branches that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_09939 | train |
v3 | Schema:
staff (alias: empl)(type, date, value, id)
sales(name, code, level, amount)
Task: Retrieve name from staff with salary above the SUM(amount) of sales rows sharing the same type.
SQL: | SELECT name FROM staff AS empl
WHERE salary > (
SELECT SUM(amount) FROM sales AS sale
WHERE sale.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_09940 | train |
v2 | Schema:
managers (alias: mgr)(date, amount, salary, type)
branches(amount, salary, code, status)
Task: Retrieve name from managers that have at least one corresponding entry in branches sharing the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09941 | train |
v2 | Schema:
schedules (alias: schd)(level, id, status, type)
regions(value, salary, amount, status)
Task: Retrieve name from schedules that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09942 | train |
v1 | Schema:
branches (alias: brc)(name, date, code, value)
tasks(amount, value, id, salary)
Task: Select amount from branches where code exists in tasks for the same code.
SQL: | SELECT amount FROM branches AS brc
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_09943 | train |
v2 | Schema:
invoices (alias: inv)(amount, id, level, salary)
orders(status, level, type, name)
Task: Retrieve name from invoices that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09944 | train |
v1 | Schema:
customers (alias: cust)(code, id, amount, type)
schedules(level, status, id, value)
Task: Find name from customers where status appears in schedules entries with matching level.
SQL: | SELECT name FROM customers AS cust
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09945 | train |
v1 | Schema:
transactions (alias: txn)(status, date, type, salary)
orders(code, date, status, value)
Task: Find code from transactions where id appears in orders entries with matching level.
SQL: | SELECT code FROM transactions AS txn
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09946 | train |
v2 | Schema:
projects (alias: prj)(level, value, type, status)
transactions(date, name, salary, status)
Task: Retrieve code from projects that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_09947 | train |
v1 | Schema:
products (alias: prod)(amount, name, status, date)
categories(date, code, status, type)
Task: Select salary from products where level exists in categories for the same type.
SQL: | SELECT salary FROM products AS prod
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.type = prod.type
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09948 | train |
v2 | Schema:
departments (alias: dept)(name, amount, value, date)
orders(value, date, salary, name)
Task: Retrieve id from departments that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09949 | train |
v2 | Schema:
accounts (alias: acct)(code, amount, value, status)
sales(code, status, level, name)
Task: Retrieve id from accounts that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09950 | train |
v1 | Schema:
products (alias: prod)(id, value, amount, status)
staff(id, level, salary, status)
Task: Select code from products where code exists in staff for the same type.
SQL: | SELECT code FROM products AS prod
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.type = prod.type
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09951 | train |
v1 | Schema:
transactions (alias: txn)(amount, level, code, id)
regions(date, code, id, name)
Task: Retrieve value from transactions whose type is found in regions rows where id matches the outer record.
SQL: | SELECT value FROM transactions AS txn
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09952 | train |
v3 | Schema:
shipments (alias: shp)(amount, salary, name, level)
schedules(code, id, status, level)
Task: Find salary from shipments where salary exceeds the total salary from schedules for the same level.
SQL: | SELECT salary FROM shipments AS shp
WHERE salary > (
SELECT SUM(salary) FROM schedules AS schd
WHERE schd.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09953 | train |
v3 | Schema:
orders (alias: ord)(date, id, type, name)
schedules(code, date, name, amount)
Task: Find id from orders where value exceeds the minimum salary from schedules for the same status.
SQL: | SELECT id FROM orders AS ord
WHERE value > (
SELECT MIN(salary) FROM schedules AS schd
WHERE schd.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09954 | train |
v3 | Schema:
customers (alias: cust)(level, id, status, date)
employees(name, salary, status, amount)
Task: Retrieve salary from customers with value above the COUNT(amount) of employees rows sharing the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE value > (
SELECT COUNT(amount) FROM employees AS emp
WHERE emp.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09955 | train |
v2 | Schema:
customers (alias: cust)(type, code, value, status)
sales(date, status, type, value)
Task: Retrieve salary from customers that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09956 | train |
v3 | Schema:
staff (alias: empl)(level, status, value, code)
sales(amount, value, code, salary)
Task: Retrieve salary from staff with value above the AVG(salary) of sales rows sharing the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE value > (
SELECT AVG(salary) FROM sales AS sale
WHERE sale.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_09957 | train |
v3 | Schema:
projects (alias: prj)(status, amount, name, value)
orders(date, name, amount, id)
Task: Retrieve value from projects with amount above the SUM(salary) of orders rows sharing the same id.
SQL: | SELECT value FROM projects AS prj
WHERE amount > (
SELECT SUM(salary) FROM orders AS ord
WHERE ord.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "orders",
"outer_alias": "prj",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_09958 | train |
v2 | Schema:
employees (alias: emp)(code, status, value, type)
transactions(salary, date, status, level)
Task: Retrieve name from employees that have at least one corresponding entry in transactions sharing the same code.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09959 | train |
v2 | Schema:
invoices (alias: inv)(name, salary, id, status)
regions(type, value, status, name)
Task: Retrieve name from invoices that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09960 | train |
v3 | Schema:
categories (alias: catg)(type, name, amount, level)
departments(name, salary, date, type)
Task: Retrieve code from categories with salary above the COUNT(value) of departments rows sharing the same code.
SQL: | SELECT code FROM categories AS catg
WHERE salary > (
SELECT COUNT(value) FROM departments AS dept
WHERE dept.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09961 | train |
v1 | Schema:
orders (alias: ord)(salary, value, name, id)
items(value, amount, salary, type)
Task: Select value from orders where status exists in items for the same status.
SQL: | SELECT value FROM orders AS ord
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09962 | train |
v3 | Schema:
projects (alias: prj)(id, type, name, date)
customers(level, amount, id, value)
Task: Retrieve id from projects with value above the COUNT(amount) of customers rows sharing the same type.
SQL: | SELECT id FROM projects AS prj
WHERE value > (
SELECT COUNT(amount) FROM customers AS cust
WHERE cust.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "prj",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_09963 | train |
v2 | Schema:
orders (alias: ord)(level, salary, code, type)
products(value, type, salary, status)
Task: Find amount from orders where a matching record exists in products with the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09964 | train |
v3 | Schema:
customers (alias: cust)(name, amount, level, code)
projects(type, level, salary, id)
Task: Find salary from customers where salary exceeds the maximum salary from projects for the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE salary > (
SELECT MAX(salary) FROM projects AS prj
WHERE prj.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09965 | train |
v2 | Schema:
invoices (alias: inv)(id, salary, level, status)
employees(salary, status, date, id)
Task: Retrieve id from invoices that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09966 | train |
v3 | Schema:
projects (alias: prj)(salary, amount, id, type)
sales(name, type, amount, code)
Task: Retrieve name from projects with amount above the SUM(value) of sales rows sharing the same status.
SQL: | SELECT name FROM projects AS prj
WHERE amount > (
SELECT SUM(value) FROM sales AS sale
WHERE sale.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_09967 | train |
v2 | Schema:
categories (alias: catg)(name, level, value, code)
projects(status, name, id, salary)
Task: Retrieve code from categories that have at least one corresponding entry in projects sharing the same level.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09968 | train |
v2 | Schema:
sales (alias: sale)(date, status, name, type)
projects(type, code, amount, status)
Task: Find salary from sales where a matching record exists in projects with the same id.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09969 | train |
v2 | Schema:
branches (alias: brc)(amount, type, status, id)
requests(level, date, amount, code)
Task: Retrieve code from branches that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_09970 | train |
v3 | Schema:
employees (alias: emp)(level, type, amount, salary)
items(salary, status, amount, id)
Task: Retrieve name from employees with value above the SUM(amount) of items rows sharing the same id.
SQL: | SELECT name FROM employees AS emp
WHERE value > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09971 | train |
v2 | Schema:
shipments (alias: shp)(salary, code, type, date)
staff(date, status, code, amount)
Task: Retrieve salary from shipments that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09972 | train |
v2 | Schema:
tasks (alias: tsk)(id, amount, salary, status)
customers(value, code, name, amount)
Task: Retrieve salary from tasks that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "tsk",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_09973 | train |
v3 | Schema:
employees (alias: emp)(type, name, value, salary)
items(name, status, value, level)
Task: Find code from employees where amount exceeds the maximum amount from items for the same type.
SQL: | SELECT code FROM employees AS emp
WHERE amount > (
SELECT MAX(amount) FROM items AS lne
WHERE lne.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09974 | train |
v3 | Schema:
staff (alias: empl)(status, value, amount, name)
shipments(code, type, status, id)
Task: Retrieve salary from staff with value above the AVG(value) of shipments rows sharing the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE value > (
SELECT AVG(value) FROM shipments AS shp
WHERE shp.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_09975 | train |
v1 | Schema:
transactions (alias: txn)(type, code, amount, value)
sales(salary, amount, status, level)
Task: Select code from transactions where code exists in sales for the same id.
SQL: | SELECT code FROM transactions AS txn
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09976 | train |
v3 | Schema:
sales (alias: sale)(level, status, amount, id)
regions(code, id, amount, date)
Task: Retrieve code from sales with salary above the SUM(amount) of regions rows sharing the same id.
SQL: | SELECT code FROM sales AS sale
WHERE salary > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09977 | train |
v1 | Schema:
requests (alias: ordr)(name, type, date, status)
tasks(date, name, status, amount)
Task: Select id from requests where id exists in tasks for the same status.
SQL: | SELECT id FROM requests AS ordr
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_09978 | train |
v2 | Schema:
schedules (alias: schd)(date, level, status, id)
branches(date, id, level, type)
Task: Retrieve name from schedules that have at least one corresponding entry in branches sharing the same level.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09979 | train |
v3 | Schema:
projects (alias: prj)(code, status, id, type)
transactions(amount, value, type, date)
Task: Find code from projects where value exceeds the minimum amount from transactions for the same id.
SQL: | SELECT code FROM projects AS prj
WHERE value > (
SELECT MIN(amount) FROM transactions AS txn
WHERE txn.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_09980 | train |
v2 | Schema:
products (alias: prod)(salary, date, amount, id)
shipments(id, code, value, status)
Task: Find salary from products where a matching record exists in shipments with the same status.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = prod.status
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09981 | train |
v1 | Schema:
employees (alias: emp)(status, code, salary, level)
branches(code, value, name, type)
Task: Retrieve value from employees whose id is found in branches rows where status matches the outer record.
SQL: | SELECT value FROM employees AS emp
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09982 | train |
v1 | Schema:
tasks (alias: tsk)(code, value, name, type)
schedules(level, salary, type, value)
Task: Retrieve id from tasks whose level is found in schedules rows where type matches the outer record.
SQL: | SELECT id FROM tasks AS tsk
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_09983 | train |
v2 | Schema:
orders (alias: ord)(amount, type, code, status)
staff(value, level, code, salary)
Task: Retrieve id from orders that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09984 | train |
v2 | Schema:
items (alias: lne)(value, level, code, type)
staff(level, amount, type, value)
Task: Find value from items where a matching record exists in staff with the same level.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = lne.level
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_09985 | train |
v1 | Schema:
accounts (alias: acct)(amount, status, level, name)
shipments(value, status, id, name)
Task: Retrieve amount from accounts whose status is found in shipments rows where id matches the outer record.
SQL: | SELECT amount FROM accounts AS acct
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09986 | train |
v2 | Schema:
shipments (alias: shp)(salary, value, code, id)
tasks(date, type, value, level)
Task: Retrieve code from shipments that have at least one corresponding entry in tasks sharing the same code.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09987 | train |
v2 | Schema:
invoices (alias: inv)(type, code, id, status)
departments(id, salary, level, date)
Task: Find amount from invoices where a matching record exists in departments with the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09988 | train |
v2 | Schema:
employees (alias: emp)(value, type, code, status)
branches(level, name, status, amount)
Task: Find value from employees where a matching record exists in branches with the same type.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09989 | train |
v3 | Schema:
projects (alias: prj)(level, date, salary, code)
branches(date, level, status, amount)
Task: Retrieve salary from projects with value above the MAX(value) of branches rows sharing the same status.
SQL: | SELECT salary FROM projects AS prj
WHERE value > (
SELECT MAX(value) FROM branches AS brc
WHERE brc.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_09990 | train |
v2 | Schema:
products (alias: prod)(name, salary, date, amount)
orders(code, status, type, salary)
Task: Retrieve id from products that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = prod.type
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09991 | train |
v3 | Schema:
invoices (alias: inv)(status, code, name, amount)
categories(amount, name, salary, code)
Task: Find salary from invoices where amount exceeds the minimum value from categories for the same status.
SQL: | SELECT salary FROM invoices AS inv
WHERE amount > (
SELECT MIN(value) FROM categories AS catg
WHERE catg.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09992 | train |
v2 | Schema:
categories (alias: catg)(salary, status, date, type)
branches(level, type, id, code)
Task: Find value from categories where a matching record exists in branches with the same code.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09993 | train |
v2 | Schema:
requests (alias: ordr)(value, level, type, id)
regions(type, id, status, date)
Task: Retrieve name from requests that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_09994 | train |
v3 | Schema:
customers (alias: cust)(id, amount, status, date)
staff(type, level, code, salary)
Task: Retrieve id from customers with amount above the MIN(amount) of staff rows sharing the same code.
SQL: | SELECT id FROM customers AS cust
WHERE amount > (
SELECT MIN(amount) FROM staff AS empl
WHERE empl.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09995 | train |
v2 | Schema:
items (alias: lne)(id, amount, code, name)
tasks(salary, status, date, value)
Task: Find code from items where a matching record exists in tasks with the same id.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = lne.id
); | {
"outer_table": "items",
"inner_table": "tasks",
"outer_alias": "lne",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_09996 | train |
v3 | Schema:
orders (alias: ord)(code, date, value, salary)
products(id, date, level, code)
Task: Find amount from orders where salary exceeds the total value from products for the same type.
SQL: | SELECT amount FROM orders AS ord
WHERE salary > (
SELECT SUM(value) FROM products AS prod
WHERE prod.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09997 | train |
v2 | Schema:
employees (alias: emp)(level, amount, name, id)
schedules(code, value, id, status)
Task: Find salary from employees where a matching record exists in schedules with the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09998 | train |
v2 | Schema:
staff (alias: empl)(date, code, salary, level)
shipments(value, id, code, level)
Task: Find salary from staff where a matching record exists in shipments with the same type.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_09999 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.