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 |
|---|---|---|---|---|---|---|
v1 | Schema:
products (alias: prod)(status, value, id, salary)
staff(salary, value, name, amount)
Task: Find id from products where type appears in staff entries with matching type.
SQL: | SELECT id FROM products AS prod
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.type = prod.type
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02400 | train |
v1 | Schema:
regions (alias: rgn)(id, value, status, salary)
managers(type, code, salary, date)
Task: Select amount from regions where level exists in managers for the same type.
SQL: | SELECT amount FROM regions AS rgn
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02401 | train |
v2 | Schema:
employees (alias: emp)(code, status, id, type)
shipments(value, code, salary, amount)
Task: Retrieve name from employees that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02402 | train |
v1 | Schema:
managers (alias: mgr)(date, name, salary, type)
sales(level, amount, code, value)
Task: Retrieve value from managers whose level is found in sales rows where code matches the outer record.
SQL: | SELECT value FROM managers AS mgr
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02403 | train |
v2 | Schema:
schedules (alias: schd)(date, amount, name, salary)
products(date, id, amount, type)
Task: Retrieve amount from schedules that have at least one corresponding entry in products sharing the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02404 | train |
v1 | Schema:
staff (alias: empl)(code, value, id, status)
accounts(id, name, code, amount)
Task: Select amount from staff where id exists in accounts for the same status.
SQL: | SELECT amount FROM staff AS empl
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02405 | train |
v2 | Schema:
invoices (alias: inv)(id, date, code, type)
sales(name, date, id, level)
Task: Retrieve amount from invoices that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02406 | train |
v3 | Schema:
tasks (alias: tsk)(code, date, name, id)
categories(value, name, amount, code)
Task: Find value from tasks where amount exceeds the minimum salary from categories for the same code.
SQL: | SELECT value FROM tasks AS tsk
WHERE amount > (
SELECT MIN(salary) FROM categories AS catg
WHERE catg.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02407 | train |
v2 | Schema:
requests (alias: ordr)(type, value, code, status)
projects(status, type, id, amount)
Task: Find code from requests where a matching record exists in projects with the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02408 | train |
v1 | Schema:
items (alias: lne)(salary, status, id, code)
transactions(code, status, level, type)
Task: Find code from items where status appears in transactions entries with matching level.
SQL: | SELECT code FROM items AS lne
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02409 | train |
v2 | Schema:
managers (alias: mgr)(type, amount, salary, name)
categories(level, salary, value, amount)
Task: Find name from managers where a matching record exists in categories with the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02410 | train |
v3 | Schema:
transactions (alias: txn)(status, id, level, salary)
orders(id, name, level, salary)
Task: Find value from transactions where value exceeds the count of amount from orders for the same status.
SQL: | SELECT value FROM transactions AS txn
WHERE value > (
SELECT COUNT(amount) FROM orders AS ord
WHERE ord.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02411 | train |
v1 | Schema:
orders (alias: ord)(value, status, salary, amount)
branches(date, salary, code, type)
Task: Select value from orders where level exists in branches for the same id.
SQL: | SELECT value FROM orders AS ord
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02412 | train |
v3 | Schema:
shipments (alias: shp)(code, type, level, status)
customers(name, code, amount, value)
Task: Retrieve value from shipments with salary above the SUM(salary) of customers rows sharing the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE salary > (
SELECT SUM(salary) FROM customers AS cust
WHERE cust.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02413 | train |
v2 | Schema:
requests (alias: ordr)(value, salary, name, status)
schedules(amount, level, code, value)
Task: Find amount from requests where a matching record exists in schedules with 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_02414 | train |
v1 | Schema:
categories (alias: catg)(status, code, salary, name)
schedules(code, status, amount, level)
Task: Find value from categories where type appears in schedules entries with matching status.
SQL: | SELECT value FROM categories AS catg
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02415 | train |
v1 | Schema:
products (alias: prod)(date, type, name, value)
projects(value, level, status, id)
Task: Select id from products where code exists in projects for the same code.
SQL: | SELECT id FROM products AS prod
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.code = prod.code
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "prod",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02416 | train |
v2 | Schema:
schedules (alias: schd)(type, code, name, value)
departments(salary, id, level, type)
Task: Find name from schedules where a matching record exists in departments with the same status.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02417 | train |
v2 | Schema:
requests (alias: ordr)(level, name, value, type)
schedules(date, type, amount, level)
Task: Retrieve salary from requests that have at least one corresponding entry in schedules sharing the same level.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02418 | train |
v1 | Schema:
branches (alias: brc)(name, level, date, salary)
requests(salary, date, id, amount)
Task: Find name from branches where level appears in requests entries with matching status.
SQL: | SELECT name FROM branches AS brc
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02419 | train |
v3 | Schema:
schedules (alias: schd)(salary, status, date, level)
tasks(salary, level, amount, code)
Task: Find name from schedules where amount exceeds the maximum amount from tasks for the same code.
SQL: | SELECT name FROM schedules AS schd
WHERE amount > (
SELECT MAX(amount) FROM tasks AS tsk
WHERE tsk.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02420 | train |
v2 | Schema:
requests (alias: ordr)(level, name, code, amount)
departments(salary, name, status, value)
Task: Find name from requests where a matching record exists in departments with the same type.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02421 | train |
v1 | Schema:
sales (alias: sale)(type, status, amount, date)
schedules(value, amount, type, id)
Task: Retrieve value from sales whose id is found in schedules rows where level matches the outer record.
SQL: | SELECT value FROM sales AS sale
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02422 | train |
v2 | Schema:
projects (alias: prj)(value, type, name, amount)
requests(level, id, salary, status)
Task: Find amount from projects where a matching record exists in requests with the same id.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02423 | train |
v1 | Schema:
employees (alias: emp)(name, code, amount, date)
items(amount, level, date, id)
Task: Find code from employees where type appears in items entries with matching code.
SQL: | SELECT code FROM employees AS emp
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02424 | train |
v2 | Schema:
staff (alias: empl)(status, id, salary, level)
employees(status, name, id, date)
Task: Retrieve value from staff that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02425 | train |
v3 | Schema:
accounts (alias: acct)(date, value, amount, id)
shipments(type, level, value, name)
Task: Retrieve value from accounts with amount above the MAX(value) of shipments rows sharing the same level.
SQL: | SELECT value FROM accounts AS acct
WHERE amount > (
SELECT MAX(value) FROM shipments AS shp
WHERE shp.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02426 | train |
v1 | Schema:
shipments (alias: shp)(name, date, salary, amount)
tasks(name, status, level, date)
Task: Retrieve id from shipments whose type is found in tasks rows where status matches the outer record.
SQL: | SELECT id FROM shipments AS shp
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02427 | train |
v3 | Schema:
accounts (alias: acct)(type, date, level, value)
orders(status, id, salary, amount)
Task: Retrieve name from accounts with salary above the MAX(salary) of orders rows sharing the same level.
SQL: | SELECT name FROM accounts AS acct
WHERE salary > (
SELECT MAX(salary) FROM orders AS ord
WHERE ord.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "name",
"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_02428 | train |
v2 | Schema:
categories (alias: catg)(name, salary, date, amount)
customers(level, salary, type, name)
Task: Retrieve id from categories that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT id 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": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02429 | train |
v1 | Schema:
orders (alias: ord)(value, name, date, code)
invoices(name, status, code, id)
Task: Select amount from orders where level exists in invoices for the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02430 | train |
v3 | Schema:
projects (alias: prj)(name, value, date, level)
accounts(type, salary, code, name)
Task: Find name from projects where value exceeds the count of salary from accounts for the same status.
SQL: | SELECT name FROM projects AS prj
WHERE value > (
SELECT COUNT(salary) FROM accounts AS acct
WHERE acct.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02431 | train |
v1 | Schema:
transactions (alias: txn)(id, amount, salary, value)
departments(name, value, date, code)
Task: Select amount from transactions where level exists in departments for the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02432 | train |
v2 | Schema:
schedules (alias: schd)(salary, code, level, id)
departments(type, date, level, status)
Task: Retrieve value from schedules that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02433 | train |
v1 | Schema:
requests (alias: ordr)(salary, level, value, amount)
customers(status, code, amount, type)
Task: Select salary from requests where code exists in customers for the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02434 | train |
v2 | Schema:
transactions (alias: txn)(id, salary, status, value)
categories(value, type, id, status)
Task: Retrieve salary from transactions that have at least one corresponding entry in categories sharing the same level.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02435 | train |
v3 | Schema:
invoices (alias: inv)(date, amount, level, salary)
staff(code, value, date, status)
Task: Retrieve amount from invoices with amount above the MIN(amount) of staff rows sharing the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE amount > (
SELECT MIN(amount) FROM staff AS empl
WHERE empl.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02436 | train |
v3 | Schema:
products (alias: prod)(level, amount, value, id)
customers(type, value, date, status)
Task: Retrieve name from products with amount above the MAX(amount) of customers rows sharing the same id.
SQL: | SELECT name FROM products AS prod
WHERE amount > (
SELECT MAX(amount) FROM customers AS cust
WHERE cust.id = prod.id
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02437 | train |
v2 | Schema:
accounts (alias: acct)(name, salary, value, status)
orders(type, value, id, status)
Task: Retrieve value from accounts that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02438 | train |
v1 | Schema:
branches (alias: brc)(amount, value, level, id)
transactions(date, salary, name, level)
Task: Select name from branches where level exists in transactions for the same id.
SQL: | SELECT name FROM branches AS brc
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "transactions",
"outer_alias": "brc",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02439 | train |
v3 | Schema:
schedules (alias: schd)(name, status, type, amount)
branches(code, name, status, type)
Task: Find value from schedules where value exceeds the average amount from branches for the same level.
SQL: | SELECT value FROM schedules AS schd
WHERE value > (
SELECT AVG(amount) FROM branches AS brc
WHERE brc.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02440 | train |
v1 | Schema:
customers (alias: cust)(salary, code, name, date)
managers(code, type, id, value)
Task: Retrieve id from customers whose type is found in managers rows where id matches the outer record.
SQL: | SELECT id FROM customers AS cust
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02441 | train |
v3 | Schema:
orders (alias: ord)(name, level, value, type)
departments(id, level, type, salary)
Task: Find value from orders where value exceeds the count of salary from departments for the same type.
SQL: | SELECT value FROM orders AS ord
WHERE value > (
SELECT COUNT(salary) FROM departments AS dept
WHERE dept.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02442 | train |
v2 | Schema:
schedules (alias: schd)(status, value, id, date)
departments(level, status, amount, id)
Task: Find salary from schedules where a matching record exists in departments with the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02443 | train |
v1 | Schema:
branches (alias: brc)(amount, status, code, date)
transactions(name, value, salary, date)
Task: Retrieve code from branches whose id is found in transactions rows where code matches the outer record.
SQL: | SELECT code FROM branches AS brc
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "transactions",
"outer_alias": "brc",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02444 | train |
v1 | Schema:
orders (alias: ord)(date, amount, salary, id)
employees(value, name, type, code)
Task: Select id from orders where level exists in employees for the same status.
SQL: | SELECT id FROM orders AS ord
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02445 | train |
v3 | Schema:
accounts (alias: acct)(value, name, code, id)
projects(salary, code, status, value)
Task: Retrieve code from accounts with value above the AVG(amount) of projects rows sharing the same id.
SQL: | SELECT code FROM accounts AS acct
WHERE value > (
SELECT AVG(amount) FROM projects AS prj
WHERE prj.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02446 | train |
v2 | Schema:
items (alias: lne)(code, salary, status, date)
invoices(id, status, salary, code)
Task: Find code from items where a matching record exists in invoices with the same code.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = lne.code
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02447 | train |
v3 | Schema:
tasks (alias: tsk)(status, level, id, value)
accounts(type, status, code, amount)
Task: Find name from tasks where amount exceeds the total value from accounts for the same id.
SQL: | SELECT name FROM tasks AS tsk
WHERE amount > (
SELECT SUM(value) FROM accounts AS acct
WHERE acct.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02448 | train |
v2 | Schema:
customers (alias: cust)(salary, code, amount, name)
requests(code, name, amount, value)
Task: Find name from customers where a matching record exists in requests with the same level.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02449 | train |
v3 | Schema:
projects (alias: prj)(status, name, id, value)
branches(value, name, id, status)
Task: Retrieve value from projects with salary above the MIN(value) of branches rows sharing the same level.
SQL: | SELECT value FROM projects AS prj
WHERE salary > (
SELECT MIN(value) FROM branches AS brc
WHERE brc.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02450 | train |
v3 | Schema:
sales (alias: sale)(amount, status, id, value)
categories(level, type, amount, code)
Task: Retrieve code from sales with salary above the SUM(value) of categories rows sharing the same type.
SQL: | SELECT code FROM sales AS sale
WHERE salary > (
SELECT SUM(value) FROM categories AS catg
WHERE catg.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02451 | train |
v3 | Schema:
accounts (alias: acct)(amount, name, value, date)
requests(id, salary, date, amount)
Task: Retrieve amount from accounts with value above the COUNT(amount) of requests rows sharing the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE value > (
SELECT COUNT(amount) FROM requests AS ordr
WHERE ordr.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02452 | train |
v3 | Schema:
managers (alias: mgr)(level, value, salary, id)
branches(value, salary, amount, name)
Task: Retrieve salary from managers with amount above the MAX(value) of branches rows sharing the same code.
SQL: | SELECT salary 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": "salary",
"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_02453 | train |
v3 | Schema:
regions (alias: rgn)(level, salary, code, amount)
employees(id, amount, code, level)
Task: Find code from regions where salary exceeds the maximum amount from employees for the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE salary > (
SELECT MAX(amount) FROM employees AS emp
WHERE emp.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02454 | train |
v3 | Schema:
staff (alias: empl)(status, code, amount, date)
projects(type, id, salary, value)
Task: Find code from staff where amount exceeds the average salary from projects for the same type.
SQL: | SELECT code FROM staff AS empl
WHERE amount > (
SELECT AVG(salary) FROM projects AS prj
WHERE prj.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02455 | train |
v1 | Schema:
schedules (alias: schd)(value, salary, level, amount)
departments(amount, status, code, date)
Task: Retrieve salary from schedules whose status is found in departments rows where id matches the outer record.
SQL: | SELECT salary FROM schedules AS schd
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02456 | train |
v2 | Schema:
shipments (alias: shp)(level, type, value, amount)
categories(salary, id, status, name)
Task: Find id from shipments where a matching record exists in categories with the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02457 | train |
v3 | Schema:
branches (alias: brc)(code, type, id, value)
categories(status, name, amount, salary)
Task: Retrieve name from branches with amount above the MIN(salary) of categories rows sharing the same code.
SQL: | SELECT name FROM branches AS brc
WHERE amount > (
SELECT MIN(salary) FROM categories AS catg
WHERE catg.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02458 | train |
v3 | Schema:
tasks (alias: tsk)(amount, id, type, value)
managers(salary, level, amount, value)
Task: Retrieve id from tasks with salary above the MIN(salary) of managers rows sharing the same id.
SQL: | SELECT id FROM tasks AS tsk
WHERE salary > (
SELECT MIN(salary) FROM managers AS mgr
WHERE mgr.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02459 | train |
v2 | Schema:
shipments (alias: shp)(name, level, type, value)
categories(value, salary, type, id)
Task: Retrieve id from shipments that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02460 | train |
v3 | Schema:
products (alias: prod)(code, value, salary, date)
departments(value, status, level, date)
Task: Retrieve amount from products with salary above the MIN(value) of departments rows sharing the same status.
SQL: | SELECT amount FROM products AS prod
WHERE salary > (
SELECT MIN(value) FROM departments AS dept
WHERE dept.status = prod.status
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02461 | train |
v3 | Schema:
managers (alias: mgr)(salary, code, value, type)
invoices(status, salary, level, value)
Task: Retrieve id from managers with salary above the COUNT(amount) of invoices rows sharing the same id.
SQL: | SELECT id FROM managers AS mgr
WHERE salary > (
SELECT COUNT(amount) FROM invoices AS inv
WHERE inv.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02462 | train |
v1 | Schema:
regions (alias: rgn)(salary, date, name, id)
items(type, value, id, name)
Task: Retrieve amount from regions whose type is found in items rows where status matches the outer record.
SQL: | SELECT amount FROM regions AS rgn
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02463 | train |
v1 | Schema:
orders (alias: ord)(type, code, level, status)
branches(status, date, code, amount)
Task: Retrieve value from orders whose id is found in branches rows where level matches the outer record.
SQL: | SELECT value FROM orders AS ord
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02464 | train |
v2 | Schema:
regions (alias: rgn)(id, salary, level, status)
invoices(salary, status, code, level)
Task: Find amount from regions where a matching record exists in invoices with the same type.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02465 | train |
v1 | Schema:
products (alias: prod)(code, amount, date, status)
staff(salary, id, code, type)
Task: Retrieve salary from products whose code is found in staff rows where code matches the outer record.
SQL: | SELECT salary FROM products AS prod
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.code = prod.code
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02466 | train |
v1 | Schema:
regions (alias: rgn)(level, amount, salary, name)
branches(date, type, amount, value)
Task: Retrieve code from regions whose code is found in branches rows where code matches the outer record.
SQL: | SELECT code FROM regions AS rgn
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02467 | train |
v3 | Schema:
products (alias: prod)(level, name, type, value)
managers(status, salary, value, date)
Task: Retrieve name from products with salary above the SUM(salary) of managers rows sharing the same type.
SQL: | SELECT name FROM products AS prod
WHERE salary > (
SELECT SUM(salary) FROM managers AS mgr
WHERE mgr.type = prod.type
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02468 | train |
v1 | Schema:
staff (alias: empl)(amount, level, salary, id)
tasks(name, type, id, value)
Task: Retrieve salary from staff whose id is found in tasks rows where level matches the outer record.
SQL: | SELECT salary FROM staff AS empl
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02469 | train |
v1 | Schema:
departments (alias: dept)(name, amount, level, date)
customers(name, date, amount, level)
Task: Find name from departments where id appears in customers entries with matching code.
SQL: | SELECT name FROM departments AS dept
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02470 | train |
v1 | Schema:
requests (alias: ordr)(status, type, level, id)
transactions(amount, date, code, value)
Task: Retrieve salary from requests whose level is found in transactions rows where level matches the outer record.
SQL: | SELECT salary FROM requests AS ordr
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02471 | train |
v3 | Schema:
schedules (alias: schd)(salary, status, name, code)
requests(level, amount, id, date)
Task: Find id from schedules where salary exceeds the maximum value from requests for the same level.
SQL: | SELECT id FROM schedules AS schd
WHERE salary > (
SELECT MAX(value) FROM requests AS ordr
WHERE ordr.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02472 | train |
v3 | Schema:
orders (alias: ord)(code, salary, amount, name)
managers(level, id, status, type)
Task: Retrieve salary from orders with value above the AVG(salary) of managers rows sharing the same code.
SQL: | SELECT salary FROM orders AS ord
WHERE value > (
SELECT AVG(salary) FROM managers AS mgr
WHERE mgr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02473 | train |
v3 | Schema:
accounts (alias: acct)(status, amount, date, id)
branches(status, level, value, salary)
Task: Retrieve salary from accounts with salary above the SUM(value) of branches rows sharing the same code.
SQL: | SELECT salary FROM accounts AS acct
WHERE salary > (
SELECT SUM(value) FROM branches AS brc
WHERE brc.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02474 | train |
v2 | Schema:
invoices (alias: inv)(salary, value, type, amount)
requests(amount, name, status, date)
Task: Find amount from invoices where a matching record exists in requests with the same status.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02475 | train |
v1 | Schema:
tasks (alias: tsk)(value, status, name, amount)
customers(date, level, salary, name)
Task: Find value from tasks where level appears in customers entries with matching code.
SQL: | SELECT value FROM tasks AS tsk
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "tsk",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02476 | train |
v2 | Schema:
invoices (alias: inv)(amount, code, date, level)
projects(type, level, code, name)
Task: Find salary from invoices where a matching record exists in projects with the same level.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02477 | train |
v1 | Schema:
items (alias: lne)(amount, id, type, salary)
tasks(name, status, salary, level)
Task: Select value from items where code exists in tasks for the same id.
SQL: | SELECT value FROM items AS lne
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.id = lne.id
); | {
"outer_table": "items",
"inner_table": "tasks",
"outer_alias": "lne",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02478 | train |
v3 | Schema:
shipments (alias: shp)(id, name, level, date)
items(name, amount, level, date)
Task: Retrieve amount from shipments with salary above the MAX(amount) of items rows sharing the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE salary > (
SELECT MAX(amount) FROM items AS lne
WHERE lne.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02479 | train |
v2 | Schema:
transactions (alias: txn)(status, name, code, type)
tasks(id, salary, value, type)
Task: Find name from transactions where a matching record exists in tasks with the same status.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02480 | train |
v1 | Schema:
schedules (alias: schd)(level, amount, value, date)
products(amount, status, date, id)
Task: Select id from schedules where type exists in products for the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02481 | train |
v2 | Schema:
projects (alias: prj)(name, id, amount, value)
customers(id, amount, value, code)
Task: Find salary from projects where a matching record exists in customers with the same id.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "prj",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02482 | train |
v3 | Schema:
branches (alias: brc)(id, value, date, salary)
regions(salary, status, type, date)
Task: Retrieve code from branches with amount above the MAX(amount) of regions rows sharing the same status.
SQL: | SELECT code FROM branches AS brc
WHERE amount > (
SELECT MAX(amount) FROM regions AS rgn
WHERE rgn.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02483 | train |
v3 | Schema:
employees (alias: emp)(level, status, amount, value)
regions(salary, name, level, status)
Task: Retrieve amount from employees with amount above the AVG(salary) of regions rows sharing the same status.
SQL: | SELECT amount FROM employees AS emp
WHERE amount > (
SELECT AVG(salary) FROM regions AS rgn
WHERE rgn.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02484 | train |
v3 | Schema:
shipments (alias: shp)(id, name, salary, level)
schedules(value, status, salary, date)
Task: Retrieve name from shipments with value above the MIN(value) of schedules rows sharing the same status.
SQL: | SELECT name FROM shipments AS shp
WHERE value > (
SELECT MIN(value) FROM schedules AS schd
WHERE schd.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "name",
"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_02485 | train |
v1 | Schema:
accounts (alias: acct)(type, amount, status, salary)
requests(name, type, id, date)
Task: Select salary from accounts where level exists in requests for the same id.
SQL: | SELECT salary FROM accounts AS acct
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02486 | train |
v1 | Schema:
regions (alias: rgn)(id, date, amount, value)
schedules(level, status, salary, value)
Task: Select id from regions where status exists in schedules for the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02487 | train |
v1 | Schema:
orders (alias: ord)(date, id, status, salary)
transactions(name, status, type, id)
Task: Retrieve code from orders whose level is found in transactions rows where level matches the outer record.
SQL: | SELECT code FROM orders AS ord
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02488 | train |
v1 | Schema:
regions (alias: rgn)(date, name, status, amount)
sales(date, name, id, salary)
Task: Retrieve amount from regions whose id is found in sales rows where id matches the outer record.
SQL: | SELECT amount 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": "amount",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02489 | train |
v2 | Schema:
departments (alias: dept)(type, id, level, salary)
transactions(value, id, type, level)
Task: Find code from departments where a matching record exists in transactions with the same status.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02490 | train |
v2 | Schema:
branches (alias: brc)(code, date, type, salary)
requests(status, id, level, salary)
Task: Retrieve id from branches that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02491 | train |
v1 | Schema:
orders (alias: ord)(level, salary, code, date)
requests(type, level, value, code)
Task: Find name from orders where level appears in requests entries with matching code.
SQL: | SELECT name FROM orders AS ord
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02492 | train |
v1 | Schema:
accounts (alias: acct)(amount, name, type, status)
tasks(value, type, date, name)
Task: Find name from accounts where code appears in tasks entries with matching code.
SQL: | SELECT name FROM accounts AS acct
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02493 | train |
v3 | Schema:
accounts (alias: acct)(date, salary, amount, type)
invoices(status, value, salary, name)
Task: Find id from accounts where amount exceeds the minimum salary from invoices for the same type.
SQL: | SELECT id FROM accounts AS acct
WHERE amount > (
SELECT MIN(salary) FROM invoices AS inv
WHERE inv.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02494 | train |
v2 | Schema:
customers (alias: cust)(name, date, value, amount)
employees(id, status, date, name)
Task: Find name from customers where a matching record exists in employees with the same id.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02495 | train |
v2 | Schema:
accounts (alias: acct)(value, level, date, status)
items(type, id, date, status)
Task: Retrieve code from accounts that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02496 | train |
v1 | Schema:
branches (alias: brc)(id, value, status, salary)
shipments(code, amount, id, type)
Task: Select amount from branches where status exists in shipments for the same type.
SQL: | SELECT amount FROM branches AS brc
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02497 | train |
v3 | Schema:
employees (alias: emp)(amount, id, date, status)
invoices(salary, amount, level, name)
Task: Find salary from employees where salary exceeds the maximum value from invoices for the same type.
SQL: | SELECT salary FROM employees AS emp
WHERE salary > (
SELECT MAX(value) FROM invoices AS inv
WHERE inv.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02498 | train |
v2 | Schema:
managers (alias: mgr)(type, id, level, date)
customers(name, status, id, type)
Task: Retrieve value from managers that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02499 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.