variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v2 | Schema:
customers (alias: cust)(level, id, code, value)
requests(date, name, amount, id)
Task: Find salary from customers where a matching record exists in requests with the same type.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17500 | train |
v3 | Schema:
employees (alias: emp)(type, date, name, salary)
categories(amount, level, type, date)
Task: Retrieve code from employees with amount above the MAX(value) of categories rows sharing the same type.
SQL: | SELECT code FROM employees AS emp
WHERE amount > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17501 | train |
v1 | Schema:
shipments (alias: shp)(id, date, name, salary)
requests(value, code, name, amount)
Task: Retrieve id from shipments whose id is found in requests rows where type matches the outer record.
SQL: | SELECT id FROM shipments AS shp
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17502 | train |
v2 | Schema:
accounts (alias: acct)(salary, type, name, status)
categories(salary, name, type, date)
Task: Find value from accounts where a matching record exists in categories with the same level.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17503 | train |
v2 | Schema:
sales (alias: sale)(amount, level, code, value)
invoices(value, status, amount, level)
Task: Retrieve name from sales that have at least one corresponding entry in invoices sharing the same id.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17504 | train |
v3 | Schema:
tasks (alias: tsk)(date, level, code, amount)
requests(id, code, date, level)
Task: Retrieve name from tasks with salary above the AVG(amount) of requests rows sharing the same type.
SQL: | SELECT name FROM tasks AS tsk
WHERE salary > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17505 | train |
v2 | Schema:
items (alias: lne)(name, code, status, amount)
customers(name, code, date, value)
Task: Retrieve name from items that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = lne.status
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17506 | train |
v2 | Schema:
regions (alias: rgn)(status, id, type, value)
staff(date, id, amount, level)
Task: Find id from regions where a matching record exists in staff with the same status.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17507 | train |
v1 | Schema:
schedules (alias: schd)(date, salary, status, id)
tasks(status, level, amount, id)
Task: Find name from schedules where level appears in tasks entries with matching status.
SQL: | SELECT name FROM schedules AS schd
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17508 | train |
v3 | Schema:
orders (alias: ord)(id, level, type, date)
projects(name, value, id, date)
Task: Find name from orders where amount exceeds the count of value from projects for the same code.
SQL: | SELECT name FROM orders AS ord
WHERE amount > (
SELECT COUNT(value) FROM projects AS prj
WHERE prj.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17509 | train |
v2 | Schema:
transactions (alias: txn)(value, level, type, name)
branches(salary, id, amount, status)
Task: Retrieve name from transactions that have at least one corresponding entry in branches sharing the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17510 | train |
v1 | Schema:
staff (alias: empl)(code, amount, id, type)
employees(salary, amount, id, type)
Task: Select amount from staff where code exists in employees for the same code.
SQL: | SELECT amount FROM staff AS empl
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17511 | train |
v3 | Schema:
regions (alias: rgn)(name, level, status, salary)
products(salary, name, type, value)
Task: Find name from regions where amount exceeds the average value from products for the same id.
SQL: | SELECT name FROM regions AS rgn
WHERE amount > (
SELECT AVG(value) FROM products AS prod
WHERE prod.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17512 | train |
v2 | Schema:
regions (alias: rgn)(value, level, salary, id)
projects(name, salary, status, code)
Task: Find amount from regions where a matching record exists in projects with the same id.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17513 | train |
v2 | Schema:
staff (alias: empl)(status, name, date, id)
invoices(level, type, code, salary)
Task: Retrieve name from staff that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17514 | train |
v1 | Schema:
products (alias: prod)(status, name, code, value)
invoices(date, id, code, status)
Task: Find amount from products where type appears in invoices entries with matching level.
SQL: | SELECT amount FROM products AS prod
WHERE type IN (
SELECT type 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": "type",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17515 | train |
v1 | Schema:
invoices (alias: inv)(value, type, salary, status)
sales(salary, status, level, code)
Task: Find salary from invoices where code appears in sales entries with matching level.
SQL: | SELECT salary FROM invoices AS inv
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17516 | train |
v1 | Schema:
items (alias: lne)(status, date, amount, value)
orders(level, amount, name, id)
Task: Retrieve name from items whose level is found in orders rows where type matches the outer record.
SQL: | SELECT name FROM items AS lne
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.type = lne.type
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17517 | train |
v2 | Schema:
regions (alias: rgn)(salary, date, level, name)
staff(date, level, salary, type)
Task: Find value from regions where a matching record exists in staff with the same level.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17518 | train |
v2 | Schema:
regions (alias: rgn)(name, value, level, type)
requests(status, value, id, level)
Task: Find id from regions where a matching record exists in requests with the same status.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17519 | train |
v1 | Schema:
accounts (alias: acct)(value, date, type, status)
branches(date, id, type, code)
Task: Find name from accounts where id appears in branches entries with matching id.
SQL: | SELECT name FROM accounts AS acct
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17520 | train |
v1 | Schema:
transactions (alias: txn)(name, date, level, id)
staff(name, level, status, value)
Task: Retrieve code from transactions whose status is found in staff rows where status matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17521 | train |
v1 | Schema:
shipments (alias: shp)(date, id, value, type)
orders(status, type, value, code)
Task: Find id from shipments where code appears in orders entries with matching id.
SQL: | SELECT id FROM shipments AS shp
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17522 | train |
v1 | Schema:
invoices (alias: inv)(name, id, code, amount)
managers(code, date, status, amount)
Task: Select id from invoices where type exists in managers for the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17523 | train |
v3 | Schema:
shipments (alias: shp)(code, name, date, level)
sales(type, status, amount, code)
Task: Find id from shipments where value exceeds the maximum amount from sales for the same id.
SQL: | SELECT id FROM shipments AS shp
WHERE value > (
SELECT MAX(amount) FROM sales AS sale
WHERE sale.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17524 | train |
v3 | Schema:
orders (alias: ord)(type, name, date, value)
regions(status, code, amount, name)
Task: Find salary from orders where salary exceeds the minimum value from regions for the same type.
SQL: | SELECT salary FROM orders AS ord
WHERE salary > (
SELECT MIN(value) FROM regions AS rgn
WHERE rgn.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17525 | train |
v3 | Schema:
schedules (alias: schd)(level, id, amount, date)
accounts(value, salary, date, id)
Task: Find amount from schedules where value exceeds the minimum salary from accounts for the same id.
SQL: | SELECT amount FROM schedules AS schd
WHERE value > (
SELECT MIN(salary) FROM accounts AS acct
WHERE acct.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17526 | train |
v3 | Schema:
shipments (alias: shp)(date, id, status, salary)
schedules(amount, value, status, date)
Task: Retrieve salary from shipments with salary above the COUNT(value) of schedules rows sharing the same id.
SQL: | SELECT salary FROM shipments AS shp
WHERE salary > (
SELECT COUNT(value) FROM schedules AS schd
WHERE schd.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17527 | train |
v2 | Schema:
categories (alias: catg)(date, code, type, id)
tasks(amount, type, date, code)
Task: Retrieve name from categories that have at least one corresponding entry in tasks sharing the same code.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17528 | train |
v2 | Schema:
regions (alias: rgn)(level, date, status, amount)
products(status, name, amount, level)
Task: Find amount from regions where a matching record exists in products with the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17529 | train |
v3 | Schema:
items (alias: lne)(amount, code, name, type)
shipments(status, value, name, salary)
Task: Find name from items where salary exceeds the maximum amount from shipments for the same id.
SQL: | SELECT name FROM items AS lne
WHERE salary > (
SELECT MAX(amount) FROM shipments AS shp
WHERE shp.id = lne.id
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17530 | train |
v2 | Schema:
transactions (alias: txn)(amount, type, level, id)
employees(date, salary, amount, value)
Task: Retrieve code from transactions that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17531 | train |
v3 | Schema:
invoices (alias: inv)(value, date, type, name)
transactions(level, salary, status, date)
Task: Find code from invoices where salary exceeds the count of amount from transactions for the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE salary > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17532 | train |
v2 | Schema:
sales (alias: sale)(value, amount, salary, code)
branches(level, name, date, status)
Task: Retrieve amount from sales that have at least one corresponding entry in branches sharing the same level.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "branches",
"outer_alias": "sale",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17533 | train |
v3 | Schema:
projects (alias: prj)(code, level, id, name)
staff(id, status, date, amount)
Task: Find value from projects where value exceeds the maximum amount from staff for the same code.
SQL: | SELECT value FROM projects AS prj
WHERE value > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "staff",
"outer_alias": "prj",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17534 | train |
v1 | Schema:
regions (alias: rgn)(date, id, type, salary)
shipments(id, status, name, date)
Task: Retrieve code from regions whose code is found in shipments rows where id matches the outer record.
SQL: | SELECT code FROM regions AS rgn
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17535 | train |
v2 | Schema:
invoices (alias: inv)(amount, id, date, type)
requests(salary, amount, code, id)
Task: Retrieve name from invoices that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17536 | train |
v1 | Schema:
staff (alias: empl)(value, name, code, type)
accounts(value, date, id, name)
Task: Find amount from staff where code appears in accounts entries with matching status.
SQL: | SELECT amount FROM staff AS empl
WHERE code IN (
SELECT code 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": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17537 | train |
v3 | Schema:
branches (alias: brc)(salary, code, date, amount)
projects(amount, date, value, name)
Task: Find salary from branches where value exceeds the total value from projects for the same id.
SQL: | SELECT salary FROM branches AS brc
WHERE value > (
SELECT SUM(value) FROM projects AS prj
WHERE prj.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17538 | train |
v1 | Schema:
staff (alias: empl)(salary, status, level, name)
accounts(name, type, salary, amount)
Task: Select value from staff where status exists in accounts for the same id.
SQL: | SELECT value FROM staff AS empl
WHERE status IN (
SELECT status 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": "status",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17539 | train |
v3 | Schema:
products (alias: prod)(value, name, status, amount)
tasks(salary, level, type, code)
Task: Find amount from products where amount exceeds the count of salary from tasks for the same code.
SQL: | SELECT amount FROM products AS prod
WHERE amount > (
SELECT COUNT(salary) FROM tasks AS tsk
WHERE tsk.code = prod.code
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17540 | train |
v2 | Schema:
projects (alias: prj)(value, type, amount, code)
accounts(value, amount, name, code)
Task: Find amount from projects where a matching record exists in accounts with the same status.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17541 | train |
v2 | Schema:
shipments (alias: shp)(name, type, code, status)
departments(id, amount, name, level)
Task: Retrieve value from shipments that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17542 | train |
v2 | Schema:
tasks (alias: tsk)(status, type, amount, salary)
invoices(type, amount, code, status)
Task: Retrieve value from tasks that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17543 | train |
v1 | Schema:
tasks (alias: tsk)(level, salary, id, name)
shipments(level, status, amount, salary)
Task: Select id from tasks where type exists in shipments for the same type.
SQL: | SELECT id FROM tasks AS tsk
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17544 | train |
v1 | Schema:
branches (alias: brc)(amount, status, code, date)
categories(name, date, status, code)
Task: Find salary from branches where level appears in categories entries with matching level.
SQL: | SELECT salary FROM branches AS brc
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17545 | train |
v3 | Schema:
transactions (alias: txn)(status, value, amount, name)
departments(value, type, level, status)
Task: Retrieve amount from transactions with value above the COUNT(salary) of departments rows sharing the same type.
SQL: | SELECT amount FROM transactions AS txn
WHERE value > (
SELECT COUNT(salary) FROM departments AS dept
WHERE dept.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17546 | train |
v2 | Schema:
schedules (alias: schd)(type, name, salary, status)
managers(status, type, amount, value)
Task: Retrieve id from schedules that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17547 | train |
v3 | Schema:
tasks (alias: tsk)(id, level, value, name)
shipments(status, code, value, date)
Task: Retrieve salary from tasks with amount above the AVG(salary) of shipments rows sharing the same status.
SQL: | SELECT salary FROM tasks AS tsk
WHERE amount > (
SELECT AVG(salary) FROM shipments AS shp
WHERE shp.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17548 | train |
v1 | Schema:
tasks (alias: tsk)(code, type, amount, level)
projects(code, id, value, type)
Task: Select amount from tasks where type exists in projects for the same code.
SQL: | SELECT amount FROM tasks AS tsk
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17549 | train |
v1 | Schema:
customers (alias: cust)(code, level, status, name)
requests(salary, level, value, date)
Task: Find value from customers where code appears in requests entries with matching status.
SQL: | SELECT value FROM customers AS cust
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17550 | train |
v3 | Schema:
projects (alias: prj)(salary, level, id, name)
branches(value, level, date, amount)
Task: Retrieve code from projects with value above the MAX(salary) of branches rows sharing the same id.
SQL: | SELECT code FROM projects AS prj
WHERE value > (
SELECT MAX(salary) FROM branches AS brc
WHERE brc.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17551 | train |
v3 | Schema:
transactions (alias: txn)(type, date, amount, salary)
accounts(code, amount, salary, value)
Task: Find name from transactions where value exceeds the total amount from accounts for the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE value > (
SELECT SUM(amount) FROM accounts AS acct
WHERE acct.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"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_17552 | train |
v2 | Schema:
projects (alias: prj)(code, id, name, status)
managers(amount, value, name, status)
Task: Retrieve code from projects that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17553 | train |
v3 | Schema:
transactions (alias: txn)(code, type, date, status)
requests(date, id, code, name)
Task: Retrieve amount from transactions with value above the MIN(value) of requests rows sharing the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE value > (
SELECT MIN(value) FROM requests AS ordr
WHERE ordr.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17554 | train |
v1 | Schema:
sales (alias: sale)(date, id, salary, amount)
items(status, name, id, value)
Task: Select name from sales where id exists in items for the same level.
SQL: | SELECT name FROM sales AS sale
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17555 | train |
v3 | Schema:
categories (alias: catg)(level, value, type, amount)
branches(amount, level, type, code)
Task: Find name from categories where salary exceeds the average salary from branches for the same code.
SQL: | SELECT name FROM categories AS catg
WHERE salary > (
SELECT AVG(salary) FROM branches AS brc
WHERE brc.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17556 | train |
v2 | Schema:
regions (alias: rgn)(type, name, date, value)
branches(salary, amount, name, status)
Task: Find value from regions where a matching record exists in branches with the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17557 | train |
v3 | Schema:
requests (alias: ordr)(code, date, type, value)
items(status, type, value, id)
Task: Find value from requests where value exceeds the maximum value from items for the same id.
SQL: | SELECT value FROM requests AS ordr
WHERE value > (
SELECT MAX(value) FROM items AS lne
WHERE lne.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17558 | train |
v3 | Schema:
requests (alias: ordr)(type, name, id, amount)
branches(status, code, salary, id)
Task: Find salary from requests where salary exceeds the total amount from branches for the same type.
SQL: | SELECT salary FROM requests AS ordr
WHERE salary > (
SELECT SUM(amount) FROM branches AS brc
WHERE brc.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17559 | train |
v2 | Schema:
customers (alias: cust)(value, level, salary, type)
employees(status, name, salary, type)
Task: Retrieve salary from customers that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT salary 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": "salary",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17560 | train |
v2 | Schema:
branches (alias: brc)(amount, level, salary, status)
regions(code, name, date, level)
Task: Find code from branches where a matching record exists in regions with the same id.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17561 | train |
v1 | Schema:
items (alias: lne)(amount, id, date, code)
projects(salary, id, level, amount)
Task: Select amount from items where code exists in projects for the same code.
SQL: | SELECT amount FROM items AS lne
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.code = lne.code
); | {
"outer_table": "items",
"inner_table": "projects",
"outer_alias": "lne",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17562 | train |
v1 | Schema:
staff (alias: empl)(code, value, salary, status)
accounts(name, amount, level, id)
Task: Find amount from staff where code appears in accounts entries with matching level.
SQL: | SELECT amount FROM staff AS empl
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17563 | train |
v2 | Schema:
items (alias: lne)(status, id, date, level)
products(value, salary, code, amount)
Task: Retrieve value from items that have at least one corresponding entry in products sharing the same type.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = lne.type
); | {
"outer_table": "items",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17564 | train |
v3 | Schema:
projects (alias: prj)(name, value, level, salary)
sales(date, type, id, amount)
Task: Find code from projects where salary exceeds the count of value from sales for the same level.
SQL: | SELECT code FROM projects AS prj
WHERE salary > (
SELECT COUNT(value) FROM sales AS sale
WHERE sale.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17565 | train |
v2 | Schema:
regions (alias: rgn)(status, value, name, type)
products(code, type, name, amount)
Task: Retrieve code from regions that have at least one corresponding entry in products sharing the same status.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17566 | train |
v1 | Schema:
orders (alias: ord)(status, code, name, amount)
projects(type, level, id, name)
Task: Select code from orders where level exists in projects for the same code.
SQL: | SELECT code FROM orders AS ord
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17567 | train |
v1 | Schema:
sales (alias: sale)(amount, id, name, code)
departments(id, value, code, salary)
Task: Select salary from sales where type exists in departments for the same type.
SQL: | SELECT salary FROM sales AS sale
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17568 | train |
v1 | Schema:
branches (alias: brc)(status, amount, value, name)
managers(value, date, status, name)
Task: Select name from branches where level exists in managers for the same level.
SQL: | SELECT name FROM branches AS brc
WHERE level IN (
SELECT level 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": "level",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17569 | train |
v2 | Schema:
invoices (alias: inv)(level, code, salary, name)
customers(status, type, code, id)
Task: Find value from invoices where a matching record exists in customers with the same level.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17570 | train |
v1 | Schema:
regions (alias: rgn)(date, code, amount, value)
transactions(level, salary, amount, type)
Task: Select amount from regions where code exists in transactions for the same id.
SQL: | SELECT amount FROM regions AS rgn
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17571 | train |
v3 | Schema:
sales (alias: sale)(status, id, code, type)
departments(status, date, name, value)
Task: Retrieve id from sales with amount above the MIN(amount) of departments rows sharing the same code.
SQL: | SELECT id FROM sales AS sale
WHERE amount > (
SELECT MIN(amount) FROM departments AS dept
WHERE dept.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17572 | train |
v2 | Schema:
customers (alias: cust)(amount, level, code, status)
categories(level, id, type, value)
Task: Find name from customers where a matching record exists in categories with the same status.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17573 | train |
v1 | Schema:
invoices (alias: inv)(code, salary, status, id)
staff(amount, value, salary, date)
Task: Select code from invoices where code exists in staff for the same code.
SQL: | SELECT code FROM invoices AS inv
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17574 | train |
v2 | Schema:
accounts (alias: acct)(code, amount, type, status)
departments(salary, value, date, level)
Task: Find amount from accounts where a matching record exists in departments with the same level.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17575 | train |
v1 | Schema:
requests (alias: ordr)(date, salary, status, type)
branches(status, level, code, type)
Task: Retrieve name from requests whose type is found in branches rows where code matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17576 | train |
v2 | Schema:
items (alias: lne)(name, code, type, id)
departments(value, date, salary, code)
Task: Find salary from items where a matching record exists in departments with the same status.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = lne.status
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17577 | train |
v2 | Schema:
categories (alias: catg)(level, date, value, name)
regions(name, salary, type, id)
Task: Find name from categories where a matching record exists in regions with the same type.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17578 | train |
v2 | Schema:
tasks (alias: tsk)(status, level, salary, type)
branches(date, level, type, salary)
Task: Retrieve salary from tasks that have at least one corresponding entry in branches sharing the same code.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17579 | train |
v3 | Schema:
tasks (alias: tsk)(date, name, type, status)
regions(value, amount, level, type)
Task: Find id from tasks where value exceeds the count of value from regions for the same type.
SQL: | SELECT id FROM tasks AS tsk
WHERE value > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17580 | train |
v2 | Schema:
invoices (alias: inv)(status, type, code, date)
products(code, name, salary, type)
Task: Find id from invoices where a matching record exists in products with the same code.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17581 | train |
v3 | Schema:
customers (alias: cust)(level, salary, code, status)
staff(amount, id, code, salary)
Task: Find code from customers where amount exceeds the total amount from staff for the same level.
SQL: | SELECT code FROM customers AS cust
WHERE amount > (
SELECT SUM(amount) FROM staff AS empl
WHERE empl.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17582 | train |
v2 | Schema:
invoices (alias: inv)(type, date, code, level)
customers(amount, type, status, name)
Task: Retrieve amount from invoices that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17583 | train |
v3 | Schema:
customers (alias: cust)(date, name, code, salary)
sales(value, level, code, name)
Task: Find salary from customers where value exceeds the count of value from sales for the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE value > (
SELECT COUNT(value) FROM sales AS sale
WHERE sale.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17584 | train |
v1 | Schema:
tasks (alias: tsk)(salary, id, date, amount)
branches(name, type, status, salary)
Task: Select salary from tasks where status exists in branches for the same level.
SQL: | SELECT salary FROM tasks AS tsk
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17585 | train |
v1 | Schema:
invoices (alias: inv)(code, date, amount, type)
tasks(salary, amount, value, level)
Task: Select code from invoices where type exists in tasks for the same level.
SQL: | SELECT code FROM invoices AS inv
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17586 | train |
v2 | Schema:
staff (alias: empl)(status, type, value, id)
schedules(value, code, type, name)
Task: Find salary from staff where a matching record exists in schedules with the same type.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17587 | train |
v1 | Schema:
transactions (alias: txn)(code, value, type, name)
sales(date, level, code, value)
Task: Find salary from transactions where type appears in sales entries with matching status.
SQL: | SELECT salary FROM transactions AS txn
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17588 | train |
v2 | Schema:
orders (alias: ord)(type, status, amount, name)
managers(type, status, value, date)
Task: Find value from orders where a matching record exists in managers with the same level.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17589 | train |
v1 | Schema:
customers (alias: cust)(id, salary, type, name)
managers(status, date, level, salary)
Task: Retrieve salary from customers whose status is found in managers rows where level matches the outer record.
SQL: | SELECT salary FROM customers AS cust
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17590 | train |
v2 | Schema:
requests (alias: ordr)(type, status, date, id)
managers(date, status, id, salary)
Task: Find salary from requests where a matching record exists in managers with the same level.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17591 | train |
v3 | Schema:
staff (alias: empl)(name, id, date, value)
accounts(value, level, name, type)
Task: Retrieve name from staff with value above the SUM(value) of accounts rows sharing the same code.
SQL: | SELECT name FROM staff AS empl
WHERE value > (
SELECT SUM(value) FROM accounts AS acct
WHERE acct.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17592 | train |
v3 | Schema:
products (alias: prod)(date, value, level, salary)
requests(code, amount, name, id)
Task: Retrieve amount from products with salary above the SUM(value) of requests rows sharing the same status.
SQL: | SELECT amount FROM products AS prod
WHERE salary > (
SELECT SUM(value) FROM requests AS ordr
WHERE ordr.status = prod.status
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17593 | train |
v1 | Schema:
shipments (alias: shp)(type, id, amount, level)
customers(type, level, amount, salary)
Task: Find name from shipments where status appears in customers entries with matching id.
SQL: | SELECT name FROM shipments AS shp
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17594 | train |
v3 | Schema:
schedules (alias: schd)(value, date, level, salary)
projects(value, code, name, salary)
Task: Find id from schedules where value exceeds the total amount from projects for the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE value > (
SELECT SUM(amount) FROM projects AS prj
WHERE prj.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17595 | train |
v2 | Schema:
invoices (alias: inv)(value, name, id, amount)
products(salary, code, value, level)
Task: Retrieve code from invoices that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT code 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": "code",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17596 | train |
v2 | Schema:
orders (alias: ord)(id, date, level, name)
projects(code, amount, value, salary)
Task: Retrieve amount from orders that have at least one corresponding entry in projects sharing the same type.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17597 | train |
v2 | Schema:
branches (alias: brc)(status, id, value, amount)
accounts(name, status, salary, value)
Task: Find value from branches where a matching record exists in accounts with the same level.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "accounts",
"outer_alias": "brc",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17598 | train |
v2 | Schema:
managers (alias: mgr)(level, name, id, salary)
tasks(value, type, id, level)
Task: Find amount from managers where a matching record exists in tasks with the same level.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17599 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.