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:
transactions (alias: txn)(value, date, code, level)
shipments(name, type, value, amount)
Task: Retrieve value from transactions that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17800 | train |
v3 | Schema:
sales (alias: sale)(code, status, date, type)
requests(id, date, status, level)
Task: Retrieve code from sales with amount above the MAX(salary) of requests rows sharing the same type.
SQL: | SELECT code FROM sales AS sale
WHERE amount > (
SELECT MAX(salary) FROM requests AS ordr
WHERE ordr.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17801 | train |
v2 | Schema:
regions (alias: rgn)(name, code, id, amount)
employees(value, name, date, status)
Task: Retrieve code from regions that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17802 | train |
v3 | Schema:
invoices (alias: inv)(status, date, value, code)
accounts(id, amount, code, date)
Task: Find id from invoices where salary exceeds the maximum value from accounts for the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE salary > (
SELECT MAX(value) FROM accounts AS acct
WHERE acct.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17803 | train |
v1 | Schema:
invoices (alias: inv)(type, id, code, salary)
regions(level, name, date, amount)
Task: Retrieve amount from invoices whose code is found in regions rows where type matches the outer record.
SQL: | SELECT amount FROM invoices AS inv
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17804 | train |
v2 | Schema:
staff (alias: empl)(amount, salary, type, id)
branches(status, amount, name, type)
Task: Retrieve code from staff that have at least one corresponding entry in branches sharing the same id.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17805 | train |
v3 | Schema:
staff (alias: empl)(salary, code, amount, date)
products(id, type, salary, code)
Task: Retrieve salary from staff with salary above the MIN(amount) of products rows sharing the same type.
SQL: | SELECT salary FROM staff AS empl
WHERE salary > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17806 | train |
v2 | Schema:
shipments (alias: shp)(code, status, name, amount)
products(code, name, date, id)
Task: Retrieve value from shipments that have at least one corresponding entry in products sharing the same type.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17807 | train |
v2 | Schema:
transactions (alias: txn)(value, code, date, salary)
products(status, salary, type, code)
Task: Find id from transactions where a matching record exists in products with the same type.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17808 | train |
v1 | Schema:
categories (alias: catg)(name, level, value, salary)
tasks(code, date, salary, amount)
Task: Retrieve value from categories whose type is found in tasks rows where type matches the outer record.
SQL: | SELECT value FROM categories AS catg
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17809 | train |
v1 | Schema:
regions (alias: rgn)(date, name, value, type)
requests(level, type, name, id)
Task: Find amount from regions where type appears in requests entries with matching status.
SQL: | SELECT amount FROM regions AS rgn
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17810 | train |
v3 | Schema:
invoices (alias: inv)(level, name, status, type)
categories(name, salary, level, code)
Task: Find id from invoices where value exceeds the count of salary from categories for the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE value > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17811 | train |
v2 | Schema:
sales (alias: sale)(date, value, code, salary)
invoices(salary, code, name, date)
Task: Retrieve salary from sales that have at least one corresponding entry in invoices sharing the same level.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17812 | train |
v2 | Schema:
tasks (alias: tsk)(type, value, id, level)
requests(code, id, type, status)
Task: Find amount from tasks where a matching record exists in requests with the same type.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17813 | train |
v1 | Schema:
shipments (alias: shp)(status, value, id, date)
requests(type, value, level, status)
Task: Select code from shipments where id exists in requests for the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17814 | train |
v1 | Schema:
requests (alias: ordr)(amount, type, salary, code)
schedules(date, code, name, value)
Task: Retrieve value from requests whose status is found in schedules rows where level matches the outer record.
SQL: | SELECT value FROM requests AS ordr
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17815 | train |
v1 | Schema:
transactions (alias: txn)(code, name, amount, date)
categories(level, type, name, value)
Task: Find id from transactions where level appears in categories entries with matching code.
SQL: | SELECT id FROM transactions AS txn
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17816 | train |
v1 | Schema:
staff (alias: empl)(code, status, level, amount)
tasks(type, level, amount, code)
Task: Retrieve salary from staff whose level is found in tasks rows where id matches the outer record.
SQL: | SELECT salary FROM staff AS empl
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17817 | train |
v1 | Schema:
products (alias: prod)(code, status, level, amount)
requests(status, type, level, name)
Task: Find salary from products where code appears in requests entries with matching level.
SQL: | SELECT salary FROM products AS prod
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17818 | train |
v3 | Schema:
tasks (alias: tsk)(value, amount, date, id)
categories(value, id, code, date)
Task: Retrieve amount from tasks with salary above the MAX(salary) of categories rows sharing the same level.
SQL: | SELECT amount FROM tasks AS tsk
WHERE salary > (
SELECT MAX(salary) FROM categories AS catg
WHERE catg.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17819 | train |
v1 | Schema:
branches (alias: brc)(date, id, code, name)
orders(salary, date, level, id)
Task: Select salary from branches where status exists in orders for the same status.
SQL: | SELECT salary FROM branches AS brc
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17820 | train |
v1 | Schema:
staff (alias: empl)(type, date, amount, level)
customers(level, code, status, value)
Task: Select id from staff where id exists in customers for the same level.
SQL: | SELECT id FROM staff AS empl
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17821 | train |
v3 | Schema:
staff (alias: empl)(type, date, salary, value)
tasks(salary, amount, name, value)
Task: Find amount from staff where value exceeds the minimum amount from tasks for the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE value > (
SELECT MIN(amount) FROM tasks AS tsk
WHERE tsk.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17822 | train |
v3 | Schema:
requests (alias: ordr)(salary, amount, type, code)
schedules(amount, level, status, date)
Task: Retrieve amount from requests with amount above the MIN(value) of schedules rows sharing the same status.
SQL: | SELECT amount FROM requests AS ordr
WHERE amount > (
SELECT MIN(value) FROM schedules AS schd
WHERE schd.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17823 | train |
v1 | Schema:
customers (alias: cust)(value, name, date, level)
shipments(amount, status, code, date)
Task: Select value from customers where id exists in shipments for the same level.
SQL: | SELECT value FROM customers AS cust
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17824 | train |
v2 | Schema:
transactions (alias: txn)(status, value, amount, date)
sales(type, value, level, code)
Task: Find salary from transactions where a matching record exists in sales with the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17825 | train |
v1 | Schema:
products (alias: prod)(salary, value, status, level)
projects(amount, type, date, id)
Task: Find id from products where id appears in projects entries with matching id.
SQL: | SELECT id FROM products AS prod
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.id = prod.id
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "prod",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17826 | train |
v3 | Schema:
products (alias: prod)(salary, name, date, type)
tasks(value, code, type, name)
Task: Find name from products where amount exceeds the count of value from tasks for the same status.
SQL: | SELECT name FROM products AS prod
WHERE amount > (
SELECT COUNT(value) FROM tasks AS tsk
WHERE tsk.status = prod.status
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17827 | train |
v3 | Schema:
customers (alias: cust)(type, level, value, id)
sales(level, type, code, value)
Task: Retrieve value from customers with value above the AVG(amount) of sales rows sharing the same id.
SQL: | SELECT value FROM customers AS cust
WHERE value > (
SELECT AVG(amount) FROM sales AS sale
WHERE sale.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17828 | train |
v3 | Schema:
accounts (alias: acct)(level, code, amount, id)
departments(type, id, value, name)
Task: Retrieve code from accounts with salary above the SUM(amount) of departments rows sharing the same id.
SQL: | SELECT code FROM accounts AS acct
WHERE salary > (
SELECT SUM(amount) 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": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17829 | train |
v3 | Schema:
orders (alias: ord)(code, name, value, type)
items(amount, salary, name, date)
Task: Retrieve salary from orders with salary above the COUNT(value) of items rows sharing the same type.
SQL: | SELECT salary FROM orders AS ord
WHERE salary > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17830 | train |
v2 | Schema:
shipments (alias: shp)(value, amount, id, salary)
employees(code, value, date, type)
Task: Retrieve value from shipments that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17831 | train |
v1 | Schema:
accounts (alias: acct)(id, date, level, status)
branches(salary, id, amount, value)
Task: Select value from accounts where type exists in branches for the same level.
SQL: | SELECT value FROM accounts AS acct
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17832 | train |
v1 | Schema:
products (alias: prod)(value, amount, code, status)
tasks(level, amount, status, type)
Task: Find value from products where type appears in tasks entries with matching status.
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_17833 | train |
v3 | Schema:
branches (alias: brc)(id, status, code, salary)
schedules(name, salary, amount, status)
Task: Retrieve salary from branches with salary above the AVG(salary) of schedules rows sharing the same code.
SQL: | SELECT salary FROM branches AS brc
WHERE salary > (
SELECT AVG(salary) FROM schedules AS schd
WHERE schd.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "schedules",
"outer_alias": "brc",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17834 | train |
v3 | Schema:
branches (alias: brc)(status, value, salary, code)
items(salary, id, amount, date)
Task: Find id from branches where amount exceeds the minimum value from items for the same type.
SQL: | SELECT id FROM branches AS brc
WHERE amount > (
SELECT MIN(value) FROM items AS lne
WHERE lne.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17835 | train |
v2 | Schema:
customers (alias: cust)(name, level, salary, status)
orders(name, status, id, code)
Task: Retrieve id from customers that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17836 | train |
v2 | Schema:
categories (alias: catg)(code, id, amount, value)
transactions(level, date, code, type)
Task: Find code from categories where a matching record exists in transactions with the same level.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17837 | train |
v1 | Schema:
schedules (alias: schd)(id, amount, level, date)
staff(id, level, date, status)
Task: Retrieve id from schedules whose status is found in staff rows where code matches the outer record.
SQL: | SELECT id FROM schedules AS schd
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17838 | train |
v3 | Schema:
managers (alias: mgr)(status, id, name, amount)
tasks(status, salary, code, name)
Task: Find id from managers where value exceeds the minimum salary from tasks for the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE value > (
SELECT MIN(salary) FROM tasks AS tsk
WHERE tsk.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17839 | train |
v2 | Schema:
categories (alias: catg)(type, level, code, value)
schedules(name, status, level, value)
Task: Retrieve name from categories that have at least one corresponding entry in schedules sharing the same level.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17840 | train |
v2 | Schema:
transactions (alias: txn)(name, status, amount, code)
customers(name, code, date, status)
Task: Find salary from transactions where a matching record exists in customers with the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17841 | train |
v3 | Schema:
products (alias: prod)(level, status, name, id)
customers(value, status, salary, name)
Task: Retrieve id from products with salary above the COUNT(salary) of customers rows sharing the same level.
SQL: | SELECT id FROM products AS prod
WHERE salary > (
SELECT COUNT(salary) FROM customers AS cust
WHERE cust.level = prod.level
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17842 | train |
v2 | Schema:
branches (alias: brc)(date, code, name, id)
tasks(date, type, status, value)
Task: Retrieve name from branches that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT name FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17843 | train |
v2 | Schema:
departments (alias: dept)(amount, status, level, date)
customers(id, level, status, code)
Task: Find value from departments where a matching record exists in customers with the same id.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17844 | train |
v2 | Schema:
branches (alias: brc)(value, status, amount, level)
categories(name, status, code, date)
Task: Find name from branches where a matching record exists in categories with the same status.
SQL: | SELECT name FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17845 | train |
v2 | Schema:
tasks (alias: tsk)(name, value, type, level)
schedules(type, date, name, level)
Task: Retrieve name from tasks that have at least one corresponding entry in schedules sharing the same type.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17846 | train |
v2 | Schema:
items (alias: lne)(status, type, code, value)
orders(status, id, value, salary)
Task: Find value from items where a matching record exists in orders with the same status.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = lne.status
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17847 | train |
v3 | Schema:
transactions (alias: txn)(amount, code, status, date)
employees(status, id, amount, date)
Task: Retrieve name from transactions with salary above the AVG(salary) of employees rows sharing the same status.
SQL: | SELECT name FROM transactions AS txn
WHERE salary > (
SELECT AVG(salary) FROM employees AS emp
WHERE emp.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17848 | train |
v3 | Schema:
categories (alias: catg)(amount, salary, name, date)
managers(amount, status, name, salary)
Task: Retrieve id from categories with salary above the MAX(salary) of managers rows sharing the same type.
SQL: | SELECT id FROM categories AS catg
WHERE salary > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17849 | train |
v3 | Schema:
items (alias: lne)(salary, code, date, amount)
invoices(name, date, type, value)
Task: Find value from items where amount exceeds the maximum amount from invoices for the same level.
SQL: | SELECT value FROM items AS lne
WHERE amount > (
SELECT MAX(amount) FROM invoices AS inv
WHERE inv.level = lne.level
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17850 | train |
v3 | Schema:
projects (alias: prj)(date, id, amount, name)
tasks(status, date, salary, name)
Task: Retrieve amount from projects with value above the COUNT(value) of tasks rows sharing the same status.
SQL: | SELECT amount FROM projects AS prj
WHERE value > (
SELECT COUNT(value) FROM tasks AS tsk
WHERE tsk.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "prj",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17851 | train |
v1 | Schema:
shipments (alias: shp)(code, type, salary, value)
staff(amount, status, date, name)
Task: Find code from shipments where status appears in staff entries with matching type.
SQL: | SELECT code FROM shipments AS shp
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17852 | train |
v2 | Schema:
managers (alias: mgr)(code, status, amount, type)
customers(salary, name, id, value)
Task: Retrieve name from managers that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17853 | train |
v3 | Schema:
projects (alias: prj)(value, amount, salary, code)
branches(salary, name, amount, type)
Task: Find amount from projects where salary exceeds the maximum amount from branches for the same code.
SQL: | SELECT amount FROM projects AS prj
WHERE salary > (
SELECT MAX(amount) FROM branches AS brc
WHERE brc.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17854 | train |
v1 | Schema:
managers (alias: mgr)(code, amount, level, salary)
items(salary, date, name, type)
Task: Retrieve name from managers whose level is found in items rows where level matches the outer record.
SQL: | SELECT name FROM managers AS mgr
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17855 | train |
v2 | Schema:
regions (alias: rgn)(value, salary, code, status)
sales(name, salary, value, status)
Task: Find value from regions where a matching record exists in sales with the same status.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17856 | train |
v3 | Schema:
staff (alias: empl)(value, code, type, date)
accounts(date, level, status, amount)
Task: Retrieve value from staff with amount above the MAX(salary) of accounts rows sharing the same level.
SQL: | SELECT value FROM staff AS empl
WHERE amount > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17857 | train |
v3 | Schema:
products (alias: prod)(id, type, amount, salary)
customers(level, value, salary, id)
Task: Find name from products where value exceeds the total salary from customers for the same type.
SQL: | SELECT name FROM products AS prod
WHERE value > (
SELECT SUM(salary) FROM customers AS cust
WHERE cust.type = prod.type
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17858 | train |
v1 | Schema:
branches (alias: brc)(level, date, value, name)
items(code, salary, value, id)
Task: Select salary from branches where id exists in items for the same code.
SQL: | SELECT salary FROM branches AS brc
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17859 | train |
v3 | Schema:
employees (alias: emp)(amount, value, level, status)
sales(status, code, amount, level)
Task: Find value from employees where salary exceeds the minimum amount from sales for the same level.
SQL: | SELECT value FROM employees AS emp
WHERE salary > (
SELECT MIN(amount) FROM sales AS sale
WHERE sale.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17860 | train |
v3 | Schema:
items (alias: lne)(salary, amount, code, id)
requests(type, level, value, amount)
Task: Retrieve name from items with salary above the MIN(value) of requests rows sharing the same type.
SQL: | SELECT name FROM items AS lne
WHERE salary > (
SELECT MIN(value) FROM requests AS ordr
WHERE ordr.type = lne.type
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17861 | train |
v3 | Schema:
managers (alias: mgr)(name, value, id, amount)
regions(type, id, date, status)
Task: Retrieve amount from managers with value above the SUM(amount) of regions rows sharing the same id.
SQL: | SELECT amount FROM managers AS mgr
WHERE value > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17862 | train |
v3 | Schema:
sales (alias: sale)(value, level, date, salary)
requests(name, code, type, status)
Task: Find id from sales where value exceeds the maximum value from requests for the same type.
SQL: | SELECT id FROM sales AS sale
WHERE value > (
SELECT MAX(value) FROM requests AS ordr
WHERE ordr.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17863 | train |
v1 | Schema:
projects (alias: prj)(name, id, status, value)
transactions(code, value, status, amount)
Task: Select amount from projects where status exists in transactions for the same status.
SQL: | SELECT amount FROM projects AS prj
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17864 | train |
v3 | Schema:
items (alias: lne)(date, name, salary, status)
managers(status, amount, name, salary)
Task: Retrieve value from items with salary above the COUNT(salary) of managers rows sharing the same type.
SQL: | SELECT value FROM items AS lne
WHERE salary > (
SELECT COUNT(salary) FROM managers AS mgr
WHERE mgr.type = lne.type
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17865 | train |
v2 | Schema:
projects (alias: prj)(type, amount, level, date)
accounts(id, amount, type, date)
Task: Find amount from projects where a matching record exists in accounts with the same level.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17866 | train |
v3 | Schema:
tasks (alias: tsk)(level, salary, value, status)
employees(level, code, date, name)
Task: Find code from tasks where salary exceeds the maximum amount from employees for the same code.
SQL: | SELECT code FROM tasks AS tsk
WHERE salary > (
SELECT MAX(amount) FROM employees AS emp
WHERE emp.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "tsk",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17867 | train |
v2 | Schema:
transactions (alias: txn)(value, salary, level, date)
invoices(amount, level, code, salary)
Task: Find amount from transactions where a matching record exists in invoices with the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17868 | train |
v3 | Schema:
staff (alias: empl)(code, salary, name, value)
tasks(value, name, salary, code)
Task: Retrieve salary from staff with salary above the SUM(amount) of tasks rows sharing the same type.
SQL: | SELECT salary FROM staff AS empl
WHERE salary > (
SELECT SUM(amount) FROM tasks AS tsk
WHERE tsk.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "salary",
"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_17869 | train |
v2 | Schema:
employees (alias: emp)(status, date, type, salary)
shipments(salary, date, amount, name)
Task: Find value from employees where a matching record exists in shipments with the same type.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17870 | train |
v3 | Schema:
projects (alias: prj)(status, name, id, type)
transactions(id, salary, amount, code)
Task: Retrieve name from projects with value above the MAX(value) of transactions rows sharing the same code.
SQL: | SELECT name FROM projects AS prj
WHERE value > (
SELECT MAX(value) FROM transactions AS txn
WHERE txn.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17871 | train |
v2 | Schema:
invoices (alias: inv)(type, level, salary, name)
transactions(name, level, amount, value)
Task: Find name from invoices where a matching record exists in transactions with the same code.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17872 | train |
v2 | Schema:
items (alias: lne)(amount, code, level, date)
employees(salary, id, code, type)
Task: Find salary from items where a matching record exists in employees with the same status.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = lne.status
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17873 | train |
v2 | Schema:
transactions (alias: txn)(level, date, type, name)
departments(date, name, status, id)
Task: Retrieve salary from transactions that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17874 | train |
v1 | Schema:
regions (alias: rgn)(salary, id, value, type)
items(value, level, status, date)
Task: Select salary from regions where id exists in items for the same id.
SQL: | SELECT salary FROM regions AS rgn
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17875 | train |
v1 | Schema:
categories (alias: catg)(amount, id, status, level)
sales(value, status, amount, id)
Task: Retrieve code from categories whose id is found in sales rows where level matches the outer record.
SQL: | SELECT code FROM categories AS catg
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17876 | train |
v3 | Schema:
schedules (alias: schd)(level, amount, status, type)
regions(date, id, status, amount)
Task: Find salary from schedules where value exceeds the minimum value from regions for the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE value > (
SELECT MIN(value) FROM regions AS rgn
WHERE rgn.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17877 | train |
v1 | Schema:
schedules (alias: schd)(salary, type, name, date)
managers(date, level, code, name)
Task: Retrieve name from schedules whose id is found in managers rows where code matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17878 | train |
v3 | Schema:
regions (alias: rgn)(level, id, type, salary)
customers(value, date, type, name)
Task: Retrieve amount from regions with value above the COUNT(amount) of customers rows sharing the same type.
SQL: | SELECT amount FROM regions AS rgn
WHERE value > (
SELECT COUNT(amount) FROM customers AS cust
WHERE cust.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17879 | train |
v2 | Schema:
orders (alias: ord)(code, level, id, value)
sales(level, id, code, salary)
Task: Find code from orders where a matching record exists in sales with the same code.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17880 | train |
v3 | Schema:
products (alias: prod)(date, status, name, level)
departments(id, date, type, amount)
Task: Find code from products where value exceeds the count of amount from departments for the same level.
SQL: | SELECT code FROM products AS prod
WHERE value > (
SELECT COUNT(amount) FROM departments AS dept
WHERE dept.level = prod.level
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17881 | train |
v3 | Schema:
projects (alias: prj)(status, amount, type, date)
customers(type, name, status, date)
Task: Retrieve id from projects with amount above the SUM(amount) of customers rows sharing the same status.
SQL: | SELECT id FROM projects AS prj
WHERE amount > (
SELECT SUM(amount) FROM customers AS cust
WHERE cust.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "prj",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17882 | train |
v3 | Schema:
requests (alias: ordr)(name, salary, date, id)
managers(level, code, id, status)
Task: Retrieve salary from requests with salary above the AVG(value) of managers rows sharing the same type.
SQL: | SELECT salary FROM requests AS ordr
WHERE salary > (
SELECT AVG(value) FROM managers AS mgr
WHERE mgr.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17883 | train |
v1 | Schema:
employees (alias: emp)(type, level, code, name)
branches(type, code, salary, amount)
Task: Retrieve id from employees whose level is found in branches rows where code matches the outer record.
SQL: | SELECT id FROM employees AS emp
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17884 | train |
v1 | Schema:
orders (alias: ord)(salary, amount, date, type)
departments(name, status, salary, type)
Task: Retrieve id from orders whose id is found in departments rows where id matches the outer record.
SQL: | SELECT id FROM orders AS ord
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17885 | train |
v1 | Schema:
branches (alias: brc)(code, status, date, level)
products(amount, level, salary, value)
Task: Find id from branches where code appears in products entries with matching level.
SQL: | SELECT id FROM branches AS brc
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17886 | train |
v3 | Schema:
sales (alias: sale)(name, amount, date, id)
tasks(status, code, date, type)
Task: Retrieve code from sales with value above the SUM(salary) of tasks rows sharing the same id.
SQL: | SELECT code FROM sales AS sale
WHERE value > (
SELECT SUM(salary) FROM tasks AS tsk
WHERE tsk.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17887 | train |
v3 | Schema:
accounts (alias: acct)(level, salary, amount, status)
products(name, amount, date, salary)
Task: Find name from accounts where salary exceeds the total amount from products for the same status.
SQL: | SELECT name FROM accounts AS acct
WHERE salary > (
SELECT SUM(amount) FROM products AS prod
WHERE prod.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17888 | train |
v3 | Schema:
orders (alias: ord)(code, name, date, status)
schedules(amount, value, status, type)
Task: Find name from orders where value exceeds the total amount from schedules for the same id.
SQL: | SELECT name FROM orders AS ord
WHERE value > (
SELECT SUM(amount) FROM schedules AS schd
WHERE schd.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17889 | train |
v1 | Schema:
departments (alias: dept)(status, level, amount, salary)
requests(date, name, code, salary)
Task: Select name from departments where level exists in requests for the same code.
SQL: | SELECT name FROM departments AS dept
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17890 | train |
v1 | Schema:
tasks (alias: tsk)(date, amount, salary, id)
regions(code, type, value, name)
Task: Find id from tasks where level appears in regions entries with matching status.
SQL: | SELECT id FROM tasks AS tsk
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17891 | train |
v3 | Schema:
customers (alias: cust)(code, id, amount, salary)
staff(name, salary, type, date)
Task: Retrieve value from customers with salary above the AVG(salary) of staff rows sharing the same level.
SQL: | SELECT value FROM customers AS cust
WHERE salary > (
SELECT AVG(salary) FROM staff AS empl
WHERE empl.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17892 | train |
v1 | Schema:
employees (alias: emp)(amount, date, level, type)
tasks(id, date, code, amount)
Task: Find code from employees where level appears in tasks entries with matching code.
SQL: | SELECT code FROM employees AS emp
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17893 | train |
v3 | Schema:
invoices (alias: inv)(name, date, level, id)
shipments(level, salary, type, name)
Task: Find salary from invoices where salary exceeds the average salary from shipments for the same status.
SQL: | SELECT salary FROM invoices AS inv
WHERE salary > (
SELECT AVG(salary) FROM shipments AS shp
WHERE shp.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17894 | train |
v2 | Schema:
items (alias: lne)(value, amount, code, date)
customers(date, type, code, amount)
Task: Retrieve id from items that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = lne.status
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17895 | train |
v2 | Schema:
departments (alias: dept)(id, date, level, name)
tasks(salary, amount, level, code)
Task: Retrieve value from departments that have at least one corresponding entry in tasks sharing the same level.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17896 | train |
v2 | Schema:
invoices (alias: inv)(code, name, salary, id)
tasks(value, type, id, amount)
Task: Find id from invoices where a matching record exists in tasks with the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17897 | train |
v2 | Schema:
tasks (alias: tsk)(date, level, id, amount)
schedules(amount, code, date, type)
Task: Retrieve value from tasks that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17898 | train |
v3 | Schema:
categories (alias: catg)(salary, status, type, code)
accounts(status, value, date, salary)
Task: Find salary from categories where salary exceeds the minimum amount from accounts for the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE salary > (
SELECT MIN(amount) FROM accounts AS acct
WHERE acct.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17899 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.