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 |
|---|---|---|---|---|---|---|
v3 | Schema:
orders (alias: ord)(amount, code, name, date)
schedules(id, salary, status, value)
Task: Retrieve name from orders with salary above the COUNT(amount) of schedules rows sharing the same type.
SQL: | SELECT name FROM orders AS ord
WHERE salary > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18200 | train |
v3 | Schema:
requests (alias: ordr)(name, id, code, type)
schedules(amount, date, value, name)
Task: Retrieve name from requests with amount above the MIN(amount) of schedules rows sharing the same id.
SQL: | SELECT name FROM requests AS ordr
WHERE amount > (
SELECT MIN(amount) FROM schedules AS schd
WHERE schd.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_18201 | train |
v1 | Schema:
accounts (alias: acct)(name, code, status, amount)
regions(level, amount, name, status)
Task: Retrieve amount from accounts whose status is found in regions rows where level matches the outer record.
SQL: | SELECT amount FROM accounts AS acct
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18202 | train |
v2 | Schema:
shipments (alias: shp)(id, level, value, type)
projects(id, level, name, value)
Task: Find name from shipments where a matching record exists in projects with the same code.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_18203 | train |
v3 | Schema:
transactions (alias: txn)(id, status, name, date)
tasks(status, date, level, salary)
Task: Find value from transactions where amount exceeds the total value from tasks for the same level.
SQL: | SELECT value FROM transactions AS txn
WHERE amount > (
SELECT SUM(value) FROM tasks AS tsk
WHERE tsk.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18204 | train |
v3 | Schema:
products (alias: prod)(status, amount, name, id)
categories(salary, value, id, amount)
Task: Retrieve code from products with salary above the AVG(salary) of categories rows sharing the same type.
SQL: | SELECT code FROM products AS prod
WHERE salary > (
SELECT AVG(salary) FROM categories AS catg
WHERE catg.type = prod.type
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18205 | train |
v3 | Schema:
products (alias: prod)(amount, id, type, status)
branches(type, id, date, salary)
Task: Find value from products where amount exceeds the average value from branches for the same id.
SQL: | SELECT value FROM products AS prod
WHERE amount > (
SELECT AVG(value) FROM branches AS brc
WHERE brc.id = prod.id
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18206 | train |
v1 | Schema:
customers (alias: cust)(name, level, salary, amount)
schedules(date, level, type, amount)
Task: Select salary from customers where id exists in schedules for the same status.
SQL: | SELECT salary FROM customers AS cust
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18207 | train |
v1 | Schema:
projects (alias: prj)(code, amount, date, name)
schedules(level, date, id, value)
Task: Select id from projects where id exists in schedules for the same id.
SQL: | SELECT id FROM projects AS prj
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "schedules",
"outer_alias": "prj",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_18208 | train |
v1 | Schema:
schedules (alias: schd)(status, level, salary, date)
orders(level, salary, amount, id)
Task: Find name from schedules where code appears in orders entries with matching id.
SQL: | SELECT name FROM schedules AS schd
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_18209 | train |
v2 | Schema:
accounts (alias: acct)(amount, date, salary, id)
requests(type, value, name, id)
Task: Find code from accounts where a matching record exists in requests with the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18210 | train |
v3 | Schema:
orders (alias: ord)(salary, id, code, status)
items(date, status, level, id)
Task: Retrieve value from orders with amount above the COUNT(value) of items rows sharing the same id.
SQL: | SELECT value FROM orders AS ord
WHERE amount > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18211 | train |
v3 | Schema:
projects (alias: prj)(salary, name, value, status)
categories(amount, type, name, status)
Task: Retrieve name from projects with amount above the MAX(value) of categories rows sharing the same status.
SQL: | SELECT name FROM projects AS prj
WHERE amount > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_18212 | train |
v3 | Schema:
regions (alias: rgn)(code, status, type, value)
branches(amount, type, code, date)
Task: Find amount from regions where salary exceeds the minimum salary from branches for the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE salary > (
SELECT MIN(salary) FROM branches AS brc
WHERE brc.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_18213 | train |
v1 | Schema:
regions (alias: rgn)(salary, level, status, amount)
branches(type, id, status, amount)
Task: Retrieve id from regions whose code is found in branches rows where level matches the outer record.
SQL: | SELECT id FROM regions AS rgn
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_18214 | train |
v1 | Schema:
tasks (alias: tsk)(amount, name, type, level)
shipments(date, amount, name, status)
Task: Retrieve value from tasks whose id is found in shipments rows where status matches the outer record.
SQL: | SELECT value FROM tasks AS tsk
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_18215 | train |
v3 | Schema:
invoices (alias: inv)(id, value, name, code)
items(date, value, name, id)
Task: Find value from invoices where value exceeds the average salary from items for the same status.
SQL: | SELECT value FROM invoices AS inv
WHERE value > (
SELECT AVG(salary) FROM items AS lne
WHERE lne.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18216 | train |
v1 | Schema:
branches (alias: brc)(name, date, amount, id)
shipments(level, status, date, amount)
Task: Find id from branches where code appears in shipments entries with matching level.
SQL: | SELECT id FROM branches AS brc
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_18217 | train |
v2 | Schema:
invoices (alias: inv)(date, id, type, code)
managers(type, amount, id, level)
Task: Retrieve salary from invoices that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18218 | train |
v3 | Schema:
employees (alias: emp)(code, name, amount, type)
sales(salary, type, date, name)
Task: Retrieve amount from employees with amount above the MIN(amount) of sales rows sharing the same type.
SQL: | SELECT amount FROM employees AS emp
WHERE amount > (
SELECT MIN(amount) FROM sales AS sale
WHERE sale.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18219 | train |
v1 | Schema:
tasks (alias: tsk)(date, level, status, code)
categories(id, level, code, name)
Task: Find value from tasks where type appears in categories entries with matching level.
SQL: | SELECT value FROM tasks AS tsk
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_18220 | train |
v3 | Schema:
products (alias: prod)(type, salary, code, id)
sales(type, status, date, name)
Task: Find salary from products where amount exceeds the minimum amount from sales for the same status.
SQL: | SELECT salary FROM products AS prod
WHERE amount > (
SELECT MIN(amount) FROM sales AS sale
WHERE sale.status = prod.status
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18221 | train |
v1 | Schema:
staff (alias: empl)(name, code, salary, level)
employees(salary, amount, name, status)
Task: Find amount from staff where type appears in employees entries with matching type.
SQL: | SELECT amount FROM staff AS empl
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_18222 | train |
v2 | Schema:
managers (alias: mgr)(code, salary, id, value)
items(amount, status, code, type)
Task: Find salary from managers where a matching record exists in items with the same status.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18223 | train |
v2 | Schema:
managers (alias: mgr)(name, id, level, status)
branches(name, level, id, code)
Task: Find amount from managers where a matching record exists in branches with the same type.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18224 | train |
v3 | Schema:
projects (alias: prj)(amount, name, status, type)
tasks(value, amount, id, code)
Task: Retrieve amount from projects with value above the COUNT(value) of tasks rows sharing the same id.
SQL: | SELECT amount FROM projects AS prj
WHERE value > (
SELECT COUNT(value) FROM tasks AS tsk
WHERE tsk.id = prj.id
); | {
"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": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_18225 | train |
v1 | Schema:
managers (alias: mgr)(value, level, id, date)
accounts(value, id, type, code)
Task: Find code from managers where code appears in accounts entries with matching code.
SQL: | SELECT code FROM managers AS mgr
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18226 | train |
v1 | Schema:
shipments (alias: shp)(value, type, date, code)
customers(salary, id, status, date)
Task: Retrieve salary from shipments whose type is found in customers rows where id matches the outer record.
SQL: | SELECT salary FROM shipments AS shp
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_18227 | train |
v3 | Schema:
sales (alias: sale)(type, value, salary, code)
shipments(salary, id, status, code)
Task: Retrieve value from sales with value above the SUM(amount) of shipments rows sharing the same status.
SQL: | SELECT value FROM sales AS sale
WHERE value > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18228 | train |
v1 | Schema:
accounts (alias: acct)(status, amount, level, type)
employees(type, name, date, value)
Task: Retrieve amount from accounts whose code is found in employees rows where status matches the outer record.
SQL: | SELECT amount FROM accounts AS acct
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18229 | train |
v2 | Schema:
transactions (alias: txn)(date, name, status, value)
staff(value, type, date, name)
Task: Find amount from transactions where a matching record exists in staff with the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18230 | train |
v1 | Schema:
invoices (alias: inv)(name, status, value, amount)
schedules(value, type, level, code)
Task: Select id from invoices where code exists in schedules for the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18231 | train |
v2 | Schema:
schedules (alias: schd)(value, status, name, type)
requests(level, amount, date, salary)
Task: Retrieve salary from schedules that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_18232 | train |
v2 | Schema:
requests (alias: ordr)(value, name, status, id)
regions(type, date, value, status)
Task: Retrieve value from requests that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_18233 | train |
v3 | Schema:
tasks (alias: tsk)(status, amount, value, id)
items(code, type, status, date)
Task: Retrieve id from tasks with amount above the COUNT(value) of items rows sharing the same id.
SQL: | SELECT id FROM tasks AS tsk
WHERE amount > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "items",
"outer_alias": "tsk",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_18234 | train |
v3 | Schema:
regions (alias: rgn)(code, date, value, status)
customers(level, salary, type, name)
Task: Find code from regions where salary exceeds the minimum salary from customers for the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE salary > (
SELECT MIN(salary) FROM customers AS cust
WHERE cust.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_18235 | train |
v1 | Schema:
schedules (alias: schd)(id, salary, type, date)
branches(status, salary, value, amount)
Task: Find salary from schedules where type appears in branches entries with matching type.
SQL: | SELECT salary FROM schedules AS schd
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_18236 | train |
v1 | Schema:
branches (alias: brc)(code, amount, level, id)
shipments(code, name, status, level)
Task: Select name from branches where status exists in shipments for the same id.
SQL: | SELECT name FROM branches AS brc
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_18237 | train |
v3 | Schema:
transactions (alias: txn)(type, value, code, name)
employees(name, salary, amount, date)
Task: Retrieve id from transactions with salary above the SUM(amount) of employees rows sharing the same level.
SQL: | SELECT id FROM transactions AS txn
WHERE salary > (
SELECT SUM(amount) FROM employees AS emp
WHERE emp.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18238 | train |
v2 | Schema:
items (alias: lne)(date, name, id, value)
managers(type, id, level, status)
Task: Retrieve code from items that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = lne.status
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_18239 | train |
v2 | Schema:
branches (alias: brc)(date, id, type, name)
products(level, amount, value, salary)
Task: Retrieve amount from branches that have at least one corresponding entry in products sharing the same status.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_18240 | train |
v1 | Schema:
sales (alias: sale)(name, amount, level, salary)
accounts(value, name, type, level)
Task: Find value from sales where level appears in accounts entries with matching level.
SQL: | SELECT value FROM sales AS sale
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18241 | train |
v1 | Schema:
requests (alias: ordr)(date, name, salary, amount)
customers(type, amount, salary, level)
Task: Find name from requests where type appears in customers entries with matching status.
SQL: | SELECT name FROM requests AS ordr
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_18242 | train |
v2 | Schema:
transactions (alias: txn)(value, code, id, status)
shipments(id, value, type, amount)
Task: Find id from transactions where a matching record exists in shipments with the same type.
SQL: | SELECT id 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": "id",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18243 | train |
v1 | Schema:
products (alias: prod)(name, value, level, code)
transactions(name, date, code, id)
Task: Find name from products where status appears in transactions entries with matching id.
SQL: | SELECT name FROM products AS prod
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.id = prod.id
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18244 | train |
v3 | Schema:
items (alias: lne)(value, date, salary, level)
transactions(type, date, value, id)
Task: Find salary from items where value exceeds the total amount from transactions for the same id.
SQL: | SELECT salary FROM items AS lne
WHERE value > (
SELECT SUM(amount) FROM transactions AS txn
WHERE txn.id = lne.id
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_18245 | train |
v3 | Schema:
orders (alias: ord)(status, date, code, type)
accounts(date, id, status, name)
Task: Find code from orders where salary exceeds the average value from accounts for the same id.
SQL: | SELECT code FROM orders AS ord
WHERE salary > (
SELECT AVG(value) FROM accounts AS acct
WHERE acct.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18246 | train |
v2 | Schema:
employees (alias: emp)(value, name, code, level)
branches(name, value, status, date)
Task: Retrieve name from employees that have at least one corresponding entry in branches sharing the same level.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18247 | train |
v2 | Schema:
staff (alias: empl)(type, name, id, level)
managers(status, type, value, name)
Task: Find name from staff where a matching record exists in managers with the same status.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_18248 | train |
v3 | Schema:
categories (alias: catg)(type, salary, amount, date)
accounts(amount, name, code, salary)
Task: Find code from categories where value exceeds the total salary from accounts for the same type.
SQL: | SELECT code FROM categories AS catg
WHERE value > (
SELECT SUM(salary) FROM accounts AS acct
WHERE acct.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_18249 | train |
v2 | Schema:
managers (alias: mgr)(code, value, status, name)
customers(value, type, level, amount)
Task: Find name from managers where a matching record exists in customers with 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_18250 | train |
v1 | Schema:
staff (alias: empl)(salary, amount, type, id)
projects(date, level, value, code)
Task: Select value from staff where id exists in projects for the same code.
SQL: | SELECT value FROM staff AS empl
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_18251 | train |
v2 | Schema:
managers (alias: mgr)(value, amount, id, date)
tasks(type, code, date, level)
Task: Find code from managers where a matching record exists in tasks with the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18252 | train |
v1 | Schema:
branches (alias: brc)(salary, level, amount, type)
categories(id, level, type, salary)
Task: Retrieve id from branches whose id is found in categories rows where level matches the outer record.
SQL: | SELECT id FROM branches AS brc
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_18253 | train |
v1 | Schema:
categories (alias: catg)(level, amount, status, id)
requests(date, code, amount, level)
Task: Select code from categories where code exists in requests for the same type.
SQL: | SELECT code FROM categories AS catg
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_18254 | train |
v2 | Schema:
shipments (alias: shp)(salary, id, amount, value)
sales(status, salary, amount, level)
Task: Find salary from shipments where a matching record exists in sales with the same code.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_18255 | train |
v1 | Schema:
invoices (alias: inv)(status, id, type, level)
orders(status, amount, type, date)
Task: Select value from invoices where type exists in orders for the same status.
SQL: | SELECT value FROM invoices AS inv
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18256 | train |
v3 | Schema:
requests (alias: ordr)(type, date, id, salary)
transactions(id, salary, amount, value)
Task: Find code from requests where salary exceeds the maximum value from transactions for the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE salary > (
SELECT MAX(value) FROM transactions AS txn
WHERE txn.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_18257 | train |
v1 | Schema:
products (alias: prod)(type, level, name, salary)
items(salary, code, date, status)
Task: Select id from products where type exists in items for the same status.
SQL: | SELECT id FROM products AS prod
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.status = prod.status
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18258 | train |
v1 | Schema:
items (alias: lne)(status, type, name, salary)
transactions(amount, id, level, value)
Task: Find name from items where status appears in transactions entries with matching type.
SQL: | SELECT name FROM items AS lne
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.type = lne.type
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_18259 | train |
v1 | Schema:
items (alias: lne)(level, amount, type, value)
orders(id, salary, value, amount)
Task: Select code from items where level exists in orders for the same level.
SQL: | SELECT code FROM items AS lne
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.level = lne.level
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_18260 | train |
v3 | Schema:
shipments (alias: shp)(value, status, salary, date)
sales(status, date, code, type)
Task: Retrieve salary from shipments with salary above the MIN(amount) of sales rows sharing the same status.
SQL: | SELECT salary FROM shipments AS shp
WHERE salary > (
SELECT MIN(amount) FROM sales AS sale
WHERE sale.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_18261 | train |
v3 | Schema:
tasks (alias: tsk)(type, date, id, salary)
invoices(amount, level, value, code)
Task: Find id from tasks where value exceeds the average salary from invoices for the same code.
SQL: | SELECT id FROM tasks AS tsk
WHERE value > (
SELECT AVG(salary) FROM invoices AS inv
WHERE inv.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_18262 | train |
v2 | Schema:
invoices (alias: inv)(value, id, code, amount)
branches(salary, name, type, level)
Task: Find id from invoices where a matching record exists in branches with the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18263 | train |
v1 | Schema:
projects (alias: prj)(level, name, salary, id)
staff(status, level, date, name)
Task: Find salary from projects where level appears in staff entries with matching type.
SQL: | SELECT salary FROM projects AS prj
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "staff",
"outer_alias": "prj",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_18264 | train |
v3 | Schema:
departments (alias: dept)(amount, level, salary, code)
accounts(type, amount, id, code)
Task: Find code from departments where amount exceeds the minimum salary from accounts for the same id.
SQL: | SELECT code FROM departments AS dept
WHERE amount > (
SELECT MIN(salary) FROM accounts AS acct
WHERE acct.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18265 | train |
v1 | Schema:
items (alias: lne)(name, status, amount, value)
projects(level, name, type, status)
Task: Retrieve id from items whose code is found in projects rows where status matches the outer record.
SQL: | SELECT id FROM items AS lne
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.status = lne.status
); | {
"outer_table": "items",
"inner_table": "projects",
"outer_alias": "lne",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_18266 | train |
v1 | Schema:
accounts (alias: acct)(salary, level, id, value)
managers(value, amount, salary, level)
Task: Find name from accounts where code appears in managers entries with matching level.
SQL: | SELECT name FROM accounts AS acct
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18267 | train |
v2 | Schema:
customers (alias: cust)(salary, value, date, type)
items(id, level, date, code)
Task: Retrieve value from customers that have at least one corresponding entry in items sharing the same code.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18268 | train |
v3 | Schema:
tasks (alias: tsk)(type, id, status, salary)
shipments(type, status, name, id)
Task: Find name from tasks where salary exceeds the maximum value from shipments for the same type.
SQL: | SELECT name FROM tasks AS tsk
WHERE salary > (
SELECT MAX(value) FROM shipments AS shp
WHERE shp.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_18269 | train |
v2 | Schema:
staff (alias: empl)(level, amount, status, id)
tasks(level, name, type, salary)
Task: Retrieve code from staff that have at least one corresponding entry in tasks sharing the same status.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_18270 | train |
v3 | Schema:
regions (alias: rgn)(id, name, level, code)
branches(code, value, name, salary)
Task: Find id from regions where amount exceeds the maximum amount from branches for the same status.
SQL: | SELECT id FROM regions AS rgn
WHERE amount > (
SELECT MAX(amount) FROM branches AS brc
WHERE brc.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_18271 | train |
v2 | Schema:
schedules (alias: schd)(name, salary, code, type)
items(value, level, salary, code)
Task: Find name from schedules where a matching record exists in items with the same type.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_18272 | train |
v3 | Schema:
schedules (alias: schd)(amount, type, name, status)
projects(level, status, name, value)
Task: Retrieve name from schedules with value above the AVG(salary) of projects rows sharing the same id.
SQL: | SELECT name FROM schedules AS schd
WHERE value > (
SELECT AVG(salary) FROM projects AS prj
WHERE prj.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_18273 | train |
v2 | Schema:
branches (alias: brc)(level, code, salary, status)
customers(status, amount, date, id)
Task: Find salary from branches where a matching record exists in customers with the same id.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_18274 | train |
v3 | Schema:
branches (alias: brc)(salary, code, id, status)
products(id, value, code, salary)
Task: Find salary from branches where salary exceeds the total value from products for the same status.
SQL: | SELECT salary FROM branches AS brc
WHERE salary > (
SELECT SUM(value) FROM products AS prod
WHERE prod.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_18275 | train |
v2 | Schema:
requests (alias: ordr)(level, code, id, status)
items(salary, value, level, id)
Task: Retrieve value from requests that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_18276 | train |
v2 | Schema:
schedules (alias: schd)(date, level, status, id)
orders(amount, status, type, value)
Task: Retrieve id from schedules that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_18277 | train |
v1 | Schema:
staff (alias: empl)(amount, value, date, id)
accounts(code, name, status, salary)
Task: Retrieve salary from staff whose code is found in accounts rows where level matches the outer record.
SQL: | SELECT salary FROM staff AS empl
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_18278 | train |
v1 | Schema:
products (alias: prod)(name, status, date, code)
accounts(name, level, status, code)
Task: Retrieve value from products whose status is found in accounts rows where status matches the outer record.
SQL: | SELECT value FROM products AS prod
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.status = prod.status
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18279 | train |
v3 | Schema:
requests (alias: ordr)(code, type, value, id)
departments(date, type, salary, level)
Task: Find name from requests where value exceeds the count of salary from departments for the same id.
SQL: | SELECT name FROM requests AS ordr
WHERE value > (
SELECT COUNT(salary) FROM departments AS dept
WHERE dept.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_18280 | train |
v1 | Schema:
tasks (alias: tsk)(amount, status, id, value)
regions(value, type, level, name)
Task: Find name from tasks where id appears in regions entries with matching code.
SQL: | SELECT name FROM tasks AS tsk
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_18281 | train |
v2 | Schema:
sales (alias: sale)(date, amount, name, salary)
branches(value, status, amount, code)
Task: Find amount from sales where a matching record exists in branches with the same code.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "branches",
"outer_alias": "sale",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18282 | train |
v1 | Schema:
employees (alias: emp)(value, level, amount, name)
managers(status, code, name, id)
Task: Retrieve id from employees whose type is found in managers rows where status matches the outer record.
SQL: | SELECT id FROM employees AS emp
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18283 | train |
v1 | Schema:
sales (alias: sale)(type, amount, code, name)
managers(value, type, id, salary)
Task: Select amount from sales where type exists in managers for the same status.
SQL: | SELECT amount FROM sales AS sale
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18284 | train |
v1 | Schema:
categories (alias: catg)(status, type, level, amount)
staff(salary, type, value, id)
Task: Retrieve salary from categories whose code is found in staff rows where level matches the outer record.
SQL: | SELECT salary FROM categories AS catg
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_18285 | train |
v2 | Schema:
branches (alias: brc)(level, amount, id, code)
sales(level, value, status, amount)
Task: Retrieve code from branches that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_18286 | train |
v1 | Schema:
projects (alias: prj)(status, date, amount, type)
staff(code, salary, amount, value)
Task: Retrieve salary from projects whose level is found in staff rows where id matches the outer record.
SQL: | SELECT salary FROM projects AS prj
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "staff",
"outer_alias": "prj",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_18287 | train |
v1 | Schema:
shipments (alias: shp)(type, id, level, code)
branches(date, value, level, status)
Task: Find id from shipments where level appears in branches entries with matching level.
SQL: | SELECT id FROM shipments AS shp
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_18288 | train |
v2 | Schema:
transactions (alias: txn)(value, type, id, salary)
items(code, type, id, salary)
Task: Retrieve value from transactions that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18289 | train |
v2 | Schema:
orders (alias: ord)(salary, level, status, name)
tasks(id, type, level, value)
Task: Retrieve salary from orders that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18290 | train |
v2 | Schema:
categories (alias: catg)(date, value, id, code)
managers(date, id, code, level)
Task: Retrieve value from categories that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_18291 | train |
v2 | Schema:
customers (alias: cust)(date, name, code, salary)
projects(id, level, type, value)
Task: Retrieve id from customers that have at least one corresponding entry in projects sharing the same level.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18292 | train |
v1 | Schema:
items (alias: lne)(level, code, type, status)
customers(date, name, salary, code)
Task: Find salary from items where id appears in customers entries with matching type.
SQL: | SELECT salary FROM items AS lne
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.type = lne.type
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_18293 | train |
v3 | Schema:
orders (alias: ord)(date, value, code, salary)
tasks(status, id, salary, amount)
Task: Find code from orders where value exceeds the total amount from tasks for the same status.
SQL: | SELECT code FROM orders AS ord
WHERE value > (
SELECT SUM(amount) FROM tasks AS tsk
WHERE tsk.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18294 | train |
v3 | Schema:
schedules (alias: schd)(level, code, amount, value)
managers(type, amount, value, code)
Task: Find value from schedules where salary exceeds the average salary from managers for the same type.
SQL: | SELECT value FROM schedules AS schd
WHERE salary > (
SELECT AVG(salary) FROM managers AS mgr
WHERE mgr.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_18295 | train |
v2 | Schema:
staff (alias: empl)(type, salary, code, level)
managers(status, name, type, salary)
Task: Retrieve value from staff that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_18296 | train |
v1 | Schema:
accounts (alias: acct)(amount, code, date, salary)
customers(amount, code, name, id)
Task: Retrieve value from accounts whose id is found in customers rows where id matches the outer record.
SQL: | SELECT value FROM accounts AS acct
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_18297 | train |
v1 | Schema:
requests (alias: ordr)(status, value, date, level)
projects(status, amount, id, level)
Task: Select name from requests where code exists in projects for the same code.
SQL: | SELECT name FROM requests AS ordr
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_18298 | train |
v2 | Schema:
requests (alias: ordr)(value, id, code, date)
projects(amount, level, date, code)
Task: Retrieve value from requests that have at least one corresponding entry in projects sharing the same code.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_18299 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.