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:
shipments (alias: shp)(id, status, level, date)
departments(date, type, salary, level)
Task: Retrieve value from shipments that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07400 | train |
v2 | Schema:
requests (alias: ordr)(amount, level, value, id)
schedules(id, level, type, code)
Task: Retrieve value from requests that have at least one corresponding entry in schedules sharing the same level.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07401 | train |
v3 | Schema:
schedules (alias: schd)(amount, level, status, salary)
transactions(id, type, name, salary)
Task: Find name from schedules where value exceeds the total salary from transactions for the same code.
SQL: | SELECT name FROM schedules AS schd
WHERE value > (
SELECT SUM(salary) FROM transactions AS txn
WHERE txn.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07402 | train |
v3 | Schema:
invoices (alias: inv)(salary, amount, level, status)
orders(value, code, date, id)
Task: Find amount from invoices where amount exceeds the minimum amount from orders for the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE amount > (
SELECT MIN(amount) FROM orders AS ord
WHERE ord.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07403 | train |
v3 | Schema:
accounts (alias: acct)(status, code, name, level)
projects(date, level, name, salary)
Task: Find id from accounts where amount exceeds the total salary from projects for the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE amount > (
SELECT SUM(salary) FROM projects AS prj
WHERE prj.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07404 | train |
v1 | Schema:
products (alias: prod)(id, type, amount, name)
tasks(salary, amount, value, date)
Task: Retrieve value from products whose type is found in tasks rows where status matches the outer record.
SQL: | SELECT value FROM products AS prod
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.status = prod.status
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07405 | train |
v3 | Schema:
categories (alias: catg)(status, id, date, type)
products(date, level, status, code)
Task: Retrieve code from categories with amount above the AVG(amount) of products rows sharing the same id.
SQL: | SELECT code FROM categories AS catg
WHERE amount > (
SELECT AVG(amount) FROM products AS prod
WHERE prod.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07406 | train |
v2 | Schema:
accounts (alias: acct)(value, date, type, amount)
schedules(salary, status, date, level)
Task: Retrieve amount from accounts that have at least one corresponding entry in schedules sharing the same status.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07407 | train |
v2 | Schema:
customers (alias: cust)(status, id, date, level)
schedules(name, level, id, date)
Task: Find id from customers where a matching record exists in schedules with the same id.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07408 | train |
v2 | Schema:
sales (alias: sale)(name, date, value, status)
items(name, salary, status, amount)
Task: Retrieve value from sales that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07409 | train |
v2 | Schema:
accounts (alias: acct)(level, date, code, value)
categories(id, value, type, salary)
Task: Retrieve amount from accounts that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07410 | train |
v3 | Schema:
categories (alias: catg)(amount, value, type, code)
regions(type, amount, value, id)
Task: Retrieve name from categories with amount above the SUM(amount) of regions rows sharing the same code.
SQL: | SELECT name FROM categories AS catg
WHERE amount > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07411 | train |
v2 | Schema:
schedules (alias: schd)(salary, level, type, date)
transactions(status, amount, type, id)
Task: Find code from schedules where a matching record exists in transactions with the same code.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07412 | train |
v1 | Schema:
tasks (alias: tsk)(salary, date, status, value)
invoices(salary, status, level, type)
Task: Find name from tasks where type appears in invoices entries with matching id.
SQL: | SELECT name FROM tasks AS tsk
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07413 | train |
v2 | Schema:
invoices (alias: inv)(type, name, code, id)
tasks(date, amount, id, level)
Task: Find salary from invoices where a matching record exists in tasks with the same id.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07414 | train |
v3 | Schema:
shipments (alias: shp)(level, code, value, salary)
tasks(salary, amount, level, id)
Task: Find id from shipments where salary exceeds the count of salary from tasks for the same type.
SQL: | SELECT id FROM shipments AS shp
WHERE salary > (
SELECT COUNT(salary) FROM tasks AS tsk
WHERE tsk.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07415 | train |
v2 | Schema:
orders (alias: ord)(code, salary, status, level)
schedules(date, amount, salary, type)
Task: Retrieve value from orders that have at least one corresponding entry in schedules sharing the same status.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07416 | train |
v2 | Schema:
schedules (alias: schd)(id, salary, date, value)
transactions(date, status, value, salary)
Task: Find value from schedules where a matching record exists in transactions with the same level.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07417 | train |
v3 | Schema:
categories (alias: catg)(level, type, value, status)
transactions(value, name, id, status)
Task: Find salary from categories where value exceeds the minimum amount from transactions for the same code.
SQL: | SELECT salary FROM categories AS catg
WHERE value > (
SELECT MIN(amount) FROM transactions AS txn
WHERE txn.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07418 | train |
v1 | Schema:
schedules (alias: schd)(code, type, status, date)
departments(value, date, type, amount)
Task: Select id from schedules where status exists in departments for the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07419 | train |
v1 | Schema:
orders (alias: ord)(code, status, value, level)
managers(value, code, id, date)
Task: Find name from orders where level appears in managers entries with matching level.
SQL: | SELECT name FROM orders AS ord
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07420 | train |
v3 | Schema:
regions (alias: rgn)(type, amount, value, salary)
requests(id, date, code, type)
Task: Find amount from regions where salary exceeds the count of value from requests for the same type.
SQL: | SELECT amount FROM regions AS rgn
WHERE salary > (
SELECT COUNT(value) FROM requests AS ordr
WHERE ordr.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07421 | train |
v1 | Schema:
regions (alias: rgn)(status, name, id, date)
projects(value, code, level, name)
Task: Find name from regions where code appears in projects entries with matching status.
SQL: | SELECT name FROM regions AS rgn
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07422 | train |
v1 | Schema:
customers (alias: cust)(level, date, amount, type)
managers(type, salary, level, code)
Task: Retrieve id from customers whose id is found in managers rows where id matches the outer record.
SQL: | SELECT id FROM customers AS cust
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07423 | train |
v2 | Schema:
invoices (alias: inv)(value, id, type, level)
accounts(code, value, amount, id)
Task: Retrieve code from invoices that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07424 | train |
v2 | Schema:
accounts (alias: acct)(amount, level, code, id)
departments(status, date, code, value)
Task: Find id from accounts where a matching record exists in departments with the same level.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07425 | train |
v3 | Schema:
branches (alias: brc)(status, date, salary, type)
employees(date, status, name, id)
Task: Find id from branches where amount exceeds the total value from employees for the same id.
SQL: | SELECT id FROM branches AS brc
WHERE amount > (
SELECT SUM(value) FROM employees AS emp
WHERE emp.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07426 | train |
v2 | Schema:
employees (alias: emp)(id, date, code, salary)
tasks(status, value, amount, name)
Task: Retrieve salary from employees that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07427 | train |
v2 | Schema:
items (alias: lne)(id, name, level, status)
branches(type, salary, amount, value)
Task: Find code from items where a matching record exists in branches with the same level.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = lne.level
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07428 | train |
v3 | Schema:
items (alias: lne)(id, value, name, amount)
orders(status, id, level, code)
Task: Find salary from items where value exceeds the total value from orders for the same type.
SQL: | SELECT salary FROM items AS lne
WHERE value > (
SELECT SUM(value) FROM orders AS ord
WHERE ord.type = lne.type
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07429 | train |
v2 | Schema:
accounts (alias: acct)(date, status, type, amount)
orders(name, id, type, date)
Task: Retrieve id from accounts that have at least one corresponding entry in orders sharing the same status.
SQL: | SELECT id 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": "id",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07430 | train |
v2 | Schema:
requests (alias: ordr)(value, salary, name, status)
items(value, level, amount, id)
Task: Retrieve salary from requests that have at least one corresponding entry in items sharing the same code.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07431 | train |
v3 | Schema:
accounts (alias: acct)(level, amount, value, name)
items(salary, id, level, type)
Task: Retrieve code from accounts with value above the COUNT(salary) of items rows sharing the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE value > (
SELECT COUNT(salary) FROM items AS lne
WHERE lne.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07432 | train |
v3 | Schema:
shipments (alias: shp)(value, status, type, id)
projects(date, name, salary, amount)
Task: Retrieve amount from shipments with amount above the MAX(salary) of projects rows sharing the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE amount > (
SELECT MAX(salary) FROM projects AS prj
WHERE prj.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07433 | train |
v3 | Schema:
items (alias: lne)(date, code, name, status)
categories(type, id, code, status)
Task: Find salary from items where value exceeds the count of salary from categories for the same code.
SQL: | SELECT salary FROM items AS lne
WHERE value > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.code = lne.code
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07434 | train |
v2 | Schema:
invoices (alias: inv)(status, type, id, date)
employees(amount, id, type, date)
Task: Retrieve salary from invoices that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07435 | train |
v1 | Schema:
employees (alias: emp)(salary, level, code, value)
invoices(type, name, date, salary)
Task: Find code from employees where code appears in invoices entries with matching id.
SQL: | SELECT code FROM employees AS emp
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07436 | train |
v3 | Schema:
sales (alias: sale)(amount, value, name, date)
regions(type, name, id, value)
Task: Retrieve salary from sales with salary above the AVG(value) of regions rows sharing the same type.
SQL: | SELECT salary FROM sales AS sale
WHERE salary > (
SELECT AVG(value) FROM regions AS rgn
WHERE rgn.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07437 | train |
v1 | Schema:
projects (alias: prj)(level, id, status, salary)
regions(date, name, type, id)
Task: Retrieve salary from projects whose type is found in regions rows where id matches the outer record.
SQL: | SELECT salary FROM projects AS prj
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07438 | train |
v2 | Schema:
orders (alias: ord)(status, amount, name, date)
managers(amount, status, id, value)
Task: Retrieve code from orders that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07439 | train |
v3 | Schema:
accounts (alias: acct)(amount, id, value, type)
shipments(level, code, amount, value)
Task: Retrieve name from accounts with value above the SUM(amount) of shipments rows sharing the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE value > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07440 | train |
v1 | Schema:
orders (alias: ord)(type, value, status, salary)
schedules(salary, value, date, level)
Task: Retrieve salary from orders whose status is found in schedules rows where id matches the outer record.
SQL: | SELECT salary FROM orders AS ord
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07441 | train |
v2 | Schema:
employees (alias: emp)(date, salary, name, status)
managers(type, id, code, amount)
Task: Retrieve id from employees that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07442 | train |
v3 | Schema:
managers (alias: mgr)(id, date, salary, type)
customers(salary, amount, level, status)
Task: Find amount from managers where amount exceeds the maximum salary from customers for the same status.
SQL: | SELECT amount FROM managers AS mgr
WHERE amount > (
SELECT MAX(salary) FROM customers AS cust
WHERE cust.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07443 | train |
v3 | Schema:
requests (alias: ordr)(type, level, date, amount)
schedules(name, level, id, type)
Task: Find salary from requests where salary exceeds the minimum salary from schedules for the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE salary > (
SELECT MIN(salary) FROM schedules AS schd
WHERE schd.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07444 | train |
v1 | Schema:
staff (alias: empl)(value, code, level, date)
categories(salary, code, value, date)
Task: Find code from staff where type appears in categories entries with matching status.
SQL: | SELECT code FROM staff AS empl
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07445 | train |
v2 | Schema:
items (alias: lne)(type, name, value, code)
projects(code, type, status, salary)
Task: Find code from items where a matching record exists in projects with the same id.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = lne.id
); | {
"outer_table": "items",
"inner_table": "projects",
"outer_alias": "lne",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07446 | train |
v3 | Schema:
items (alias: lne)(amount, value, type, level)
managers(date, level, status, name)
Task: Retrieve code from items with salary above the SUM(amount) of managers rows sharing the same status.
SQL: | SELECT code FROM items AS lne
WHERE salary > (
SELECT SUM(amount) FROM managers AS mgr
WHERE mgr.status = lne.status
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07447 | train |
v2 | Schema:
categories (alias: catg)(status, value, code, level)
products(value, type, code, status)
Task: Retrieve value from categories that have at least one corresponding entry in products sharing the same type.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07448 | train |
v2 | Schema:
items (alias: lne)(value, level, name, amount)
schedules(amount, level, date, id)
Task: Find salary from items where a matching record exists in schedules with the same id.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = lne.id
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07449 | train |
v1 | Schema:
schedules (alias: schd)(value, salary, name, status)
accounts(level, id, amount, salary)
Task: Retrieve code from schedules whose level is found in accounts rows where code matches the outer record.
SQL: | SELECT code FROM schedules AS schd
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07450 | train |
v1 | Schema:
items (alias: lne)(name, status, code, type)
accounts(date, id, salary, status)
Task: Find amount from items where status appears in accounts entries with matching level.
SQL: | SELECT amount FROM items AS lne
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.level = lne.level
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07451 | train |
v1 | Schema:
projects (alias: prj)(value, amount, status, name)
categories(id, name, value, amount)
Task: Select salary from projects where type exists in categories for the same level.
SQL: | SELECT salary FROM projects AS prj
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07452 | train |
v2 | Schema:
tasks (alias: tsk)(id, value, salary, level)
requests(type, level, code, date)
Task: Find id from tasks where a matching record exists in requests with the same code.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07453 | train |
v1 | Schema:
departments (alias: dept)(salary, name, date, status)
managers(type, status, date, level)
Task: Retrieve id from departments whose status is found in managers rows where id matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07454 | train |
v1 | Schema:
schedules (alias: schd)(date, type, id, code)
invoices(level, value, salary, amount)
Task: Find value from schedules where code appears in invoices entries with matching code.
SQL: | SELECT value FROM schedules AS schd
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07455 | train |
v2 | Schema:
departments (alias: dept)(status, level, value, salary)
shipments(id, amount, status, value)
Task: Retrieve amount from departments that have at least one corresponding entry in shipments sharing the same level.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07456 | train |
v2 | Schema:
requests (alias: ordr)(type, salary, status, level)
branches(salary, status, date, name)
Task: Retrieve salary from requests that have at least one corresponding entry in branches sharing the same type.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07457 | train |
v1 | Schema:
transactions (alias: txn)(salary, date, value, type)
accounts(salary, type, value, level)
Task: Retrieve id from transactions whose level is found in accounts rows where code matches the outer record.
SQL: | SELECT id FROM transactions AS txn
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07458 | train |
v2 | Schema:
shipments (alias: shp)(date, id, name, salary)
products(value, status, type, date)
Task: Find name from shipments where a matching record exists in products with the same code.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07459 | train |
v3 | Schema:
accounts (alias: acct)(status, salary, name, level)
requests(date, level, amount, value)
Task: Retrieve amount from accounts with value above the MAX(salary) of requests rows sharing the same level.
SQL: | SELECT amount FROM accounts AS acct
WHERE value > (
SELECT MAX(salary) FROM requests AS ordr
WHERE ordr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07460 | train |
v2 | Schema:
sales (alias: sale)(code, salary, name, date)
transactions(level, amount, value, date)
Task: Find id from sales where a matching record exists in transactions with the same code.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07461 | train |
v2 | Schema:
sales (alias: sale)(date, level, type, id)
customers(salary, code, level, amount)
Task: Find amount from sales where a matching record exists in customers with the same status.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07462 | train |
v3 | Schema:
branches (alias: brc)(status, value, name, date)
invoices(value, date, amount, status)
Task: Retrieve id from branches with amount above the AVG(value) of invoices rows sharing the same level.
SQL: | SELECT id FROM branches AS brc
WHERE amount > (
SELECT AVG(value) FROM invoices AS inv
WHERE inv.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07463 | train |
v2 | Schema:
employees (alias: emp)(salary, code, id, value)
orders(salary, amount, name, type)
Task: Retrieve amount from employees that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07464 | train |
v3 | Schema:
branches (alias: brc)(value, name, status, level)
requests(level, value, status, type)
Task: Find salary from branches where value exceeds the total value from requests for the same code.
SQL: | SELECT salary FROM branches AS brc
WHERE value > (
SELECT SUM(value) FROM requests AS ordr
WHERE ordr.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07465 | train |
v3 | Schema:
staff (alias: empl)(salary, code, status, level)
requests(name, id, value, code)
Task: Find salary from staff where value exceeds the maximum salary from requests for the same status.
SQL: | SELECT salary FROM staff AS empl
WHERE value > (
SELECT MAX(salary) FROM requests AS ordr
WHERE ordr.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07466 | train |
v2 | Schema:
orders (alias: ord)(code, type, status, name)
staff(salary, type, amount, level)
Task: Find name from orders where a matching record exists in staff with the same id.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07467 | train |
v2 | Schema:
staff (alias: empl)(date, level, name, salary)
employees(level, amount, date, name)
Task: Find id from staff where a matching record exists in employees with the same type.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07468 | train |
v2 | Schema:
customers (alias: cust)(name, type, date, amount)
departments(id, type, level, salary)
Task: Find id from customers where a matching record exists in departments with the same id.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07469 | train |
v3 | Schema:
branches (alias: brc)(id, type, salary, level)
sales(id, type, date, value)
Task: Retrieve code from branches with salary above the SUM(amount) of sales rows sharing the same type.
SQL: | SELECT code FROM branches AS brc
WHERE salary > (
SELECT SUM(amount) FROM sales AS sale
WHERE sale.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07470 | train |
v1 | Schema:
items (alias: lne)(date, code, salary, amount)
regions(salary, value, level, type)
Task: Find salary from items where type appears in regions entries with matching code.
SQL: | SELECT salary FROM items AS lne
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.code = lne.code
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07471 | train |
v2 | Schema:
schedules (alias: schd)(code, date, salary, value)
branches(date, name, salary, code)
Task: Retrieve amount from schedules that have at least one corresponding entry in branches sharing the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07472 | train |
v2 | Schema:
shipments (alias: shp)(name, value, code, level)
items(level, salary, id, value)
Task: Retrieve id from shipments that have at least one corresponding entry in items sharing the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07473 | train |
v3 | Schema:
schedules (alias: schd)(status, date, salary, id)
projects(id, name, status, amount)
Task: Retrieve salary from schedules with amount above the MIN(amount) of projects rows sharing the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE amount > (
SELECT MIN(amount) FROM projects AS prj
WHERE prj.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07474 | train |
v3 | Schema:
sales (alias: sale)(status, name, code, value)
staff(id, salary, type, status)
Task: Find value from sales where salary exceeds the minimum amount from staff for the same id.
SQL: | SELECT value FROM sales AS sale
WHERE salary > (
SELECT MIN(amount) FROM staff AS empl
WHERE empl.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07475 | train |
v1 | Schema:
requests (alias: ordr)(name, id, date, amount)
accounts(amount, type, value, date)
Task: Retrieve salary from requests whose status is found in accounts rows where level matches the outer record.
SQL: | SELECT salary FROM requests AS ordr
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07476 | train |
v3 | Schema:
employees (alias: emp)(code, salary, type, amount)
sales(type, name, level, status)
Task: Find amount from employees where amount exceeds the maximum amount from sales for the same code.
SQL: | SELECT amount FROM employees AS emp
WHERE amount > (
SELECT MAX(amount) FROM sales AS sale
WHERE sale.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07477 | train |
v1 | Schema:
shipments (alias: shp)(id, date, name, type)
sales(level, salary, status, id)
Task: Retrieve name from shipments whose level is found in sales rows where status matches the outer record.
SQL: | SELECT name FROM shipments AS shp
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07478 | train |
v1 | Schema:
requests (alias: ordr)(type, code, level, id)
schedules(code, salary, date, value)
Task: Retrieve name from requests whose type is found in schedules rows where status matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07479 | train |
v2 | Schema:
invoices (alias: inv)(code, level, type, salary)
shipments(type, salary, id, amount)
Task: Retrieve id from invoices that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07480 | train |
v2 | Schema:
staff (alias: empl)(amount, type, salary, id)
branches(status, date, amount, id)
Task: Retrieve value from staff that have at least one corresponding entry in branches sharing the same status.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07481 | train |
v2 | Schema:
accounts (alias: acct)(id, name, status, type)
categories(status, salary, name, level)
Task: Retrieve salary from accounts that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07482 | train |
v2 | Schema:
products (alias: prod)(level, status, code, amount)
regions(id, amount, status, date)
Task: Find code from products where a matching record exists in regions with the same type.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = prod.type
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07483 | train |
v1 | Schema:
shipments (alias: shp)(level, code, amount, name)
requests(code, salary, date, name)
Task: Select id from shipments where status exists in requests for the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07484 | train |
v3 | Schema:
departments (alias: dept)(amount, name, id, code)
regions(level, status, id, salary)
Task: Find code from departments where salary exceeds the count of salary from regions for the same code.
SQL: | SELECT code FROM departments AS dept
WHERE salary > (
SELECT COUNT(salary) FROM regions AS rgn
WHERE rgn.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07485 | train |
v1 | Schema:
products (alias: prod)(date, amount, status, code)
schedules(id, salary, status, date)
Task: Find value from products where type appears in schedules entries with matching status.
SQL: | SELECT value FROM products AS prod
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.status = prod.status
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07486 | train |
v2 | Schema:
tasks (alias: tsk)(name, level, date, type)
sales(level, value, amount, status)
Task: Retrieve id from tasks that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07487 | train |
v3 | Schema:
sales (alias: sale)(date, status, code, level)
transactions(salary, date, id, type)
Task: Find value from sales where amount exceeds the maximum salary from transactions for the same level.
SQL: | SELECT value FROM sales AS sale
WHERE amount > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07488 | train |
v1 | Schema:
schedules (alias: schd)(id, amount, date, level)
transactions(status, amount, date, salary)
Task: Retrieve name from schedules whose status is found in transactions rows where status matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07489 | train |
v2 | Schema:
customers (alias: cust)(status, level, salary, code)
projects(salary, status, value, amount)
Task: Retrieve code from customers that have at least one corresponding entry in projects sharing the same id.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07490 | train |
v2 | Schema:
items (alias: lne)(name, level, status, date)
orders(amount, date, status, type)
Task: Retrieve amount from items that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = lne.id
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07491 | train |
v1 | Schema:
invoices (alias: inv)(id, salary, code, name)
branches(value, salary, date, id)
Task: Select code from invoices where type exists in branches for the same id.
SQL: | SELECT code FROM invoices AS inv
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07492 | train |
v1 | Schema:
regions (alias: rgn)(type, date, value, amount)
shipments(status, code, value, salary)
Task: Retrieve name from regions whose type is found in shipments rows where code matches the outer record.
SQL: | SELECT name FROM regions AS rgn
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07493 | train |
v2 | Schema:
departments (alias: dept)(value, level, code, amount)
projects(amount, status, code, type)
Task: Retrieve amount from departments that have at least one corresponding entry in projects sharing the same level.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07494 | train |
v3 | Schema:
employees (alias: emp)(value, type, date, level)
sales(amount, id, value, type)
Task: Find code from employees where amount exceeds the count of amount from sales for the same type.
SQL: | SELECT code FROM employees AS emp
WHERE amount > (
SELECT COUNT(amount) FROM sales AS sale
WHERE sale.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07495 | train |
v1 | Schema:
managers (alias: mgr)(name, type, status, value)
branches(value, name, type, date)
Task: Select value from managers where id exists in branches for the same code.
SQL: | SELECT value FROM managers AS mgr
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07496 | train |
v1 | Schema:
requests (alias: ordr)(type, name, value, salary)
staff(amount, date, level, code)
Task: Retrieve id from requests whose status is found in staff rows where code matches the outer record.
SQL: | SELECT id FROM requests AS ordr
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07497 | train |
v3 | Schema:
categories (alias: catg)(value, status, code, name)
shipments(amount, salary, name, date)
Task: Find salary from categories where value exceeds the maximum amount from shipments for the same code.
SQL: | SELECT salary FROM categories AS catg
WHERE value > (
SELECT MAX(amount) FROM shipments AS shp
WHERE shp.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07498 | train |
v1 | Schema:
tasks (alias: tsk)(salary, type, date, id)
schedules(level, value, amount, id)
Task: Select amount from tasks where level exists in schedules for the same status.
SQL: | SELECT amount FROM tasks AS tsk
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07499 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.