variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v2 | Schema:
shipments (alias: shp)(date, type, id, status)
categories(type, name, date, code)
Task: Retrieve id from shipments that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02200 | train |
v3 | Schema:
requests (alias: ordr)(salary, date, value, level)
items(code, salary, id, amount)
Task: Retrieve id from requests with value above the AVG(amount) of items rows sharing the same level.
SQL: | SELECT id FROM requests AS ordr
WHERE value > (
SELECT AVG(amount) FROM items AS lne
WHERE lne.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02201 | train |
v1 | Schema:
invoices (alias: inv)(name, code, id, status)
sales(date, name, id, status)
Task: Select code from invoices where level exists in sales for the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02202 | train |
v2 | Schema:
managers (alias: mgr)(value, amount, status, id)
staff(value, amount, level, date)
Task: Retrieve salary from managers that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02203 | train |
v3 | Schema:
transactions (alias: txn)(level, code, id, status)
items(level, type, id, date)
Task: Find salary from transactions where value exceeds the minimum value from items for the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE value > (
SELECT MIN(value) FROM items AS lne
WHERE lne.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02204 | train |
v3 | Schema:
managers (alias: mgr)(amount, type, name, id)
employees(date, value, name, id)
Task: Find code from managers where salary exceeds the count of salary from employees for the same code.
SQL: | SELECT code FROM managers AS mgr
WHERE salary > (
SELECT COUNT(salary) FROM employees AS emp
WHERE emp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02205 | train |
v2 | Schema:
shipments (alias: shp)(type, code, status, value)
managers(id, level, salary, value)
Task: Retrieve code from shipments that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02206 | train |
v1 | Schema:
sales (alias: sale)(date, id, salary, code)
requests(date, id, level, amount)
Task: Find code from sales where status appears in requests entries with matching status.
SQL: | SELECT code FROM sales AS sale
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02207 | train |
v1 | Schema:
categories (alias: catg)(id, value, level, name)
invoices(id, level, code, name)
Task: Find name from categories where type appears in invoices entries with matching type.
SQL: | SELECT name FROM categories AS catg
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02208 | train |
v1 | Schema:
shipments (alias: shp)(type, value, level, code)
accounts(date, id, value, status)
Task: Retrieve name from shipments whose type is found in accounts rows where code matches the outer record.
SQL: | SELECT name FROM shipments AS shp
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02209 | train |
v2 | Schema:
products (alias: prod)(name, status, code, date)
categories(name, amount, code, salary)
Task: Find code from products where a matching record exists in categories with the same level.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = prod.level
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02210 | train |
v3 | Schema:
employees (alias: emp)(code, date, status, name)
requests(id, level, type, status)
Task: Retrieve code from employees with amount above the AVG(amount) of requests rows sharing the same type.
SQL: | SELECT code FROM employees AS emp
WHERE amount > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02211 | train |
v3 | Schema:
tasks (alias: tsk)(level, date, value, name)
shipments(salary, date, value, code)
Task: Find name from tasks where amount exceeds the maximum value from shipments for the same type.
SQL: | SELECT name FROM tasks AS tsk
WHERE amount > (
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": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02212 | train |
v1 | Schema:
branches (alias: brc)(value, salary, amount, level)
transactions(salary, id, level, status)
Task: Find name from branches where id appears in transactions entries with matching type.
SQL: | SELECT name FROM branches AS brc
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "transactions",
"outer_alias": "brc",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02213 | train |
v2 | Schema:
regions (alias: rgn)(id, salary, status, level)
customers(date, status, value, level)
Task: Retrieve name from regions that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02214 | train |
v2 | Schema:
categories (alias: catg)(salary, amount, name, status)
orders(id, salary, name, value)
Task: Find amount from categories where a matching record exists in orders with the same level.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02215 | train |
v3 | Schema:
schedules (alias: schd)(status, name, code, type)
transactions(id, amount, level, date)
Task: Find amount from schedules where value exceeds the maximum salary from transactions for the same level.
SQL: | SELECT amount FROM schedules AS schd
WHERE value > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02216 | train |
v2 | Schema:
orders (alias: ord)(name, amount, code, id)
shipments(date, value, amount, status)
Task: Retrieve salary from orders that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02217 | train |
v1 | Schema:
products (alias: prod)(date, status, value, id)
accounts(status, type, date, name)
Task: Find value from products where type appears in accounts entries with matching level.
SQL: | SELECT value FROM products AS prod
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.level = prod.level
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02218 | train |
v2 | Schema:
regions (alias: rgn)(id, status, code, type)
projects(name, level, status, value)
Task: Retrieve value from regions that have at least one corresponding entry in projects sharing the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02219 | train |
v3 | Schema:
categories (alias: catg)(id, date, status, salary)
staff(type, id, salary, level)
Task: Find id from categories where value exceeds the maximum amount from staff for the same code.
SQL: | SELECT id FROM categories AS catg
WHERE value > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02220 | train |
v3 | Schema:
employees (alias: emp)(value, id, code, amount)
customers(value, amount, code, level)
Task: Find name from employees where value exceeds the minimum salary from customers for the same status.
SQL: | SELECT name FROM employees AS emp
WHERE value > (
SELECT MIN(salary) FROM customers AS cust
WHERE cust.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02221 | train |
v2 | Schema:
requests (alias: ordr)(level, type, name, date)
invoices(value, level, salary, code)
Task: Retrieve amount from requests that have at least one corresponding entry in invoices sharing the same code.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02222 | train |
v1 | Schema:
items (alias: lne)(level, salary, amount, name)
sales(date, salary, name, type)
Task: Retrieve value from items whose code is found in sales rows where status matches the outer record.
SQL: | SELECT value FROM items AS lne
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.status = lne.status
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02223 | train |
v2 | Schema:
sales (alias: sale)(salary, amount, type, level)
branches(salary, code, status, value)
Task: Retrieve amount from sales that have at least one corresponding entry in branches sharing 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_02224 | train |
v3 | Schema:
orders (alias: ord)(type, salary, code, name)
branches(status, type, id, date)
Task: Retrieve value from orders with salary above the AVG(amount) of branches rows sharing the same type.
SQL: | SELECT value FROM orders AS ord
WHERE salary > (
SELECT AVG(amount) FROM branches AS brc
WHERE brc.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02225 | train |
v3 | Schema:
staff (alias: empl)(code, value, name, salary)
schedules(value, salary, date, status)
Task: Find salary from staff where salary exceeds the count of amount from schedules for the same status.
SQL: | SELECT salary FROM staff AS empl
WHERE salary > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02226 | train |
v2 | Schema:
projects (alias: prj)(name, date, type, status)
products(status, level, value, amount)
Task: Retrieve amount from projects that have at least one corresponding entry in products sharing the same status.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02227 | train |
v3 | Schema:
invoices (alias: inv)(status, type, amount, code)
departments(id, amount, level, value)
Task: Find id from invoices where amount exceeds the maximum value from departments for the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE amount > (
SELECT MAX(value) FROM departments AS dept
WHERE dept.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02228 | train |
v2 | Schema:
customers (alias: cust)(date, id, salary, level)
requests(date, id, code, value)
Task: Find id from customers where a matching record exists in requests with the same code.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02229 | train |
v1 | Schema:
categories (alias: catg)(salary, amount, name, level)
managers(level, date, amount, value)
Task: Retrieve code from categories whose code is found in managers rows where id matches the outer record.
SQL: | SELECT code FROM categories AS catg
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02230 | train |
v1 | Schema:
sales (alias: sale)(type, code, name, salary)
requests(id, code, status, type)
Task: Retrieve salary from sales whose status is found in requests rows where type matches the outer record.
SQL: | SELECT salary FROM sales AS sale
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02231 | train |
v2 | Schema:
orders (alias: ord)(type, salary, value, id)
requests(id, date, value, type)
Task: Find code from orders where a matching record exists in requests with the same level.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02232 | train |
v3 | Schema:
schedules (alias: schd)(code, salary, name, level)
items(amount, date, salary, level)
Task: Find amount from schedules where value exceeds the maximum salary from items for the same type.
SQL: | SELECT amount FROM schedules AS schd
WHERE value > (
SELECT MAX(salary) FROM items AS lne
WHERE lne.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02233 | train |
v2 | Schema:
branches (alias: brc)(level, salary, id, name)
accounts(code, status, id, salary)
Task: Retrieve code from branches that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "accounts",
"outer_alias": "brc",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02234 | train |
v1 | Schema:
orders (alias: ord)(level, salary, amount, value)
requests(type, value, date, amount)
Task: Retrieve code from orders whose code is found in requests rows where id matches the outer record.
SQL: | SELECT code FROM orders AS ord
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02235 | train |
v2 | Schema:
accounts (alias: acct)(amount, name, salary, type)
branches(salary, code, date, id)
Task: Find id from accounts where a matching record exists in branches with the same type.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02236 | train |
v2 | Schema:
shipments (alias: shp)(name, type, amount, value)
staff(type, id, code, salary)
Task: Retrieve amount from shipments that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02237 | train |
v2 | Schema:
items (alias: lne)(date, type, status, code)
managers(date, name, code, salary)
Task: Find salary from items where a matching record exists in managers with the same level.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = lne.level
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02238 | train |
v1 | Schema:
items (alias: lne)(value, level, date, salary)
regions(status, name, date, salary)
Task: Select code from items where status exists in regions for the same status.
SQL: | SELECT code FROM items AS lne
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02239 | train |
v2 | Schema:
schedules (alias: schd)(value, status, level, code)
sales(date, level, value, code)
Task: Retrieve salary from schedules that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02240 | train |
v2 | Schema:
transactions (alias: txn)(status, id, code, value)
regions(code, id, name, type)
Task: Find id from transactions where a matching record exists in regions with the same type.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02241 | train |
v2 | Schema:
invoices (alias: inv)(level, code, salary, amount)
customers(date, name, id, type)
Task: Retrieve salary from invoices that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02242 | train |
v3 | Schema:
managers (alias: mgr)(date, code, amount, name)
departments(id, amount, level, status)
Task: Find code from managers where salary exceeds the total value from departments for the same type.
SQL: | SELECT code FROM managers AS mgr
WHERE salary > (
SELECT SUM(value) FROM departments AS dept
WHERE dept.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02243 | train |
v1 | Schema:
projects (alias: prj)(status, salary, type, date)
shipments(id, type, date, amount)
Task: Select code from projects where id exists in shipments for the same status.
SQL: | SELECT code FROM projects AS prj
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02244 | train |
v1 | Schema:
schedules (alias: schd)(salary, value, type, id)
items(name, type, id, code)
Task: Find value from schedules where level appears in items entries with matching level.
SQL: | SELECT value FROM schedules AS schd
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02245 | train |
v1 | Schema:
transactions (alias: txn)(code, id, level, type)
projects(status, value, amount, type)
Task: Find code from transactions where status appears in projects entries with matching id.
SQL: | SELECT code FROM transactions AS txn
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02246 | train |
v1 | Schema:
schedules (alias: schd)(type, level, value, salary)
employees(level, amount, name, salary)
Task: Retrieve id from schedules whose type is found in employees rows where status matches the outer record.
SQL: | SELECT id FROM schedules AS schd
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02247 | train |
v2 | Schema:
shipments (alias: shp)(code, amount, value, name)
staff(status, amount, code, id)
Task: Find amount from shipments where a matching record exists in staff with the same level.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02248 | train |
v3 | Schema:
employees (alias: emp)(type, date, code, value)
sales(name, status, code, date)
Task: Retrieve id from employees with salary above the MIN(value) of sales rows sharing the same type.
SQL: | SELECT id FROM employees AS emp
WHERE salary > (
SELECT MIN(value) FROM sales AS sale
WHERE sale.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02249 | train |
v1 | Schema:
orders (alias: ord)(level, status, value, date)
tasks(amount, code, salary, value)
Task: Select value from orders where level exists in tasks for the same type.
SQL: | SELECT value FROM orders AS ord
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02250 | train |
v1 | Schema:
items (alias: lne)(value, code, name, date)
requests(status, date, salary, id)
Task: Find amount from items where code appears in requests entries with matching level.
SQL: | SELECT amount FROM items AS lne
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.level = lne.level
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02251 | train |
v2 | Schema:
items (alias: lne)(level, amount, status, value)
accounts(amount, date, id, name)
Task: Find name from items where a matching record exists in accounts with the same status.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = lne.status
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02252 | train |
v3 | Schema:
staff (alias: empl)(value, status, amount, level)
employees(type, code, salary, id)
Task: Retrieve salary from staff with value above the MAX(value) of employees rows sharing the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE value > (
SELECT MAX(value) FROM employees AS emp
WHERE emp.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02253 | train |
v1 | Schema:
requests (alias: ordr)(status, level, salary, type)
sales(status, name, value, code)
Task: Find name from requests where id appears in sales entries with matching status.
SQL: | SELECT name FROM requests AS ordr
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02254 | train |
v3 | Schema:
customers (alias: cust)(id, status, salary, date)
requests(id, amount, code, salary)
Task: Find value from customers where amount exceeds the average salary from requests for the same type.
SQL: | SELECT value FROM customers AS cust
WHERE amount > (
SELECT AVG(salary) FROM requests AS ordr
WHERE ordr.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02255 | train |
v1 | Schema:
items (alias: lne)(date, amount, salary, status)
departments(date, value, id, salary)
Task: Retrieve name from items whose id is found in departments rows where code matches the outer record.
SQL: | SELECT name FROM items AS lne
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.code = lne.code
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02256 | train |
v2 | Schema:
accounts (alias: acct)(level, id, amount, salary)
departments(level, name, status, id)
Task: Find name from accounts where a matching record exists in departments with the same id.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02257 | train |
v2 | Schema:
departments (alias: dept)(id, value, status, name)
tasks(salary, amount, date, level)
Task: Retrieve code from departments that have at least one corresponding entry in tasks sharing the same id.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02258 | train |
v3 | Schema:
accounts (alias: acct)(id, salary, amount, code)
customers(id, salary, code, level)
Task: Retrieve name from accounts with salary above the SUM(salary) of customers rows sharing the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE salary > (
SELECT SUM(salary) FROM customers AS cust
WHERE cust.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02259 | train |
v2 | Schema:
requests (alias: ordr)(value, id, code, salary)
regions(salary, code, name, amount)
Task: Find name from requests where a matching record exists in regions with the same code.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02260 | train |
v2 | Schema:
items (alias: lne)(status, level, amount, salary)
accounts(date, amount, value, code)
Task: Retrieve id from items that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = lne.level
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02261 | train |
v3 | Schema:
customers (alias: cust)(date, salary, value, level)
departments(name, salary, date, code)
Task: Retrieve amount from customers with salary above the COUNT(value) of departments rows sharing the same type.
SQL: | SELECT amount FROM customers AS cust
WHERE salary > (
SELECT COUNT(value) FROM departments AS dept
WHERE dept.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02262 | train |
v1 | Schema:
customers (alias: cust)(salary, type, value, date)
categories(level, status, name, amount)
Task: Select amount from customers where type exists in categories for the same type.
SQL: | SELECT amount FROM customers AS cust
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02263 | train |
v1 | Schema:
transactions (alias: txn)(status, type, name, value)
tasks(status, salary, value, level)
Task: Find value from transactions where status appears in tasks entries with matching level.
SQL: | SELECT value FROM transactions AS txn
WHERE status IN (
SELECT status 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": "status",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02264 | train |
v3 | Schema:
managers (alias: mgr)(code, id, amount, level)
tasks(type, salary, name, value)
Task: Find name from managers where amount exceeds the minimum value from tasks for the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE amount > (
SELECT MIN(value) FROM tasks AS tsk
WHERE tsk.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02265 | train |
v1 | Schema:
transactions (alias: txn)(id, type, amount, name)
accounts(date, type, id, level)
Task: Select value from transactions where id exists in accounts for the same level.
SQL: | SELECT value FROM transactions AS txn
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02266 | train |
v2 | Schema:
employees (alias: emp)(date, id, amount, name)
projects(id, code, status, date)
Task: Find code from employees where a matching record exists in projects with the same level.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "projects",
"outer_alias": "emp",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02267 | train |
v3 | Schema:
categories (alias: catg)(id, salary, amount, type)
tasks(status, type, id, level)
Task: Retrieve value from categories with value above the MAX(value) of tasks rows sharing the same code.
SQL: | SELECT value FROM categories AS catg
WHERE value > (
SELECT MAX(value) FROM tasks AS tsk
WHERE tsk.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02268 | train |
v3 | Schema:
invoices (alias: inv)(type, status, name, code)
customers(level, amount, date, value)
Task: Retrieve amount from invoices with value above the SUM(value) of customers rows sharing the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE value > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02269 | train |
v2 | Schema:
projects (alias: prj)(id, date, code, salary)
transactions(level, salary, name, id)
Task: Retrieve code from projects that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02270 | train |
v2 | Schema:
tasks (alias: tsk)(salary, code, id, name)
products(code, salary, type, name)
Task: Retrieve code from tasks that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02271 | train |
v3 | Schema:
managers (alias: mgr)(value, amount, code, type)
departments(value, type, date, code)
Task: Find code from managers where salary exceeds the count of value from departments for the same type.
SQL: | SELECT code FROM managers AS mgr
WHERE salary > (
SELECT COUNT(value) FROM departments AS dept
WHERE dept.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02272 | train |
v1 | Schema:
accounts (alias: acct)(code, date, salary, type)
managers(level, salary, date, amount)
Task: Retrieve amount from accounts whose status is found in managers rows where id matches the outer record.
SQL: | SELECT amount FROM accounts AS acct
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02273 | train |
v2 | Schema:
projects (alias: prj)(status, value, amount, code)
accounts(salary, code, id, value)
Task: Find salary from projects where a matching record exists in accounts with the same status.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02274 | train |
v3 | Schema:
regions (alias: rgn)(salary, date, id, code)
shipments(value, level, date, salary)
Task: Find id from regions where value exceeds the minimum amount from shipments for the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE value > (
SELECT MIN(amount) FROM shipments AS shp
WHERE shp.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02275 | train |
v1 | Schema:
categories (alias: catg)(salary, id, code, amount)
products(status, name, date, id)
Task: Select id from categories where id exists in products for the same id.
SQL: | SELECT id FROM categories AS catg
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02276 | train |
v1 | Schema:
managers (alias: mgr)(name, code, date, level)
categories(salary, code, date, name)
Task: Find name from managers where type appears in categories entries with matching type.
SQL: | SELECT name FROM managers AS mgr
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02277 | train |
v3 | Schema:
employees (alias: emp)(date, type, status, level)
shipments(level, name, salary, id)
Task: Retrieve salary from employees with amount above the MAX(salary) of shipments rows sharing the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE amount > (
SELECT MAX(salary) FROM shipments AS shp
WHERE shp.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02278 | train |
v2 | Schema:
schedules (alias: schd)(date, id, salary, name)
employees(status, salary, date, type)
Task: Find code from schedules where a matching record exists in employees with the same status.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02279 | train |
v1 | Schema:
branches (alias: brc)(name, status, code, value)
invoices(code, name, status, salary)
Task: Retrieve amount from branches whose type is found in invoices rows where id matches the outer record.
SQL: | SELECT amount FROM branches AS brc
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02280 | train |
v1 | Schema:
products (alias: prod)(amount, name, status, type)
sales(name, value, level, salary)
Task: Find id from products where status appears in sales entries with matching code.
SQL: | SELECT id FROM products AS prod
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.code = prod.code
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02281 | train |
v1 | Schema:
managers (alias: mgr)(status, type, name, value)
products(date, status, amount, type)
Task: Find salary from managers where level appears in products entries with matching type.
SQL: | SELECT salary FROM managers AS mgr
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02282 | train |
v2 | Schema:
regions (alias: rgn)(type, id, value, date)
shipments(id, code, salary, value)
Task: Find amount from regions where a matching record exists in shipments with the same id.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02283 | train |
v2 | Schema:
shipments (alias: shp)(name, status, amount, id)
items(level, amount, status, name)
Task: Retrieve id from shipments that have at least one corresponding entry in items sharing the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02284 | train |
v2 | Schema:
shipments (alias: shp)(value, salary, name, level)
sales(type, amount, level, code)
Task: Retrieve value from shipments that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02285 | train |
v3 | Schema:
managers (alias: mgr)(name, code, level, amount)
transactions(type, name, salary, status)
Task: Retrieve id from managers with value above the AVG(amount) of transactions rows sharing the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE value > (
SELECT AVG(amount) FROM transactions AS txn
WHERE txn.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02286 | train |
v2 | Schema:
shipments (alias: shp)(salary, id, code, status)
accounts(salary, value, id, code)
Task: Find amount from shipments where a matching record exists in accounts with the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02287 | train |
v1 | Schema:
transactions (alias: txn)(date, type, name, status)
invoices(value, date, status, level)
Task: Retrieve code from transactions whose status is found in invoices rows where status matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02288 | train |
v1 | Schema:
employees (alias: emp)(amount, status, code, salary)
accounts(status, code, amount, type)
Task: Retrieve code from employees whose level is found in accounts rows where id matches the outer record.
SQL: | SELECT code FROM employees AS emp
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02289 | train |
v2 | Schema:
transactions (alias: txn)(name, id, amount, date)
shipments(name, salary, amount, type)
Task: Find amount from transactions where a matching record exists in shipments with the same code.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02290 | train |
v3 | Schema:
categories (alias: catg)(id, date, value, level)
items(salary, value, date, name)
Task: Find id from categories where value exceeds the minimum amount from items for the same status.
SQL: | SELECT id FROM categories AS catg
WHERE value > (
SELECT MIN(amount) FROM items AS lne
WHERE lne.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02291 | train |
v1 | Schema:
schedules (alias: schd)(id, amount, code, level)
accounts(id, date, code, level)
Task: Find amount from schedules where code appears in accounts entries with matching code.
SQL: | SELECT amount FROM schedules AS schd
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02292 | train |
v3 | Schema:
employees (alias: emp)(salary, level, name, date)
shipments(date, type, amount, name)
Task: Retrieve code from employees with amount above the MAX(amount) of shipments rows sharing the same status.
SQL: | SELECT code FROM employees AS emp
WHERE amount > (
SELECT MAX(amount) FROM shipments AS shp
WHERE shp.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02293 | train |
v3 | Schema:
departments (alias: dept)(level, code, date, amount)
categories(type, date, name, level)
Task: Retrieve id from departments with value above the MIN(salary) of categories rows sharing the same id.
SQL: | SELECT id FROM departments AS dept
WHERE value > (
SELECT MIN(salary) FROM categories AS catg
WHERE catg.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02294 | train |
v1 | Schema:
sales (alias: sale)(level, id, amount, value)
items(status, value, salary, name)
Task: Select amount from sales where type exists in items for the same level.
SQL: | SELECT amount FROM sales AS sale
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02295 | train |
v1 | Schema:
regions (alias: rgn)(name, status, value, salary)
requests(value, date, type, code)
Task: Select name from regions where id exists in requests for the same id.
SQL: | SELECT name FROM regions AS rgn
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02296 | train |
v1 | Schema:
managers (alias: mgr)(name, type, level, status)
products(salary, code, id, type)
Task: Select id from managers where level exists in products for the same id.
SQL: | SELECT id FROM managers AS mgr
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02297 | train |
v2 | Schema:
departments (alias: dept)(date, status, level, amount)
schedules(date, name, level, code)
Task: Find amount from departments where a matching record exists in schedules with the same id.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02298 | train |
v2 | Schema:
invoices (alias: inv)(date, amount, code, value)
shipments(salary, status, code, type)
Task: Retrieve name from invoices that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02299 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.