variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v3 | Schema:
staff (alias: empl)(amount, type, salary, status)
customers(value, status, id, code)
Task: Find name from staff where salary exceeds the maximum salary from customers for the same id.
SQL: | SELECT name FROM staff AS empl
WHERE salary > (
SELECT MAX(salary) FROM customers AS cust
WHERE cust.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02100 | train |
v1 | Schema:
items (alias: lne)(date, salary, type, code)
employees(value, amount, code, status)
Task: Retrieve salary from items whose id is found in employees rows where code matches the outer record.
SQL: | SELECT salary FROM items AS lne
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.code = lne.code
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02101 | train |
v3 | Schema:
managers (alias: mgr)(salary, name, value, type)
items(status, code, amount, date)
Task: Retrieve value from managers with salary above the MIN(amount) of items rows sharing the same code.
SQL: | SELECT value FROM managers AS mgr
WHERE salary > (
SELECT MIN(amount) FROM items AS lne
WHERE lne.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02102 | train |
v1 | Schema:
requests (alias: ordr)(date, type, salary, level)
items(name, id, status, date)
Task: Select salary from requests where id exists in items for the same id.
SQL: | SELECT salary FROM requests AS ordr
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02103 | train |
v2 | Schema:
departments (alias: dept)(id, name, level, status)
items(date, status, value, code)
Task: Retrieve name from departments that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02104 | train |
v3 | Schema:
schedules (alias: schd)(amount, code, value, status)
accounts(id, value, status, salary)
Task: Find id from schedules where salary exceeds the total salary from accounts for the same level.
SQL: | SELECT id FROM schedules AS schd
WHERE salary > (
SELECT SUM(salary) FROM accounts AS acct
WHERE acct.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02105 | train |
v1 | Schema:
sales (alias: sale)(amount, id, value, name)
tasks(value, level, date, code)
Task: Select value from sales where id exists in tasks for the same code.
SQL: | SELECT value FROM sales AS sale
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02106 | train |
v3 | Schema:
requests (alias: ordr)(type, salary, id, code)
invoices(id, code, value, status)
Task: Retrieve salary from requests with salary above the MIN(amount) of invoices rows sharing the same type.
SQL: | SELECT salary FROM requests AS ordr
WHERE salary > (
SELECT MIN(amount) FROM invoices AS inv
WHERE inv.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02107 | train |
v1 | Schema:
accounts (alias: acct)(salary, status, amount, id)
customers(id, value, code, type)
Task: Select code from accounts where level exists in customers for the same status.
SQL: | SELECT code FROM accounts AS acct
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02108 | train |
v3 | Schema:
tasks (alias: tsk)(level, value, salary, date)
managers(value, level, type, code)
Task: Find amount from tasks where salary exceeds the maximum value from managers for the same id.
SQL: | SELECT amount FROM tasks AS tsk
WHERE salary > (
SELECT MAX(value) FROM managers AS mgr
WHERE mgr.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02109 | train |
v2 | Schema:
tasks (alias: tsk)(status, id, type, salary)
regions(value, id, amount, status)
Task: Find salary from tasks where a matching record exists in regions with the same status.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02110 | train |
v3 | Schema:
shipments (alias: shp)(id, value, amount, name)
transactions(value, level, name, amount)
Task: Find name from shipments where value exceeds the maximum amount from transactions for the same code.
SQL: | SELECT name FROM shipments AS shp
WHERE value > (
SELECT MAX(amount) FROM transactions AS txn
WHERE txn.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02111 | train |
v3 | Schema:
tasks (alias: tsk)(type, name, salary, level)
orders(salary, level, type, id)
Task: Find value from tasks where salary exceeds the total amount from orders for the same code.
SQL: | SELECT value FROM tasks AS tsk
WHERE salary > (
SELECT SUM(amount) FROM orders AS ord
WHERE ord.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02112 | train |
v3 | Schema:
accounts (alias: acct)(name, salary, id, level)
schedules(name, type, date, level)
Task: Retrieve name from accounts with amount above the AVG(value) of schedules rows sharing the same level.
SQL: | SELECT name FROM accounts AS acct
WHERE amount > (
SELECT AVG(value) FROM schedules AS schd
WHERE schd.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02113 | train |
v2 | Schema:
products (alias: prod)(amount, value, level, type)
shipments(id, name, level, status)
Task: Find amount from products where a matching record exists in shipments with the same status.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = prod.status
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02114 | train |
v1 | Schema:
employees (alias: emp)(level, code, salary, status)
branches(salary, name, level, value)
Task: Select name from employees where code exists in branches for the same code.
SQL: | SELECT name FROM employees AS emp
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02115 | train |
v3 | Schema:
regions (alias: rgn)(code, status, level, type)
schedules(amount, level, code, value)
Task: Find value from regions where salary exceeds the maximum salary from schedules for the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE salary > (
SELECT MAX(salary) FROM schedules AS schd
WHERE schd.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02116 | train |
v1 | Schema:
tasks (alias: tsk)(type, name, amount, value)
sales(date, value, type, code)
Task: Find salary from tasks where code appears in sales entries with matching code.
SQL: | SELECT salary FROM tasks AS tsk
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02117 | train |
v3 | Schema:
staff (alias: empl)(value, amount, code, type)
regions(level, name, amount, code)
Task: Find name from staff where value exceeds the minimum value from regions for the same level.
SQL: | SELECT name FROM staff AS empl
WHERE value > (
SELECT MIN(value) FROM regions AS rgn
WHERE rgn.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02118 | train |
v1 | Schema:
tasks (alias: tsk)(id, status, date, amount)
accounts(status, amount, level, name)
Task: Find code from tasks where type appears in accounts entries with matching type.
SQL: | SELECT code FROM tasks AS tsk
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02119 | train |
v1 | Schema:
schedules (alias: schd)(date, id, value, name)
items(type, code, date, amount)
Task: Find amount from schedules where id appears in items entries with matching level.
SQL: | SELECT amount FROM schedules AS schd
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02120 | train |
v2 | Schema:
managers (alias: mgr)(code, value, level, salary)
requests(id, amount, code, type)
Task: Find code from managers where a matching record exists in requests with the same code.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02121 | train |
v1 | Schema:
transactions (alias: txn)(level, type, amount, status)
items(status, level, amount, date)
Task: Select name from transactions where id exists in items for the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02122 | train |
v1 | Schema:
orders (alias: ord)(name, type, date, status)
managers(salary, value, code, level)
Task: Find code from orders where type appears in managers entries with matching level.
SQL: | SELECT code FROM orders AS ord
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02123 | train |
v1 | Schema:
categories (alias: catg)(value, name, id, code)
regions(id, status, name, value)
Task: Retrieve name from categories whose id is found in regions rows where id matches the outer record.
SQL: | SELECT name FROM categories AS catg
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02124 | train |
v1 | Schema:
departments (alias: dept)(date, value, code, status)
items(code, amount, name, value)
Task: Select code from departments where type exists in items for the same level.
SQL: | SELECT code FROM departments AS dept
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02125 | train |
v3 | Schema:
regions (alias: rgn)(salary, code, level, id)
requests(date, name, id, salary)
Task: Find code from regions where salary exceeds the count of amount from requests for the same id.
SQL: | SELECT code FROM regions AS rgn
WHERE salary > (
SELECT COUNT(amount) FROM requests AS ordr
WHERE ordr.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02126 | train |
v2 | Schema:
tasks (alias: tsk)(id, date, name, amount)
managers(level, type, salary, date)
Task: Find amount from tasks where a matching record exists in managers with the same status.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02127 | train |
v2 | Schema:
sales (alias: sale)(name, status, date, id)
orders(salary, code, level, name)
Task: Find value from sales where a matching record exists in orders with the same type.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02128 | train |
v1 | Schema:
categories (alias: catg)(level, date, code, type)
departments(status, name, amount, type)
Task: Select amount from categories where level exists in departments for the same level.
SQL: | SELECT amount FROM categories AS catg
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02129 | train |
v2 | Schema:
invoices (alias: inv)(amount, status, name, level)
items(value, type, status, code)
Task: Find amount from invoices where a matching record exists in items with the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02130 | train |
v3 | Schema:
categories (alias: catg)(id, name, amount, level)
schedules(type, level, salary, status)
Task: Retrieve salary from categories with salary above the COUNT(salary) of schedules rows sharing the same id.
SQL: | SELECT salary FROM categories AS catg
WHERE salary > (
SELECT COUNT(salary) FROM schedules AS schd
WHERE schd.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02131 | train |
v1 | Schema:
invoices (alias: inv)(value, date, name, id)
branches(status, level, amount, type)
Task: Retrieve value from invoices whose id is found in branches rows where type matches the outer record.
SQL: | SELECT value FROM invoices AS inv
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02132 | train |
v3 | Schema:
transactions (alias: txn)(name, level, code, salary)
invoices(date, level, salary, name)
Task: Retrieve value from transactions with amount above the SUM(salary) of invoices rows sharing the same status.
SQL: | SELECT value FROM transactions AS txn
WHERE amount > (
SELECT SUM(salary) FROM invoices AS inv
WHERE inv.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02133 | train |
v1 | Schema:
schedules (alias: schd)(level, id, name, amount)
categories(id, status, type, code)
Task: Retrieve salary from schedules whose status is found in categories rows where id matches the outer record.
SQL: | SELECT salary FROM schedules AS schd
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02134 | train |
v2 | Schema:
projects (alias: prj)(type, date, value, id)
products(value, amount, status, type)
Task: Find id from projects where a matching record exists in products with the same code.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02135 | train |
v2 | Schema:
customers (alias: cust)(value, code, amount, level)
schedules(date, level, name, id)
Task: Retrieve value from customers that have at least one corresponding entry in schedules sharing the same level.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02136 | train |
v1 | Schema:
regions (alias: rgn)(amount, status, code, value)
accounts(salary, type, id, value)
Task: Retrieve value from regions whose status is found in accounts rows where level matches the outer record.
SQL: | SELECT value FROM regions AS rgn
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02137 | train |
v1 | Schema:
managers (alias: mgr)(type, level, value, status)
orders(status, date, salary, value)
Task: Find id from managers where id appears in orders entries with matching status.
SQL: | SELECT id FROM managers AS mgr
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02138 | train |
v2 | Schema:
accounts (alias: acct)(type, id, name, value)
tasks(type, amount, status, code)
Task: Find name from accounts where a matching record exists in tasks with the same id.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02139 | train |
v1 | Schema:
transactions (alias: txn)(code, name, date, level)
employees(status, level, code, value)
Task: Find name from transactions where code appears in employees entries with matching status.
SQL: | SELECT name FROM transactions AS txn
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02140 | train |
v1 | Schema:
branches (alias: brc)(status, date, value, id)
regions(status, amount, code, type)
Task: Retrieve amount from branches whose level is found in regions rows where status matches the outer record.
SQL: | SELECT amount FROM branches AS brc
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02141 | train |
v2 | Schema:
projects (alias: prj)(name, status, value, amount)
sales(status, code, salary, date)
Task: Retrieve name from projects that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02142 | train |
v2 | Schema:
orders (alias: ord)(salary, amount, level, type)
items(salary, type, amount, id)
Task: Retrieve name from orders that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02143 | train |
v3 | Schema:
items (alias: lne)(level, code, name, value)
staff(value, name, amount, level)
Task: Retrieve value from items with amount above the MAX(value) of staff rows sharing the same type.
SQL: | SELECT value FROM items AS lne
WHERE amount > (
SELECT MAX(value) FROM staff AS empl
WHERE empl.type = lne.type
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02144 | train |
v2 | Schema:
projects (alias: prj)(status, value, amount, type)
branches(level, salary, value, type)
Task: Find name from projects where a matching record exists in branches with the same id.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02145 | train |
v3 | Schema:
requests (alias: ordr)(date, amount, level, salary)
customers(salary, value, id, amount)
Task: Find name from requests where salary exceeds the minimum amount from customers for the same type.
SQL: | SELECT name FROM requests AS ordr
WHERE salary > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02146 | train |
v1 | Schema:
branches (alias: brc)(status, id, type, code)
employees(level, amount, value, status)
Task: Retrieve salary from branches whose id is found in employees rows where level matches the outer record.
SQL: | SELECT salary FROM branches AS brc
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02147 | train |
v2 | Schema:
categories (alias: catg)(name, type, code, salary)
departments(status, code, type, value)
Task: Find salary from categories where a matching record exists in departments with the same id.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02148 | train |
v2 | Schema:
employees (alias: emp)(date, id, amount, salary)
staff(date, type, name, code)
Task: Retrieve code from employees that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02149 | train |
v3 | Schema:
accounts (alias: acct)(salary, date, value, id)
schedules(name, id, type, salary)
Task: Retrieve name from accounts with salary above the COUNT(salary) of schedules rows sharing the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE salary > (
SELECT COUNT(salary) FROM schedules AS schd
WHERE schd.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02150 | train |
v1 | Schema:
requests (alias: ordr)(code, salary, amount, level)
branches(amount, salary, value, level)
Task: Select amount from requests where status exists in branches for the same status.
SQL: | SELECT amount FROM requests AS ordr
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02151 | train |
v3 | Schema:
accounts (alias: acct)(date, status, amount, level)
tasks(level, id, status, date)
Task: Retrieve amount from accounts with salary above the COUNT(value) of tasks rows sharing the same status.
SQL: | SELECT amount FROM accounts AS acct
WHERE salary > (
SELECT COUNT(value) FROM tasks AS tsk
WHERE tsk.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02152 | train |
v3 | Schema:
categories (alias: catg)(date, code, salary, value)
regions(status, level, code, type)
Task: Retrieve id from categories with salary above the SUM(value) of regions rows sharing the same status.
SQL: | SELECT id FROM categories AS catg
WHERE salary > (
SELECT SUM(value) FROM regions AS rgn
WHERE rgn.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02153 | train |
v2 | Schema:
transactions (alias: txn)(date, name, level, status)
departments(id, salary, date, status)
Task: Retrieve name from transactions that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02154 | train |
v3 | Schema:
orders (alias: ord)(type, amount, date, name)
transactions(id, status, name, code)
Task: Retrieve code from orders with salary above the MAX(salary) of transactions rows sharing the same id.
SQL: | SELECT code FROM orders AS ord
WHERE salary > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02155 | train |
v1 | Schema:
transactions (alias: txn)(salary, status, name, level)
tasks(status, date, code, level)
Task: Retrieve amount from transactions whose level is found in tasks rows where level matches the outer record.
SQL: | SELECT amount FROM transactions AS txn
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02156 | train |
v1 | Schema:
transactions (alias: txn)(date, name, level, code)
employees(date, type, value, amount)
Task: Retrieve code from transactions whose type is found in employees rows where level matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02157 | train |
v3 | Schema:
managers (alias: mgr)(name, type, value, salary)
branches(amount, status, level, date)
Task: Retrieve id from managers with amount above the MAX(value) of branches rows sharing the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE amount > (
SELECT MAX(value) FROM branches AS brc
WHERE brc.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02158 | train |
v2 | Schema:
regions (alias: rgn)(id, value, code, amount)
transactions(value, date, status, salary)
Task: Retrieve name from regions that have at least one corresponding entry in transactions sharing the same code.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02159 | train |
v2 | Schema:
requests (alias: ordr)(salary, date, name, id)
branches(name, salary, value, level)
Task: Find id from requests where a matching record exists in branches with the same level.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02160 | train |
v1 | Schema:
products (alias: prod)(code, value, name, type)
managers(type, status, name, amount)
Task: Select value from products where id exists in managers for the same level.
SQL: | SELECT value FROM products AS prod
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02161 | train |
v1 | Schema:
customers (alias: cust)(amount, name, status, type)
schedules(name, type, id, code)
Task: Find value from customers where code appears in schedules entries with matching type.
SQL: | SELECT value FROM customers AS cust
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02162 | train |
v2 | Schema:
employees (alias: emp)(amount, status, value, name)
shipments(level, type, name, salary)
Task: Find id from employees where a matching record exists in shipments with the same code.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02163 | train |
v2 | Schema:
schedules (alias: schd)(date, type, value, level)
accounts(level, id, date, name)
Task: Retrieve code from schedules that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02164 | train |
v3 | Schema:
shipments (alias: shp)(salary, level, id, code)
requests(salary, status, id, value)
Task: Retrieve code from shipments with value above the MIN(salary) of requests rows sharing the same type.
SQL: | SELECT code FROM shipments AS shp
WHERE value > (
SELECT MIN(salary) FROM requests AS ordr
WHERE ordr.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02165 | train |
v1 | Schema:
sales (alias: sale)(id, salary, name, value)
tasks(level, status, id, code)
Task: Select id from sales where level exists in tasks for the same status.
SQL: | SELECT id FROM sales AS sale
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02166 | train |
v2 | Schema:
employees (alias: emp)(type, level, name, code)
staff(amount, date, name, value)
Task: Retrieve name from employees that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02167 | train |
v2 | Schema:
schedules (alias: schd)(type, salary, status, date)
accounts(amount, name, code, status)
Task: Find salary from schedules where a matching record exists in accounts with the same code.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02168 | train |
v2 | Schema:
requests (alias: ordr)(salary, value, level, type)
managers(salary, value, id, status)
Task: Retrieve value from requests that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02169 | train |
v2 | Schema:
items (alias: lne)(name, type, value, salary)
invoices(id, date, type, status)
Task: Find value from items where a matching record exists in invoices with the same level.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = lne.level
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02170 | train |
v3 | Schema:
requests (alias: ordr)(id, code, type, status)
orders(level, id, value, salary)
Task: Find code from requests where amount exceeds the count of salary from orders for the same level.
SQL: | SELECT code FROM requests AS ordr
WHERE amount > (
SELECT COUNT(salary) FROM orders AS ord
WHERE ord.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02171 | train |
v3 | Schema:
shipments (alias: shp)(salary, level, name, date)
staff(code, status, name, type)
Task: Retrieve value from shipments with value above the MIN(value) of staff rows sharing the same status.
SQL: | SELECT value FROM shipments AS shp
WHERE value > (
SELECT MIN(value) FROM staff AS empl
WHERE empl.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02172 | train |
v1 | Schema:
invoices (alias: inv)(date, amount, type, salary)
requests(status, type, salary, id)
Task: Retrieve code from invoices whose id is found in requests rows where type matches the outer record.
SQL: | SELECT code FROM invoices AS inv
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02173 | train |
v1 | Schema:
managers (alias: mgr)(amount, id, status, type)
categories(salary, id, level, date)
Task: Select code from managers where type exists in categories for the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02174 | train |
v3 | Schema:
shipments (alias: shp)(salary, name, value, status)
items(id, date, status, level)
Task: Find id from shipments where salary exceeds the minimum value from items for the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE salary > (
SELECT MIN(value) FROM items AS lne
WHERE lne.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02175 | train |
v2 | Schema:
staff (alias: empl)(id, name, value, type)
products(value, id, type, level)
Task: Retrieve amount from staff that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02176 | train |
v1 | Schema:
shipments (alias: shp)(value, salary, name, code)
requests(name, status, code, id)
Task: Select value from shipments where id exists in requests for the same status.
SQL: | SELECT value FROM shipments AS shp
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02177 | train |
v3 | Schema:
branches (alias: brc)(salary, date, id, type)
requests(status, id, value, amount)
Task: Retrieve id from branches with amount above the AVG(amount) of requests rows sharing the same id.
SQL: | SELECT id FROM branches AS brc
WHERE amount > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02178 | train |
v1 | Schema:
orders (alias: ord)(code, name, salary, amount)
products(level, value, type, code)
Task: Find amount from orders where status appears in products entries with matching status.
SQL: | SELECT amount FROM orders AS ord
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02179 | train |
v2 | Schema:
staff (alias: empl)(status, level, amount, name)
departments(date, id, type, salary)
Task: Retrieve code from staff that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02180 | train |
v2 | Schema:
tasks (alias: tsk)(status, id, level, value)
departments(status, name, date, amount)
Task: Find id from tasks where a matching record exists in departments with the same level.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "tsk",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02181 | train |
v2 | Schema:
accounts (alias: acct)(level, code, amount, type)
transactions(salary, code, level, id)
Task: Find code from accounts where a matching record exists in transactions with the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02182 | train |
v3 | Schema:
categories (alias: catg)(id, value, name, status)
accounts(name, level, amount, date)
Task: Retrieve amount from categories with amount above the COUNT(salary) of accounts rows sharing the same id.
SQL: | SELECT amount FROM categories AS catg
WHERE amount > (
SELECT COUNT(salary) FROM accounts AS acct
WHERE acct.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02183 | train |
v2 | Schema:
products (alias: prod)(value, code, type, date)
staff(type, name, code, status)
Task: Retrieve name from products that have at least one corresponding entry in staff sharing the same type.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = prod.type
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02184 | train |
v1 | Schema:
branches (alias: brc)(code, name, type, level)
accounts(salary, value, amount, status)
Task: Retrieve code from branches whose id is found in accounts rows where status matches the outer record.
SQL: | SELECT code FROM branches AS brc
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "accounts",
"outer_alias": "brc",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02185 | train |
v1 | Schema:
employees (alias: emp)(code, name, salary, amount)
categories(type, code, status, level)
Task: Retrieve salary from employees whose id is found in categories rows where id matches the outer record.
SQL: | SELECT salary FROM employees AS emp
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02186 | train |
v3 | Schema:
invoices (alias: inv)(status, name, type, amount)
managers(date, salary, status, id)
Task: Find salary from invoices where value exceeds the minimum value from managers for the same type.
SQL: | SELECT salary FROM invoices AS inv
WHERE value > (
SELECT MIN(value) FROM managers AS mgr
WHERE mgr.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02187 | train |
v3 | Schema:
accounts (alias: acct)(type, level, status, name)
requests(level, amount, salary, date)
Task: Find code from accounts where salary exceeds the maximum salary from requests for the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE salary > (
SELECT MAX(salary) FROM requests AS ordr
WHERE ordr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02188 | train |
v1 | Schema:
accounts (alias: acct)(value, code, status, amount)
tasks(amount, code, date, name)
Task: Retrieve amount from accounts whose level is found in tasks rows where code matches the outer record.
SQL: | SELECT amount FROM accounts AS acct
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02189 | train |
v3 | Schema:
requests (alias: ordr)(level, salary, date, status)
accounts(level, salary, date, amount)
Task: Retrieve name from requests with value above the AVG(amount) of accounts rows sharing the same type.
SQL: | SELECT name FROM requests AS ordr
WHERE value > (
SELECT AVG(amount) FROM accounts AS acct
WHERE acct.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02190 | train |
v3 | Schema:
employees (alias: emp)(level, salary, code, amount)
transactions(level, date, name, type)
Task: Find amount from employees where amount exceeds the total value from transactions for the same type.
SQL: | SELECT amount FROM employees AS emp
WHERE amount > (
SELECT SUM(value) FROM transactions AS txn
WHERE txn.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02191 | train |
v3 | Schema:
schedules (alias: schd)(name, amount, value, level)
customers(id, name, status, value)
Task: Find id from schedules where salary exceeds the count of amount from customers for the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE salary > (
SELECT COUNT(amount) FROM customers AS cust
WHERE cust.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02192 | train |
v1 | Schema:
staff (alias: empl)(value, salary, amount, name)
tasks(id, level, date, type)
Task: Retrieve code from staff whose status is found in tasks rows where type matches the outer record.
SQL: | SELECT code FROM staff AS empl
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02193 | train |
v1 | Schema:
categories (alias: catg)(amount, code, status, level)
regions(id, code, type, status)
Task: Find name from categories where level appears in regions entries with matching code.
SQL: | SELECT name FROM categories AS catg
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02194 | train |
v2 | Schema:
customers (alias: cust)(salary, code, status, amount)
sales(name, type, code, date)
Task: Find id from customers where a matching record exists in sales with the same level.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02195 | train |
v2 | Schema:
shipments (alias: shp)(id, date, code, amount)
managers(status, code, date, value)
Task: Find amount from shipments where a matching record exists in managers with the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02196 | train |
v3 | Schema:
staff (alias: empl)(name, type, level, value)
schedules(date, status, type, name)
Task: Find name from staff where value exceeds the maximum salary from schedules for the same level.
SQL: | SELECT name FROM staff AS empl
WHERE value > (
SELECT MAX(salary) FROM schedules AS schd
WHERE schd.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02197 | train |
v3 | Schema:
orders (alias: ord)(status, amount, level, value)
staff(type, id, salary, level)
Task: Find name from orders where salary exceeds the count of salary from staff for the same id.
SQL: | SELECT name FROM orders AS ord
WHERE salary > (
SELECT COUNT(salary) FROM staff AS empl
WHERE empl.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02198 | train |
v3 | Schema:
branches (alias: brc)(level, type, status, amount)
customers(name, level, code, salary)
Task: Find salary from branches where amount exceeds the total value from customers for the same status.
SQL: | SELECT salary FROM branches AS brc
WHERE amount > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02199 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.