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:
tasks (alias: tsk)(salary, name, status, level)
schedules(value, id, type, code)
Task: Find value from tasks where a matching record exists in schedules with the same level.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_12300 | train |
v1 | Schema:
employees (alias: emp)(date, level, id, status)
branches(id, code, type, name)
Task: Select value from employees where type exists in branches for the same level.
SQL: | SELECT value FROM employees AS emp
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12301 | train |
v3 | Schema:
requests (alias: ordr)(value, name, level, id)
branches(level, code, name, date)
Task: Retrieve id from requests with salary above the AVG(amount) of branches rows sharing the same type.
SQL: | SELECT id FROM requests AS ordr
WHERE salary > (
SELECT AVG(amount) FROM branches AS brc
WHERE brc.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12302 | train |
v3 | Schema:
regions (alias: rgn)(date, name, value, level)
transactions(amount, id, salary, type)
Task: Find code from regions where salary exceeds the minimum salary from transactions for the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE salary > (
SELECT MIN(salary) FROM transactions AS txn
WHERE txn.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"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_12303 | train |
v1 | Schema:
transactions (alias: txn)(type, date, id, name)
invoices(code, amount, date, name)
Task: Retrieve code from transactions whose code is found in invoices rows where status matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE code IN (
SELECT code 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": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12304 | train |
v1 | Schema:
managers (alias: mgr)(code, salary, name, type)
items(code, id, status, value)
Task: Retrieve amount from managers whose type is found in items rows where id matches the outer record.
SQL: | SELECT amount FROM managers AS mgr
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12305 | train |
v3 | Schema:
tasks (alias: tsk)(code, status, salary, amount)
shipments(type, code, value, amount)
Task: Find code from tasks where value exceeds the average value from shipments for the same id.
SQL: | SELECT code FROM tasks AS tsk
WHERE value > (
SELECT AVG(value) FROM shipments AS shp
WHERE shp.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_12306 | train |
v3 | Schema:
orders (alias: ord)(id, salary, amount, value)
accounts(amount, value, name, code)
Task: Retrieve id from orders with amount above the MIN(value) of accounts rows sharing the same id.
SQL: | SELECT id FROM orders AS ord
WHERE amount > (
SELECT MIN(value) FROM accounts AS acct
WHERE acct.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12307 | train |
v2 | Schema:
departments (alias: dept)(code, status, salary, value)
requests(status, date, type, salary)
Task: Find salary from departments where a matching record exists in requests with the same code.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12308 | train |
v2 | Schema:
regions (alias: rgn)(level, status, value, id)
customers(code, salary, date, level)
Task: Retrieve value from regions that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_12309 | train |
v1 | Schema:
products (alias: prod)(value, date, code, amount)
categories(name, value, status, level)
Task: Find amount from products where type appears in categories entries with matching code.
SQL: | SELECT amount FROM products AS prod
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.code = prod.code
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12310 | train |
v1 | Schema:
products (alias: prod)(type, date, level, id)
schedules(salary, date, status, level)
Task: Find name from products where code appears in schedules entries with matching id.
SQL: | SELECT name FROM products AS prod
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.id = prod.id
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12311 | train |
v1 | Schema:
requests (alias: ordr)(id, code, salary, amount)
categories(salary, level, value, id)
Task: Select salary from requests where id exists in categories for the same type.
SQL: | SELECT salary FROM requests AS ordr
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12312 | train |
v3 | Schema:
employees (alias: emp)(value, date, type, name)
sales(date, amount, status, type)
Task: Find salary from employees where value exceeds the minimum salary from sales for the same level.
SQL: | SELECT salary FROM employees AS emp
WHERE value > (
SELECT MIN(salary) FROM sales AS sale
WHERE sale.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12313 | train |
v1 | Schema:
regions (alias: rgn)(amount, date, code, status)
invoices(code, value, amount, type)
Task: Find code from regions where status appears in invoices entries with matching level.
SQL: | SELECT code FROM regions AS rgn
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_12314 | train |
v3 | Schema:
regions (alias: rgn)(salary, level, date, amount)
transactions(id, amount, status, name)
Task: Retrieve value from regions with salary above the SUM(value) of transactions rows sharing the same type.
SQL: | SELECT value FROM regions AS rgn
WHERE salary > (
SELECT SUM(value) FROM transactions AS txn
WHERE txn.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_12315 | train |
v2 | Schema:
transactions (alias: txn)(status, name, salary, id)
schedules(type, level, name, status)
Task: Retrieve code from transactions that have at least one corresponding entry in schedules sharing the same type.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12316 | train |
v3 | Schema:
transactions (alias: txn)(id, date, amount, level)
departments(name, type, code, level)
Task: Retrieve id from transactions with amount above the SUM(salary) of departments rows sharing the same code.
SQL: | SELECT id FROM transactions AS txn
WHERE amount > (
SELECT SUM(salary) FROM departments AS dept
WHERE dept.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12317 | train |
v1 | Schema:
shipments (alias: shp)(type, date, value, code)
sales(value, status, id, date)
Task: Select id from shipments where type exists in sales for the same level.
SQL: | SELECT id FROM shipments AS shp
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_12318 | train |
v1 | Schema:
branches (alias: brc)(value, status, amount, salary)
departments(id, level, status, type)
Task: Retrieve name from branches whose status is found in departments rows where code matches the outer record.
SQL: | SELECT name FROM branches AS brc
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "departments",
"outer_alias": "brc",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12319 | train |
v2 | Schema:
requests (alias: ordr)(value, salary, id, code)
employees(salary, status, date, id)
Task: Retrieve code from requests that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12320 | train |
v3 | Schema:
products (alias: prod)(salary, level, type, code)
items(date, name, code, id)
Task: Retrieve amount from products with value above the SUM(salary) of items rows sharing the same code.
SQL: | SELECT amount FROM products AS prod
WHERE value > (
SELECT SUM(salary) FROM items AS lne
WHERE lne.code = prod.code
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12321 | train |
v3 | Schema:
transactions (alias: txn)(status, name, date, salary)
shipments(value, name, date, salary)
Task: Find amount from transactions where value exceeds the maximum amount from shipments for the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE value > (
SELECT MAX(amount) FROM shipments AS shp
WHERE shp.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12322 | train |
v3 | Schema:
requests (alias: ordr)(value, date, amount, code)
shipments(type, code, status, amount)
Task: Retrieve value from requests with salary above the SUM(amount) of shipments rows sharing the same status.
SQL: | SELECT value FROM requests AS ordr
WHERE salary > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12323 | train |
v2 | Schema:
customers (alias: cust)(type, id, status, name)
schedules(value, type, date, amount)
Task: Find value from customers where a matching record exists in schedules with the same code.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12324 | train |
v3 | Schema:
categories (alias: catg)(date, salary, amount, name)
orders(salary, name, type, value)
Task: Find amount from categories where amount exceeds the minimum amount from orders for the same status.
SQL: | SELECT amount FROM categories AS catg
WHERE amount > (
SELECT MIN(amount) FROM orders AS ord
WHERE ord.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12325 | train |
v1 | Schema:
requests (alias: ordr)(amount, name, code, id)
items(code, level, id, salary)
Task: Retrieve id from requests whose type is found in items rows where code matches the outer record.
SQL: | SELECT id FROM requests AS ordr
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12326 | train |
v3 | Schema:
transactions (alias: txn)(amount, name, level, salary)
sales(name, status, type, level)
Task: Find code from transactions where salary exceeds the minimum salary from sales for the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE salary > (
SELECT MIN(salary) FROM sales AS sale
WHERE sale.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12327 | train |
v2 | Schema:
tasks (alias: tsk)(salary, code, value, status)
projects(level, value, type, status)
Task: Retrieve salary from tasks that have at least one corresponding entry in projects sharing the same id.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_12328 | train |
v2 | Schema:
staff (alias: empl)(type, salary, id, status)
shipments(amount, value, id, type)
Task: Find salary from staff where a matching record exists in shipments with the same type.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_12329 | train |
v2 | Schema:
regions (alias: rgn)(value, code, date, amount)
products(name, value, level, status)
Task: Find id from regions where a matching record exists in products with the same type.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_12330 | train |
v2 | Schema:
customers (alias: cust)(level, type, amount, value)
regions(name, salary, amount, status)
Task: Retrieve id from customers that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12331 | train |
v1 | Schema:
regions (alias: rgn)(amount, name, type, value)
customers(id, code, date, amount)
Task: Find code from regions where type appears in customers entries with matching id.
SQL: | SELECT code FROM regions AS rgn
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_12332 | train |
v1 | Schema:
items (alias: lne)(date, salary, amount, type)
departments(status, name, id, amount)
Task: Select name from items where level exists in departments for the same code.
SQL: | SELECT name FROM items AS lne
WHERE level IN (
SELECT level 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": "level",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12333 | train |
v2 | Schema:
invoices (alias: inv)(code, level, salary, status)
schedules(value, date, code, type)
Task: Find code from invoices where a matching record exists in schedules with the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12334 | train |
v1 | Schema:
customers (alias: cust)(date, value, salary, status)
products(code, level, date, type)
Task: Find value from customers where code appears in products entries with matching type.
SQL: | SELECT value FROM customers AS cust
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12335 | train |
v3 | Schema:
projects (alias: prj)(value, status, type, name)
employees(level, code, status, amount)
Task: Retrieve id from projects with amount above the COUNT(value) of employees rows sharing the same type.
SQL: | SELECT id FROM projects AS prj
WHERE amount > (
SELECT COUNT(value) FROM employees AS emp
WHERE emp.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_12336 | train |
v2 | Schema:
items (alias: lne)(level, amount, date, name)
categories(date, type, value, salary)
Task: Find amount from items where a matching record exists in categories with the same id.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = lne.id
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12337 | train |
v1 | Schema:
regions (alias: rgn)(id, level, date, code)
departments(name, code, level, id)
Task: Select id from regions where level exists in departments for the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_12338 | train |
v3 | Schema:
invoices (alias: inv)(level, type, status, id)
customers(date, status, level, id)
Task: Retrieve amount from invoices with salary above the COUNT(amount) of customers rows sharing the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE salary > (
SELECT COUNT(amount) FROM customers AS cust
WHERE cust.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12339 | train |
v3 | Schema:
requests (alias: ordr)(type, date, level, salary)
employees(amount, type, level, value)
Task: Retrieve id from requests with salary above the SUM(salary) of employees rows sharing the same type.
SQL: | SELECT id FROM requests AS ordr
WHERE salary > (
SELECT SUM(salary) FROM employees AS emp
WHERE emp.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12340 | train |
v2 | Schema:
staff (alias: empl)(name, id, status, type)
sales(date, id, name, amount)
Task: Retrieve value from staff that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_12341 | train |
v1 | Schema:
categories (alias: catg)(salary, type, date, amount)
regions(amount, type, name, date)
Task: Retrieve name from categories whose type is found in regions rows where type matches the outer record.
SQL: | SELECT name FROM categories AS catg
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12342 | train |
v1 | Schema:
regions (alias: rgn)(date, name, value, type)
managers(date, code, id, salary)
Task: Find name from regions where id appears in managers entries with matching code.
SQL: | SELECT name FROM regions AS rgn
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_12343 | train |
v3 | Schema:
shipments (alias: shp)(salary, date, status, type)
staff(level, id, date, value)
Task: Retrieve id from shipments with value above the AVG(value) of staff rows sharing the same status.
SQL: | SELECT id FROM shipments AS shp
WHERE value > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_12344 | train |
v1 | Schema:
regions (alias: rgn)(level, name, id, type)
categories(name, amount, value, status)
Task: Find salary from regions where code appears in categories entries with matching status.
SQL: | SELECT salary FROM regions AS rgn
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_12345 | train |
v3 | Schema:
shipments (alias: shp)(amount, date, type, value)
sales(type, status, name, value)
Task: Find name from shipments where amount exceeds the total salary from sales for the same status.
SQL: | SELECT name FROM shipments AS shp
WHERE amount > (
SELECT SUM(salary) FROM sales AS sale
WHERE sale.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_12346 | train |
v2 | Schema:
categories (alias: catg)(name, code, level, amount)
customers(status, value, name, id)
Task: Find name from categories where a matching record exists in customers with the same type.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12347 | train |
v2 | Schema:
projects (alias: prj)(level, amount, type, value)
sales(date, salary, id, status)
Task: Find amount from projects where a matching record exists in sales with the same code.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_12348 | train |
v2 | Schema:
items (alias: lne)(date, code, name, type)
shipments(id, type, value, date)
Task: Find id from items where a matching record exists in shipments with the same type.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = lne.type
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12349 | train |
v2 | Schema:
projects (alias: prj)(amount, id, date, salary)
orders(amount, level, id, type)
Task: Find value from projects where a matching record exists in orders with the same level.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "orders",
"outer_alias": "prj",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_12350 | train |
v3 | Schema:
departments (alias: dept)(value, date, salary, status)
requests(status, date, value, type)
Task: Retrieve value from departments with salary above the COUNT(salary) of requests rows sharing the same code.
SQL: | SELECT value FROM departments AS dept
WHERE salary > (
SELECT COUNT(salary) FROM requests AS ordr
WHERE ordr.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12351 | train |
v1 | Schema:
requests (alias: ordr)(level, name, date, amount)
departments(amount, name, type, code)
Task: Retrieve name from requests whose status is found in departments rows where level matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12352 | train |
v1 | Schema:
categories (alias: catg)(status, id, salary, code)
staff(amount, type, level, date)
Task: Select id from categories where id exists in staff for the same type.
SQL: | SELECT id FROM categories AS catg
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12353 | train |
v2 | Schema:
items (alias: lne)(code, level, id, type)
accounts(level, id, code, salary)
Task: Retrieve code from items that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT code 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": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12354 | train |
v3 | Schema:
departments (alias: dept)(code, value, id, date)
tasks(id, date, amount, level)
Task: Retrieve name from departments with value above the SUM(salary) of tasks rows sharing the same status.
SQL: | SELECT name FROM departments AS dept
WHERE value > (
SELECT SUM(salary) FROM tasks AS tsk
WHERE tsk.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12355 | train |
v1 | Schema:
managers (alias: mgr)(date, type, salary, code)
shipments(id, value, date, amount)
Task: Select value from managers where status exists in shipments for the same code.
SQL: | SELECT value FROM managers AS mgr
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12356 | train |
v2 | Schema:
employees (alias: emp)(id, name, status, level)
accounts(salary, date, id, type)
Task: Retrieve value from employees that have at least one corresponding entry in accounts sharing the same type.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12357 | train |
v3 | Schema:
departments (alias: dept)(value, salary, status, level)
items(amount, date, id, status)
Task: Find value from departments where value exceeds the minimum value from items for the same level.
SQL: | SELECT value FROM departments AS dept
WHERE value > (
SELECT MIN(value) FROM items AS lne
WHERE lne.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12358 | train |
v2 | Schema:
items (alias: lne)(status, level, name, amount)
products(level, value, id, type)
Task: Find salary from items where a matching record exists in products with the same type.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = lne.type
); | {
"outer_table": "items",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12359 | train |
v1 | Schema:
departments (alias: dept)(code, id, type, salary)
staff(value, amount, id, level)
Task: Retrieve code from departments whose id is found in staff rows where id matches the outer record.
SQL: | SELECT code FROM departments AS dept
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12360 | train |
v3 | Schema:
customers (alias: cust)(name, level, value, date)
accounts(status, name, value, code)
Task: Retrieve id from customers with amount above the MIN(amount) of accounts rows sharing the same level.
SQL: | SELECT id FROM customers AS cust
WHERE amount > (
SELECT MIN(amount) FROM accounts AS acct
WHERE acct.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12361 | train |
v1 | Schema:
transactions (alias: txn)(code, level, id, type)
items(id, salary, type, level)
Task: Select amount from transactions where type exists in items for the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12362 | train |
v2 | Schema:
items (alias: lne)(date, type, id, code)
tasks(level, id, name, date)
Task: Retrieve code from items that have at least one corresponding entry in tasks sharing the same id.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = lne.id
); | {
"outer_table": "items",
"inner_table": "tasks",
"outer_alias": "lne",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12363 | train |
v1 | Schema:
staff (alias: empl)(date, name, status, type)
accounts(type, code, status, id)
Task: Find salary from staff where status appears in accounts entries with matching level.
SQL: | SELECT salary FROM staff AS empl
WHERE status IN (
SELECT status 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": "status",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_12364 | train |
v3 | Schema:
sales (alias: sale)(salary, value, id, status)
customers(name, salary, type, date)
Task: Find value from sales where salary exceeds the maximum salary from customers for the same status.
SQL: | SELECT value FROM sales AS sale
WHERE salary > (
SELECT MAX(salary) FROM customers AS cust
WHERE cust.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12365 | train |
v1 | Schema:
managers (alias: mgr)(code, level, value, date)
staff(amount, level, code, date)
Task: Find name from managers where level appears in staff entries with matching level.
SQL: | SELECT name FROM managers AS mgr
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12366 | train |
v3 | Schema:
invoices (alias: inv)(level, date, type, name)
managers(value, status, id, code)
Task: Find value from invoices where salary exceeds the maximum value from managers for the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE salary > (
SELECT MAX(value) FROM managers AS mgr
WHERE mgr.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12367 | train |
v2 | Schema:
projects (alias: prj)(name, salary, code, date)
transactions(code, type, id, status)
Task: Retrieve amount from projects that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_12368 | train |
v1 | Schema:
regions (alias: rgn)(id, date, type, amount)
sales(id, status, salary, type)
Task: Find value from regions where id appears in sales entries with matching id.
SQL: | SELECT value FROM regions AS rgn
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_12369 | train |
v3 | Schema:
requests (alias: ordr)(level, amount, code, id)
products(amount, level, status, code)
Task: Find code from requests where value exceeds the count of amount from products for the same level.
SQL: | SELECT code FROM requests AS ordr
WHERE value > (
SELECT COUNT(amount) FROM products AS prod
WHERE prod.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12370 | train |
v2 | Schema:
categories (alias: catg)(name, id, type, value)
items(code, salary, value, amount)
Task: Retrieve id from categories that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12371 | train |
v1 | Schema:
branches (alias: brc)(id, code, amount, type)
employees(amount, id, status, date)
Task: Select amount from branches where level exists in employees for the same code.
SQL: | SELECT amount FROM branches AS brc
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12372 | train |
v3 | Schema:
departments (alias: dept)(id, type, date, code)
categories(code, type, amount, status)
Task: Retrieve code from departments with salary above the MIN(value) of categories rows sharing the same code.
SQL: | SELECT code FROM departments AS dept
WHERE salary > (
SELECT MIN(value) FROM categories AS catg
WHERE catg.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12373 | train |
v2 | Schema:
transactions (alias: txn)(status, value, salary, name)
departments(level, status, amount, name)
Task: Find value from transactions where a matching record exists in departments with the same id.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12374 | train |
v3 | Schema:
items (alias: lne)(id, status, date, salary)
invoices(salary, id, amount, type)
Task: Find salary from items where value exceeds the count of amount from invoices for the same status.
SQL: | SELECT salary FROM items AS lne
WHERE value > (
SELECT COUNT(amount) FROM invoices AS inv
WHERE inv.status = lne.status
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12375 | train |
v3 | Schema:
branches (alias: brc)(date, level, code, id)
items(status, salary, code, name)
Task: Find value from branches where value exceeds the minimum amount from items for the same status.
SQL: | SELECT value FROM branches AS brc
WHERE value > (
SELECT MIN(amount) FROM items AS lne
WHERE lne.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12376 | train |
v1 | Schema:
items (alias: lne)(type, date, amount, value)
tasks(level, value, date, salary)
Task: Retrieve value from items whose code is found in tasks rows where code matches the outer record.
SQL: | SELECT value FROM items AS lne
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.code = lne.code
); | {
"outer_table": "items",
"inner_table": "tasks",
"outer_alias": "lne",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12377 | train |
v2 | Schema:
tasks (alias: tsk)(value, salary, level, amount)
staff(status, type, level, id)
Task: Find salary from tasks where a matching record exists in staff with the same code.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "staff",
"outer_alias": "tsk",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_12378 | train |
v1 | Schema:
products (alias: prod)(type, name, amount, level)
branches(level, salary, value, code)
Task: Select id from products where type exists in branches for the same code.
SQL: | SELECT id FROM products AS prod
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.code = prod.code
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12379 | train |
v2 | Schema:
schedules (alias: schd)(code, name, salary, type)
managers(type, salary, value, status)
Task: Find value from schedules where a matching record exists in managers with the same type.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12380 | train |
v3 | Schema:
transactions (alias: txn)(salary, status, value, type)
invoices(date, salary, id, status)
Task: Retrieve code from transactions with salary above the AVG(amount) of invoices rows sharing the same type.
SQL: | SELECT code FROM transactions AS txn
WHERE salary > (
SELECT AVG(amount) FROM invoices AS inv
WHERE inv.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12381 | train |
v3 | Schema:
departments (alias: dept)(level, status, id, code)
requests(id, code, value, level)
Task: Retrieve name from departments with amount above the MIN(salary) of requests rows sharing the same type.
SQL: | SELECT name FROM departments AS dept
WHERE amount > (
SELECT MIN(salary) FROM requests AS ordr
WHERE ordr.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12382 | train |
v2 | Schema:
requests (alias: ordr)(level, salary, id, date)
schedules(name, level, status, date)
Task: Retrieve amount from requests that have at least one corresponding entry in schedules sharing the same id.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12383 | train |
v1 | Schema:
products (alias: prod)(salary, name, date, status)
items(id, amount, status, salary)
Task: Retrieve salary from products whose status is found in items rows where level matches the outer record.
SQL: | SELECT salary FROM products AS prod
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.level = prod.level
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12384 | train |
v3 | Schema:
customers (alias: cust)(type, status, value, code)
shipments(status, id, code, type)
Task: Find amount from customers where amount exceeds the count of amount from shipments for the same type.
SQL: | SELECT amount FROM customers AS cust
WHERE amount > (
SELECT COUNT(amount) FROM shipments AS shp
WHERE shp.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12385 | train |
v2 | Schema:
departments (alias: dept)(date, level, type, code)
regions(name, date, type, level)
Task: Retrieve id from departments that have at least one corresponding entry in regions sharing the same level.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12386 | train |
v3 | Schema:
shipments (alias: shp)(date, amount, status, type)
employees(amount, status, date, code)
Task: Retrieve id from shipments with value above the AVG(amount) of employees rows sharing the same level.
SQL: | SELECT id FROM shipments AS shp
WHERE value > (
SELECT AVG(amount) FROM employees AS emp
WHERE emp.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_12387 | train |
v2 | Schema:
items (alias: lne)(value, type, level, id)
branches(level, name, id, amount)
Task: Retrieve id from items that have at least one corresponding entry in branches sharing the same code.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = lne.code
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12388 | train |
v1 | Schema:
items (alias: lne)(level, value, amount, name)
requests(status, name, code, id)
Task: Find code from items where level appears in requests entries with matching id.
SQL: | SELECT code FROM items AS lne
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.id = lne.id
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12389 | train |
v3 | Schema:
items (alias: lne)(salary, id, amount, type)
departments(level, code, name, id)
Task: Retrieve amount from items with salary above the SUM(value) of departments rows sharing the same code.
SQL: | SELECT amount FROM items AS lne
WHERE salary > (
SELECT SUM(value) FROM departments AS dept
WHERE dept.code = lne.code
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12390 | train |
v3 | Schema:
accounts (alias: acct)(code, id, date, level)
managers(salary, id, code, status)
Task: Retrieve name from accounts with value above the SUM(value) of managers rows sharing the same status.
SQL: | SELECT name FROM accounts AS acct
WHERE value > (
SELECT SUM(value) FROM managers AS mgr
WHERE mgr.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12391 | train |
v1 | Schema:
staff (alias: empl)(salary, type, level, name)
requests(salary, status, type, name)
Task: Retrieve id from staff whose code is found in requests rows where code matches the outer record.
SQL: | SELECT id FROM staff AS empl
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_12392 | train |
v2 | Schema:
sales (alias: sale)(status, level, code, id)
products(status, date, name, level)
Task: Find amount from sales where a matching record exists in products with the same level.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12393 | train |
v3 | Schema:
employees (alias: emp)(value, type, amount, level)
products(level, code, value, id)
Task: Find amount from employees where salary exceeds the minimum salary from products for the same id.
SQL: | SELECT amount FROM employees AS emp
WHERE salary > (
SELECT MIN(salary) FROM products AS prod
WHERE prod.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12394 | train |
v2 | Schema:
regions (alias: rgn)(amount, code, type, level)
customers(status, id, salary, type)
Task: Retrieve code from regions that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT code 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": "code",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_12395 | train |
v2 | Schema:
requests (alias: ordr)(status, id, name, type)
accounts(value, status, level, name)
Task: Retrieve salary from requests that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12396 | train |
v1 | Schema:
sales (alias: sale)(status, value, id, amount)
managers(id, level, name, date)
Task: Find salary from sales where id appears in managers entries with matching level.
SQL: | SELECT salary FROM sales AS sale
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12397 | train |
v3 | Schema:
accounts (alias: acct)(value, level, id, status)
schedules(code, date, amount, id)
Task: Retrieve value from accounts with value above the AVG(salary) of schedules rows sharing the same code.
SQL: | SELECT value FROM accounts AS acct
WHERE value > (
SELECT AVG(salary) FROM schedules AS schd
WHERE schd.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12398 | train |
v1 | Schema:
orders (alias: ord)(salary, amount, code, name)
employees(salary, level, id, value)
Task: Find code from orders where code appears in employees entries with matching type.
SQL: | SELECT code FROM orders AS ord
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12399 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.