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:
tasks (alias: tsk)(name, status, value, date)
sales(code, date, amount, level)
Task: Find value from tasks where type appears in sales entries with matching status.
SQL: | SELECT value FROM tasks AS tsk
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_04500 | train |
v1 | Schema:
employees (alias: emp)(amount, level, value, type)
regions(code, level, value, status)
Task: Retrieve code from employees whose id is found in regions rows where level matches the outer record.
SQL: | SELECT code FROM employees AS emp
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04501 | train |
v1 | Schema:
schedules (alias: schd)(value, amount, salary, id)
branches(value, status, name, id)
Task: Select value from schedules where code exists in branches for the same level.
SQL: | SELECT value FROM schedules AS schd
WHERE code IN (
SELECT code 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": "code",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_04502 | train |
v3 | Schema:
invoices (alias: inv)(date, level, amount, type)
orders(amount, status, id, name)
Task: Retrieve amount from invoices with value above the MAX(value) of orders rows sharing the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE value > (
SELECT MAX(value) FROM orders AS ord
WHERE ord.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04503 | train |
v3 | Schema:
transactions (alias: txn)(level, date, id, type)
projects(amount, value, salary, name)
Task: Find value from transactions where salary exceeds the count of amount from projects for the same status.
SQL: | SELECT value FROM transactions AS txn
WHERE salary > (
SELECT COUNT(amount) FROM projects AS prj
WHERE prj.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04504 | train |
v2 | Schema:
sales (alias: sale)(name, value, id, amount)
schedules(name, amount, id, status)
Task: Find code from sales where a matching record exists in schedules with the same id.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04505 | train |
v1 | Schema:
tasks (alias: tsk)(salary, status, name, date)
regions(code, salary, type, amount)
Task: Find name from tasks where code appears in regions entries with matching code.
SQL: | SELECT name FROM tasks AS tsk
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_04506 | train |
v1 | Schema:
projects (alias: prj)(id, code, type, level)
items(date, value, id, status)
Task: Select salary from projects where id exists in items for the same status.
SQL: | SELECT salary FROM projects AS prj
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_04507 | train |
v3 | Schema:
staff (alias: empl)(id, type, salary, value)
branches(amount, code, value, id)
Task: Retrieve id from staff with value above the MAX(salary) of branches rows sharing the same level.
SQL: | SELECT id FROM staff AS empl
WHERE value > (
SELECT MAX(salary) FROM branches AS brc
WHERE brc.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "id",
"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_04508 | train |
v1 | Schema:
schedules (alias: schd)(status, date, amount, code)
orders(value, status, date, salary)
Task: Find amount from schedules where code appears in orders entries with matching type.
SQL: | SELECT amount FROM schedules AS schd
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_04509 | train |
v3 | Schema:
transactions (alias: txn)(name, salary, value, id)
sales(code, type, level, amount)
Task: Find name from transactions where value exceeds the total amount from sales for the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE value > (
SELECT SUM(amount) FROM sales AS sale
WHERE sale.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04510 | train |
v3 | Schema:
managers (alias: mgr)(name, date, id, status)
categories(value, salary, type, level)
Task: Find amount from managers where amount exceeds the average value from categories for the same id.
SQL: | SELECT amount FROM managers AS mgr
WHERE amount > (
SELECT AVG(value) FROM categories AS catg
WHERE catg.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04511 | train |
v2 | Schema:
orders (alias: ord)(type, amount, value, name)
requests(name, code, level, date)
Task: Retrieve salary from orders that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04512 | train |
v3 | Schema:
employees (alias: emp)(id, type, amount, date)
products(code, status, level, amount)
Task: Retrieve name from employees with salary above the SUM(amount) of products rows sharing the same level.
SQL: | SELECT name FROM employees AS emp
WHERE salary > (
SELECT SUM(amount) FROM products AS prod
WHERE prod.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04513 | train |
v1 | Schema:
shipments (alias: shp)(code, status, value, salary)
categories(amount, date, value, id)
Task: Select salary from shipments where type exists in categories for the same id.
SQL: | SELECT salary FROM shipments AS shp
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_04514 | train |
v2 | Schema:
staff (alias: empl)(salary, status, date, code)
schedules(amount, code, id, status)
Task: Retrieve value from staff that have at least one corresponding entry in schedules sharing the same id.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_04515 | train |
v2 | Schema:
tasks (alias: tsk)(name, status, date, salary)
shipments(amount, salary, name, date)
Task: Retrieve id from tasks that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_04516 | train |
v2 | Schema:
categories (alias: catg)(code, name, salary, amount)
invoices(type, name, id, date)
Task: Retrieve id from categories that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_04517 | train |
v2 | Schema:
items (alias: lne)(date, salary, level, type)
schedules(type, name, amount, date)
Task: Retrieve amount from items that have at least one corresponding entry in schedules sharing the same id.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = lne.id
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_04518 | train |
v1 | Schema:
regions (alias: rgn)(type, status, code, level)
staff(level, id, code, status)
Task: Select code from regions where type exists in staff for the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_04519 | train |
v1 | Schema:
invoices (alias: inv)(amount, type, name, code)
accounts(code, id, type, date)
Task: Find value from invoices where type appears in accounts entries with matching status.
SQL: | SELECT value FROM invoices AS inv
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04520 | train |
v2 | Schema:
accounts (alias: acct)(status, date, amount, level)
requests(salary, id, date, name)
Task: Find id from accounts where a matching record exists in requests with the same type.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04521 | train |
v1 | Schema:
projects (alias: prj)(level, status, amount, salary)
branches(value, name, level, salary)
Task: Select code from projects where level exists in branches for the same status.
SQL: | SELECT code FROM projects AS prj
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_04522 | train |
v3 | Schema:
transactions (alias: txn)(amount, code, name, salary)
regions(type, amount, salary, value)
Task: Retrieve code from transactions with value above the AVG(salary) of regions rows sharing the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE value > (
SELECT AVG(salary) FROM regions AS rgn
WHERE rgn.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04523 | train |
v1 | Schema:
accounts (alias: acct)(amount, type, status, name)
sales(date, value, name, level)
Task: Select amount from accounts where id exists in sales for the same status.
SQL: | SELECT amount FROM accounts AS acct
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04524 | train |
v2 | Schema:
categories (alias: catg)(value, level, amount, date)
orders(amount, salary, id, value)
Task: Retrieve salary from categories that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_04525 | train |
v1 | Schema:
categories (alias: catg)(value, name, id, status)
accounts(name, salary, level, value)
Task: Select code from categories where code exists in accounts for the same id.
SQL: | SELECT code FROM categories AS catg
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_04526 | train |
v1 | Schema:
customers (alias: cust)(salary, code, status, id)
employees(status, code, type, level)
Task: Find code from customers where type appears in employees entries with matching code.
SQL: | SELECT code FROM customers AS cust
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04527 | train |
v1 | Schema:
categories (alias: catg)(status, code, id, type)
accounts(level, date, status, salary)
Task: Find salary from categories where type appears in accounts entries with matching id.
SQL: | SELECT salary FROM categories AS catg
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_04528 | train |
v3 | Schema:
transactions (alias: txn)(date, salary, type, level)
invoices(status, value, code, amount)
Task: Find value from transactions where salary exceeds the count of salary from invoices for the same level.
SQL: | SELECT value FROM transactions AS txn
WHERE salary > (
SELECT COUNT(salary) FROM invoices AS inv
WHERE inv.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04529 | train |
v1 | Schema:
products (alias: prod)(name, type, salary, code)
staff(id, value, salary, amount)
Task: Retrieve id from products whose level is found in staff rows where id matches the outer record.
SQL: | SELECT id FROM products AS prod
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.id = prod.id
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04530 | train |
v1 | Schema:
items (alias: lne)(date, id, type, amount)
shipments(salary, id, value, level)
Task: Select code from items where level exists in shipments for the same code.
SQL: | SELECT code FROM items AS lne
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.code = lne.code
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_04531 | train |
v3 | Schema:
categories (alias: catg)(amount, type, status, salary)
shipments(status, level, salary, amount)
Task: Retrieve value from categories with value above the MIN(salary) of shipments rows sharing the same type.
SQL: | SELECT value FROM categories AS catg
WHERE value > (
SELECT MIN(salary) FROM shipments AS shp
WHERE shp.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_04532 | train |
v2 | Schema:
schedules (alias: schd)(level, name, value, date)
shipments(type, date, value, amount)
Task: Find salary from schedules where a matching record exists in shipments with the same status.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_04533 | train |
v1 | Schema:
customers (alias: cust)(amount, name, value, type)
schedules(code, value, date, salary)
Task: Find name from customers where id appears in schedules entries with matching type.
SQL: | SELECT name FROM customers AS cust
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04534 | train |
v3 | Schema:
accounts (alias: acct)(date, salary, status, id)
invoices(type, date, status, amount)
Task: Retrieve amount from accounts with value above the SUM(salary) of invoices rows sharing the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE value > (
SELECT SUM(salary) FROM invoices AS inv
WHERE inv.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04535 | train |
v3 | Schema:
invoices (alias: inv)(salary, level, amount, id)
managers(status, name, code, salary)
Task: Find id from invoices where value exceeds the minimum value from managers for the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE value > (
SELECT MIN(value) FROM managers AS mgr
WHERE mgr.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04536 | train |
v1 | Schema:
tasks (alias: tsk)(value, type, level, status)
schedules(salary, amount, level, status)
Task: Retrieve code from tasks whose id is found in schedules rows where level matches the outer record.
SQL: | SELECT code FROM tasks AS tsk
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_04537 | train |
v3 | Schema:
orders (alias: ord)(name, date, code, id)
managers(salary, value, id, level)
Task: Retrieve amount from orders with salary above the MIN(amount) of managers rows sharing the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE salary > (
SELECT MIN(amount) FROM managers AS mgr
WHERE mgr.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04538 | train |
v1 | Schema:
invoices (alias: inv)(salary, id, value, code)
branches(status, id, level, amount)
Task: Select salary from invoices where status exists in branches for the same type.
SQL: | SELECT salary FROM invoices AS inv
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04539 | train |
v2 | Schema:
invoices (alias: inv)(type, date, level, status)
products(date, value, salary, id)
Task: Find salary from invoices where a matching record exists in products with the same id.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04540 | train |
v2 | Schema:
items (alias: lne)(code, id, name, value)
employees(amount, type, salary, date)
Task: Find amount from items where a matching record exists in employees with the same level.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = lne.level
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_04541 | train |
v2 | Schema:
shipments (alias: shp)(amount, date, code, value)
orders(level, value, id, amount)
Task: Find code from shipments where a matching record exists in orders with the same code.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_04542 | train |
v1 | Schema:
regions (alias: rgn)(type, salary, amount, code)
customers(amount, value, code, salary)
Task: Find name from regions where code appears in customers entries with matching type.
SQL: | SELECT name FROM regions AS rgn
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_04543 | train |
v1 | Schema:
accounts (alias: acct)(id, amount, name, status)
invoices(code, salary, date, name)
Task: Find code from accounts where status appears in invoices entries with matching id.
SQL: | SELECT code FROM accounts AS acct
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04544 | train |
v2 | Schema:
transactions (alias: txn)(type, amount, level, date)
products(status, date, amount, name)
Task: Find code from transactions where a matching record exists in products with the same id.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04545 | train |
v3 | Schema:
managers (alias: mgr)(level, salary, id, code)
customers(id, salary, name, date)
Task: Find code from managers where value exceeds the total amount from customers for the same type.
SQL: | SELECT code FROM managers AS mgr
WHERE value > (
SELECT SUM(amount) FROM customers AS cust
WHERE cust.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04546 | train |
v1 | Schema:
schedules (alias: schd)(date, value, name, salary)
managers(value, id, date, level)
Task: Retrieve code from schedules whose id is found in managers rows where type matches the outer record.
SQL: | SELECT code FROM schedules AS schd
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_04547 | train |
v1 | Schema:
sales (alias: sale)(value, date, name, status)
managers(level, code, amount, id)
Task: Select amount from sales where status exists in managers for the same code.
SQL: | SELECT amount FROM sales AS sale
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04548 | train |
v1 | Schema:
employees (alias: emp)(amount, type, status, name)
orders(id, date, type, salary)
Task: Retrieve id from employees whose id is found in orders rows where status matches the outer record.
SQL: | SELECT id FROM employees AS emp
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04549 | train |
v1 | Schema:
items (alias: lne)(level, type, amount, name)
shipments(status, amount, level, name)
Task: Retrieve code from items whose id is found in shipments rows where id matches the outer record.
SQL: | SELECT code FROM items AS lne
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.id = lne.id
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_04550 | train |
v2 | Schema:
sales (alias: sale)(name, level, amount, date)
managers(id, amount, code, name)
Task: Retrieve code from sales that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04551 | train |
v3 | Schema:
requests (alias: ordr)(code, name, amount, level)
projects(date, amount, value, code)
Task: Find value from requests where salary exceeds the average amount from projects for the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE salary > (
SELECT AVG(amount) FROM projects AS prj
WHERE prj.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_04552 | train |
v3 | Schema:
tasks (alias: tsk)(type, name, level, code)
branches(id, value, type, date)
Task: Retrieve value from tasks with amount above the AVG(value) of branches rows sharing the same level.
SQL: | SELECT value FROM tasks AS tsk
WHERE amount > (
SELECT AVG(value) FROM branches AS brc
WHERE brc.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_04553 | train |
v3 | Schema:
branches (alias: brc)(value, name, id, date)
managers(name, date, amount, level)
Task: Retrieve name from branches with amount above the MIN(value) of managers rows sharing the same level.
SQL: | SELECT name FROM branches AS brc
WHERE amount > (
SELECT MIN(value) FROM managers AS mgr
WHERE mgr.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "managers",
"outer_alias": "brc",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_04554 | train |
v2 | Schema:
orders (alias: ord)(date, salary, status, code)
staff(amount, value, id, date)
Task: Retrieve code from orders that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04555 | train |
v3 | Schema:
products (alias: prod)(code, type, salary, value)
invoices(level, name, value, amount)
Task: Find amount from products where value exceeds the count of salary from invoices for the same level.
SQL: | SELECT amount FROM products AS prod
WHERE value > (
SELECT COUNT(salary) FROM invoices AS inv
WHERE inv.level = prod.level
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04556 | train |
v1 | Schema:
staff (alias: empl)(type, salary, level, name)
projects(level, code, amount, type)
Task: Select salary from staff where status exists in projects for the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_04557 | train |
v2 | Schema:
managers (alias: mgr)(type, salary, id, date)
staff(date, level, status, id)
Task: Retrieve value from managers that have at least one corresponding entry in staff sharing the same type.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04558 | train |
v2 | Schema:
requests (alias: ordr)(type, name, id, status)
managers(code, salary, type, level)
Task: Find salary from requests where a matching record exists in managers with the same type.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_04559 | train |
v1 | Schema:
regions (alias: rgn)(name, type, salary, code)
products(value, date, name, salary)
Task: Retrieve salary from regions whose status is found in products rows where id matches the outer record.
SQL: | SELECT salary FROM regions AS rgn
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_04560 | train |
v3 | Schema:
products (alias: prod)(status, amount, date, value)
sales(type, value, status, id)
Task: Find amount from products where salary exceeds the minimum salary from sales for the same status.
SQL: | SELECT amount FROM products AS prod
WHERE salary > (
SELECT MIN(salary) FROM sales AS sale
WHERE sale.status = prod.status
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04561 | train |
v1 | Schema:
branches (alias: brc)(id, status, code, level)
items(code, name, type, value)
Task: Retrieve id from branches whose level is found in items rows where type matches the outer record.
SQL: | SELECT id FROM branches AS brc
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_04562 | train |
v1 | Schema:
categories (alias: catg)(status, date, amount, value)
shipments(name, value, amount, salary)
Task: Find name from categories where level appears in shipments entries with matching code.
SQL: | SELECT name FROM categories AS catg
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_04563 | train |
v1 | Schema:
invoices (alias: inv)(level, type, date, status)
requests(status, name, amount, date)
Task: Retrieve salary from invoices whose level is found in requests rows where code matches the outer record.
SQL: | SELECT salary FROM invoices AS inv
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04564 | train |
v3 | Schema:
projects (alias: prj)(type, level, id, status)
regions(amount, status, value, id)
Task: Retrieve salary from projects with salary above the MIN(salary) of regions rows sharing the same level.
SQL: | SELECT salary FROM projects AS prj
WHERE salary > (
SELECT MIN(salary) FROM regions AS rgn
WHERE rgn.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_04565 | train |
v1 | Schema:
staff (alias: empl)(level, date, type, status)
accounts(level, salary, date, id)
Task: Select value from staff where id exists in accounts for the same id.
SQL: | SELECT value FROM staff AS empl
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_04566 | train |
v3 | Schema:
orders (alias: ord)(name, id, status, amount)
items(date, code, type, id)
Task: Find salary from orders where value exceeds the count of value from items for the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE value > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04567 | train |
v3 | Schema:
staff (alias: empl)(date, id, salary, type)
tasks(value, salary, status, id)
Task: Retrieve name from staff with salary above the MIN(amount) of tasks rows sharing the same type.
SQL: | SELECT name FROM staff AS empl
WHERE salary > (
SELECT MIN(amount) FROM tasks AS tsk
WHERE tsk.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_04568 | train |
v1 | Schema:
sales (alias: sale)(name, amount, id, value)
transactions(name, salary, code, amount)
Task: Select name from sales where level exists in transactions for the same level.
SQL: | SELECT name FROM sales AS sale
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04569 | train |
v1 | Schema:
tasks (alias: tsk)(salary, date, level, id)
accounts(code, status, name, type)
Task: Find amount from tasks where type appears in accounts entries with matching level.
SQL: | SELECT amount FROM tasks AS tsk
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_04570 | train |
v2 | Schema:
managers (alias: mgr)(code, id, date, status)
sales(date, level, amount, type)
Task: Find salary from managers where a matching record exists in sales with the same level.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04571 | train |
v1 | Schema:
accounts (alias: acct)(id, level, date, code)
requests(level, amount, status, type)
Task: Retrieve salary from accounts whose level is found in requests rows where code matches the outer record.
SQL: | SELECT salary FROM accounts AS acct
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04572 | train |
v1 | Schema:
shipments (alias: shp)(date, salary, type, amount)
managers(name, type, level, amount)
Task: Select name from shipments where code exists in managers for the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_04573 | train |
v2 | Schema:
branches (alias: brc)(code, name, status, level)
managers(value, level, name, code)
Task: Find salary from branches where a matching record exists in managers with the same level.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "managers",
"outer_alias": "brc",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_04574 | train |
v2 | Schema:
orders (alias: ord)(date, salary, level, amount)
shipments(name, level, salary, id)
Task: Find value from orders where a matching record exists in shipments with the same id.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04575 | train |
v1 | Schema:
orders (alias: ord)(status, id, type, salary)
regions(status, code, id, salary)
Task: Retrieve salary from orders whose code is found in regions rows where level matches the outer record.
SQL: | SELECT salary FROM orders AS ord
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04576 | train |
v2 | Schema:
shipments (alias: shp)(status, level, salary, name)
regions(date, name, value, level)
Task: Retrieve amount from shipments that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_04577 | train |
v3 | Schema:
projects (alias: prj)(name, level, date, salary)
transactions(id, salary, type, date)
Task: Find name from projects where value exceeds the minimum salary from transactions for the same level.
SQL: | SELECT name FROM projects AS prj
WHERE value > (
SELECT MIN(salary) FROM transactions AS txn
WHERE txn.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_04578 | train |
v1 | Schema:
transactions (alias: txn)(name, amount, status, id)
shipments(id, amount, code, type)
Task: Find code from transactions where id appears in shipments entries with matching level.
SQL: | SELECT code FROM transactions AS txn
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04579 | train |
v1 | Schema:
shipments (alias: shp)(date, type, amount, level)
branches(code, value, level, date)
Task: Select name from shipments where level exists in branches for the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_04580 | train |
v3 | Schema:
items (alias: lne)(id, level, type, date)
staff(status, level, date, salary)
Task: Find code from items where amount exceeds the count of salary from staff for the same code.
SQL: | SELECT code FROM items AS lne
WHERE amount > (
SELECT COUNT(salary) FROM staff AS empl
WHERE empl.code = lne.code
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_04581 | train |
v2 | Schema:
tasks (alias: tsk)(type, salary, level, amount)
departments(level, date, value, status)
Task: Find code from tasks where a matching record exists in departments with the same id.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "tsk",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_04582 | train |
v1 | Schema:
orders (alias: ord)(value, name, salary, id)
schedules(amount, salary, code, date)
Task: Retrieve salary from orders whose id is found in schedules rows where status matches the outer record.
SQL: | SELECT salary FROM orders AS ord
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04583 | train |
v3 | Schema:
invoices (alias: inv)(salary, id, level, value)
schedules(name, amount, value, date)
Task: Retrieve code from invoices with salary above the AVG(amount) of schedules rows sharing the same code.
SQL: | SELECT code FROM invoices AS inv
WHERE salary > (
SELECT AVG(amount) FROM schedules AS schd
WHERE schd.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04584 | train |
v3 | Schema:
regions (alias: rgn)(code, name, date, salary)
tasks(type, salary, value, code)
Task: Retrieve name from regions with salary above the SUM(value) of tasks rows sharing the same status.
SQL: | SELECT name FROM regions AS rgn
WHERE salary > (
SELECT SUM(value) FROM tasks AS tsk
WHERE tsk.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_04585 | train |
v1 | Schema:
employees (alias: emp)(id, code, salary, amount)
shipments(salary, type, amount, code)
Task: Retrieve salary from employees whose level is found in shipments rows where level matches the outer record.
SQL: | SELECT salary FROM employees AS emp
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04586 | train |
v1 | Schema:
accounts (alias: acct)(amount, value, level, id)
items(amount, date, id, type)
Task: Retrieve value from accounts whose level is found in items rows where type matches the outer record.
SQL: | SELECT value FROM accounts AS acct
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04587 | train |
v1 | Schema:
projects (alias: prj)(level, id, status, value)
customers(level, amount, id, value)
Task: Find id from projects where type appears in customers entries with matching level.
SQL: | SELECT id FROM projects AS prj
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "prj",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_04588 | train |
v2 | Schema:
categories (alias: catg)(type, name, date, status)
accounts(level, code, id, value)
Task: Find amount from categories where a matching record exists in accounts with the same status.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_04589 | train |
v2 | Schema:
accounts (alias: acct)(level, amount, name, code)
employees(status, id, level, value)
Task: Retrieve value from accounts that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04590 | train |
v3 | Schema:
transactions (alias: txn)(salary, date, level, name)
accounts(status, value, level, type)
Task: Retrieve salary from transactions with value above the AVG(amount) of accounts rows sharing the same level.
SQL: | SELECT salary FROM transactions AS txn
WHERE value > (
SELECT AVG(amount) FROM accounts AS acct
WHERE acct.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04591 | train |
v3 | Schema:
items (alias: lne)(amount, name, level, id)
invoices(name, type, date, salary)
Task: Retrieve id from items with salary above the SUM(amount) of invoices rows sharing the same code.
SQL: | SELECT id FROM items AS lne
WHERE salary > (
SELECT SUM(amount) FROM invoices AS inv
WHERE inv.code = lne.code
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_04592 | train |
v3 | Schema:
branches (alias: brc)(name, date, value, salary)
employees(value, type, date, status)
Task: Retrieve id from branches with amount above the SUM(amount) of employees rows sharing the same level.
SQL: | SELECT id FROM branches AS brc
WHERE amount > (
SELECT SUM(amount) FROM employees AS emp
WHERE emp.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_04593 | train |
v1 | Schema:
accounts (alias: acct)(type, date, id, status)
projects(value, name, date, salary)
Task: Select salary from accounts where id exists in projects for the same type.
SQL: | SELECT salary FROM accounts AS acct
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04594 | train |
v1 | Schema:
orders (alias: ord)(name, code, type, status)
transactions(date, amount, status, code)
Task: Retrieve code from orders whose code is found in transactions rows where level matches the outer record.
SQL: | SELECT code FROM orders AS ord
WHERE code IN (
SELECT code 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": "code",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04595 | train |
v1 | Schema:
items (alias: lne)(name, code, date, type)
branches(level, status, id, salary)
Task: Retrieve name from items whose status is found in branches rows where level matches the outer record.
SQL: | SELECT name FROM items AS lne
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.level = lne.level
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_04596 | train |
v1 | Schema:
projects (alias: prj)(amount, salary, status, date)
departments(id, value, level, salary)
Task: Retrieve code from projects whose code is found in departments rows where id matches the outer record.
SQL: | SELECT code FROM projects AS prj
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_04597 | train |
v1 | Schema:
regions (alias: rgn)(id, level, type, value)
orders(value, id, code, amount)
Task: Select value from regions where status exists in orders for the same level.
SQL: | SELECT value FROM regions AS rgn
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_04598 | train |
v3 | Schema:
schedules (alias: schd)(id, date, code, value)
shipments(salary, value, date, code)
Task: Find code from schedules where value exceeds the maximum amount from shipments for the same type.
SQL: | SELECT code FROM schedules AS schd
WHERE value > (
SELECT MAX(amount) FROM shipments AS shp
WHERE shp.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_04599 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.