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:
staff (alias: empl)(name, id, amount, status)
invoices(code, salary, type, amount)
Task: Find value from staff where a matching record exists in invoices with the same level.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08600 | train |
v1 | Schema:
staff (alias: empl)(name, amount, code, type)
schedules(name, value, salary, date)
Task: Find value from staff where type appears in schedules entries with matching status.
SQL: | SELECT value FROM staff AS empl
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08601 | train |
v3 | Schema:
managers (alias: mgr)(amount, salary, code, value)
customers(status, amount, value, type)
Task: Find value from managers where value exceeds the maximum amount from customers for the same id.
SQL: | SELECT value FROM managers AS mgr
WHERE value > (
SELECT MAX(amount) FROM customers AS cust
WHERE cust.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08602 | train |
v1 | Schema:
items (alias: lne)(code, value, amount, status)
transactions(level, value, date, status)
Task: Retrieve amount from items whose level is found in transactions rows where status matches the outer record.
SQL: | SELECT amount FROM items AS lne
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08603 | train |
v2 | Schema:
categories (alias: catg)(level, value, amount, type)
accounts(level, value, status, date)
Task: Retrieve code from categories that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08604 | train |
v1 | Schema:
departments (alias: dept)(type, id, amount, code)
categories(name, type, salary, amount)
Task: Find name from departments where code appears in categories entries with matching level.
SQL: | SELECT name FROM departments AS dept
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08605 | train |
v3 | Schema:
accounts (alias: acct)(status, salary, name, amount)
products(status, code, amount, level)
Task: Find code from accounts where value exceeds the minimum amount from products for the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE value > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08606 | train |
v3 | Schema:
employees (alias: emp)(level, type, id, code)
sales(date, type, status, name)
Task: Retrieve code from employees with salary above the SUM(salary) of sales rows sharing the same level.
SQL: | SELECT code FROM employees AS emp
WHERE salary > (
SELECT SUM(salary) FROM sales AS sale
WHERE sale.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08607 | train |
v2 | Schema:
products (alias: prod)(amount, level, status, salary)
schedules(value, code, name, status)
Task: Retrieve id from products that have at least one corresponding entry in schedules sharing the same id.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = prod.id
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08608 | train |
v3 | Schema:
regions (alias: rgn)(name, code, date, level)
requests(id, amount, level, name)
Task: Retrieve name from regions with value above the SUM(value) of requests rows sharing the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE value > (
SELECT SUM(value) FROM requests AS ordr
WHERE ordr.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08609 | train |
v3 | Schema:
schedules (alias: schd)(code, status, value, salary)
products(value, salary, code, status)
Task: Retrieve code from schedules with amount above the MIN(amount) of products rows sharing the same code.
SQL: | SELECT code FROM schedules AS schd
WHERE amount > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08610 | train |
v1 | Schema:
categories (alias: catg)(level, name, status, date)
invoices(value, type, amount, date)
Task: Select id from categories where status exists in invoices for the same code.
SQL: | SELECT id FROM categories AS catg
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08611 | train |
v2 | Schema:
regions (alias: rgn)(status, salary, id, date)
managers(name, status, type, code)
Task: Find salary from regions where a matching record exists in managers with the same code.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08612 | train |
v3 | Schema:
tasks (alias: tsk)(level, code, date, id)
shipments(name, amount, type, salary)
Task: Retrieve name from tasks with value above the MAX(amount) of shipments rows sharing the same type.
SQL: | SELECT name FROM tasks AS tsk
WHERE value > (
SELECT MAX(amount) FROM shipments AS shp
WHERE shp.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08613 | train |
v2 | Schema:
requests (alias: ordr)(amount, id, salary, type)
shipments(value, name, code, status)
Task: Find salary from requests where a matching record exists in shipments with the same type.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08614 | train |
v2 | Schema:
managers (alias: mgr)(code, name, type, salary)
regions(type, salary, amount, value)
Task: Retrieve amount from managers that have at least one corresponding entry in regions sharing the same code.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08615 | train |
v2 | Schema:
staff (alias: empl)(value, name, date, salary)
schedules(name, code, id, amount)
Task: Find amount from staff where a matching record exists in schedules with the same code.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08616 | train |
v2 | Schema:
transactions (alias: txn)(date, type, name, level)
managers(level, salary, value, id)
Task: Retrieve salary from transactions that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08617 | train |
v3 | Schema:
tasks (alias: tsk)(id, level, type, code)
customers(salary, name, level, date)
Task: Retrieve salary from tasks with value above the MIN(value) of customers rows sharing the same level.
SQL: | SELECT salary FROM tasks AS tsk
WHERE value > (
SELECT MIN(value) FROM customers AS cust
WHERE cust.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "tsk",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08618 | train |
v1 | Schema:
requests (alias: ordr)(name, salary, id, status)
invoices(level, salary, date, code)
Task: Retrieve value from requests whose status is found in invoices rows where level matches the outer record.
SQL: | SELECT value FROM requests AS ordr
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08619 | train |
v3 | Schema:
categories (alias: catg)(amount, name, date, level)
accounts(value, code, type, name)
Task: Find value from categories where salary exceeds the maximum salary from accounts for the same status.
SQL: | SELECT value FROM categories AS catg
WHERE salary > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08620 | train |
v2 | Schema:
customers (alias: cust)(id, date, code, salary)
invoices(code, level, name, salary)
Task: Retrieve value from customers that have at least one corresponding entry in invoices sharing the same code.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08621 | train |
v2 | Schema:
categories (alias: catg)(amount, id, code, date)
schedules(date, level, status, salary)
Task: Find amount from categories where a matching record exists in schedules with the same code.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08622 | train |
v2 | Schema:
requests (alias: ordr)(name, id, date, amount)
shipments(code, name, date, salary)
Task: Retrieve value from requests that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08623 | train |
v3 | Schema:
schedules (alias: schd)(amount, id, status, level)
categories(amount, level, type, salary)
Task: Retrieve name from schedules with value above the SUM(amount) of categories rows sharing the same code.
SQL: | SELECT name FROM schedules AS schd
WHERE value > (
SELECT SUM(amount) FROM categories AS catg
WHERE catg.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "name",
"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_08624 | train |
v1 | Schema:
orders (alias: ord)(name, date, type, value)
invoices(status, id, type, value)
Task: Find salary from orders where type appears in invoices entries with matching level.
SQL: | SELECT salary FROM orders AS ord
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08625 | train |
v3 | Schema:
projects (alias: prj)(code, value, level, type)
accounts(name, code, level, value)
Task: Retrieve value from projects with salary above the SUM(amount) of accounts rows sharing the same id.
SQL: | SELECT value FROM projects AS prj
WHERE salary > (
SELECT SUM(amount) FROM accounts AS acct
WHERE acct.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08626 | train |
v3 | Schema:
shipments (alias: shp)(level, value, status, code)
sales(date, type, salary, code)
Task: Retrieve amount from shipments with salary above the SUM(amount) of sales rows sharing the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE salary > (
SELECT SUM(amount) FROM sales AS sale
WHERE sale.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08627 | train |
v3 | Schema:
sales (alias: sale)(date, value, id, amount)
employees(type, id, code, level)
Task: Find code from sales where value exceeds the average value from employees for the same status.
SQL: | SELECT code FROM sales AS sale
WHERE value > (
SELECT AVG(value) FROM employees AS emp
WHERE emp.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08628 | train |
v1 | Schema:
transactions (alias: txn)(amount, status, type, name)
branches(type, code, status, level)
Task: Retrieve id from transactions whose code is found in branches rows where code matches the outer record.
SQL: | SELECT id FROM transactions AS txn
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08629 | train |
v2 | Schema:
employees (alias: emp)(id, salary, amount, level)
departments(status, salary, type, value)
Task: Find name from employees where a matching record exists in departments with the same level.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08630 | train |
v2 | Schema:
requests (alias: ordr)(amount, level, name, date)
regions(value, type, code, name)
Task: Retrieve salary from requests that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08631 | train |
v1 | Schema:
tasks (alias: tsk)(date, level, type, amount)
regions(value, amount, date, level)
Task: Retrieve value from tasks whose level is found in regions rows where status matches the outer record.
SQL: | SELECT value FROM tasks AS tsk
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08632 | train |
v3 | Schema:
projects (alias: prj)(code, id, value, amount)
regions(amount, name, type, level)
Task: Retrieve name from projects with value above the COUNT(value) of regions rows sharing the same level.
SQL: | SELECT name FROM projects AS prj
WHERE value > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08633 | train |
v1 | Schema:
shipments (alias: shp)(name, value, date, code)
invoices(level, code, id, salary)
Task: Select id from shipments where code exists in invoices for the same id.
SQL: | SELECT id FROM shipments AS shp
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08634 | train |
v2 | Schema:
schedules (alias: schd)(name, status, salary, value)
orders(value, level, id, salary)
Task: Find name from schedules where a matching record exists in orders with the same code.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08635 | train |
v1 | Schema:
sales (alias: sale)(type, level, id, code)
items(id, date, value, amount)
Task: Find value from sales where type appears in items entries with matching code.
SQL: | SELECT value FROM sales AS sale
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08636 | train |
v1 | Schema:
staff (alias: empl)(date, status, salary, value)
tasks(amount, name, code, type)
Task: Select value from staff where status exists in tasks for the same id.
SQL: | SELECT value FROM staff AS empl
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08637 | train |
v3 | Schema:
tasks (alias: tsk)(value, date, name, status)
employees(amount, value, status, salary)
Task: Retrieve value from tasks with value above the MIN(value) of employees rows sharing the same type.
SQL: | SELECT value FROM tasks AS tsk
WHERE value > (
SELECT MIN(value) FROM employees AS emp
WHERE emp.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "tsk",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08638 | train |
v1 | Schema:
items (alias: lne)(value, id, level, type)
tasks(type, level, value, salary)
Task: Find id from items where level appears in tasks entries with matching code.
SQL: | SELECT id FROM items AS lne
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.code = lne.code
); | {
"outer_table": "items",
"inner_table": "tasks",
"outer_alias": "lne",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08639 | train |
v2 | Schema:
sales (alias: sale)(amount, date, id, type)
employees(amount, id, status, code)
Task: Retrieve id from sales that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08640 | train |
v2 | Schema:
projects (alias: prj)(date, status, id, salary)
employees(type, name, code, value)
Task: Find value from projects where a matching record exists in employees with the same level.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08641 | train |
v3 | Schema:
regions (alias: rgn)(id, name, type, code)
transactions(code, date, salary, amount)
Task: Retrieve amount from regions with amount above the SUM(amount) of transactions rows sharing the same status.
SQL: | SELECT amount FROM regions AS rgn
WHERE amount > (
SELECT SUM(amount) FROM transactions AS txn
WHERE txn.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08642 | train |
v2 | Schema:
requests (alias: ordr)(type, level, status, salary)
sales(code, status, name, amount)
Task: Retrieve name from requests that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08643 | train |
v3 | Schema:
products (alias: prod)(date, status, level, name)
schedules(date, status, level, salary)
Task: Find amount from products where salary exceeds the minimum salary from schedules for the same id.
SQL: | SELECT amount FROM products AS prod
WHERE salary > (
SELECT MIN(salary) FROM schedules AS schd
WHERE schd.id = prod.id
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08644 | train |
v1 | Schema:
transactions (alias: txn)(amount, salary, type, date)
branches(level, value, status, code)
Task: Retrieve id from transactions whose id is found in branches rows where level matches the outer record.
SQL: | SELECT id FROM transactions AS txn
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08645 | train |
v3 | Schema:
branches (alias: brc)(name, value, salary, id)
tasks(value, id, name, code)
Task: Retrieve amount from branches with salary above the MAX(value) of tasks rows sharing the same type.
SQL: | SELECT amount FROM branches AS brc
WHERE salary > (
SELECT MAX(value) FROM tasks AS tsk
WHERE tsk.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08646 | train |
v2 | Schema:
products (alias: prod)(level, id, amount, date)
requests(code, id, date, value)
Task: Find value from products where a matching record exists in requests with the same status.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = prod.status
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08647 | train |
v3 | Schema:
tasks (alias: tsk)(code, status, date, type)
categories(date, name, value, type)
Task: Retrieve value from tasks with value above the MIN(amount) of categories rows sharing the same code.
SQL: | SELECT value FROM tasks AS tsk
WHERE value > (
SELECT MIN(amount) FROM categories AS catg
WHERE catg.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08648 | train |
v2 | Schema:
regions (alias: rgn)(type, status, code, amount)
projects(date, name, id, amount)
Task: Retrieve value from regions that have at least one corresponding entry in projects sharing the same type.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08649 | train |
v3 | Schema:
transactions (alias: txn)(code, status, id, level)
regions(type, code, value, name)
Task: Find name from transactions where amount exceeds the total salary from regions for the same status.
SQL: | SELECT name FROM transactions AS txn
WHERE amount > (
SELECT SUM(salary) FROM regions AS rgn
WHERE rgn.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08650 | train |
v2 | Schema:
sales (alias: sale)(salary, level, status, date)
projects(name, date, level, amount)
Task: Retrieve salary from sales that have at least one corresponding entry in projects sharing the same code.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08651 | train |
v1 | Schema:
schedules (alias: schd)(code, name, amount, status)
invoices(salary, name, value, status)
Task: Find salary from schedules where type appears in invoices entries with matching code.
SQL: | SELECT salary FROM schedules AS schd
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08652 | train |
v1 | Schema:
tasks (alias: tsk)(salary, status, code, date)
invoices(name, status, id, code)
Task: Retrieve salary from tasks whose level is found in invoices rows where level matches the outer record.
SQL: | SELECT salary FROM tasks AS tsk
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08653 | train |
v2 | Schema:
branches (alias: brc)(date, type, level, code)
customers(date, name, level, type)
Task: Find amount from branches where a matching record exists in customers with the same status.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08654 | train |
v3 | Schema:
categories (alias: catg)(salary, date, name, level)
sales(status, id, type, name)
Task: Find id from categories where salary exceeds the maximum value from sales for the same id.
SQL: | SELECT id FROM categories AS catg
WHERE salary > (
SELECT MAX(value) FROM sales AS sale
WHERE sale.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08655 | train |
v2 | Schema:
staff (alias: empl)(amount, code, id, type)
branches(amount, value, id, type)
Task: Find salary from staff where a matching record exists in branches with the same type.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08656 | train |
v3 | Schema:
requests (alias: ordr)(salary, date, value, type)
invoices(status, date, level, code)
Task: Retrieve name from requests with salary above the AVG(salary) of invoices rows sharing the same level.
SQL: | SELECT name FROM requests AS ordr
WHERE salary > (
SELECT AVG(salary) FROM invoices AS inv
WHERE inv.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08657 | train |
v1 | Schema:
customers (alias: cust)(value, code, name, level)
tasks(value, amount, level, id)
Task: Find code from customers where code appears in tasks entries with matching id.
SQL: | SELECT code FROM customers AS cust
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "tasks",
"outer_alias": "cust",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08658 | train |
v1 | Schema:
categories (alias: catg)(status, date, type, value)
customers(name, date, amount, id)
Task: Find amount from categories where level appears in customers entries with matching level.
SQL: | SELECT amount FROM categories AS catg
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08659 | train |
v1 | Schema:
invoices (alias: inv)(level, salary, type, amount)
accounts(code, status, name, salary)
Task: Select code from invoices where type exists in accounts for the same code.
SQL: | SELECT code FROM invoices AS inv
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08660 | train |
v3 | Schema:
managers (alias: mgr)(status, name, salary, value)
projects(salary, status, date, name)
Task: Find name from managers where amount exceeds the maximum amount from projects for the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE amount > (
SELECT MAX(amount) FROM projects AS prj
WHERE prj.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08661 | train |
v3 | Schema:
categories (alias: catg)(code, value, level, type)
accounts(type, value, id, level)
Task: Retrieve name from categories with value above the MAX(salary) of accounts rows sharing the same code.
SQL: | SELECT name FROM categories AS catg
WHERE value > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08662 | train |
v3 | Schema:
sales (alias: sale)(date, name, type, value)
items(name, salary, level, type)
Task: Find name from sales where salary exceeds the maximum value from items for the same level.
SQL: | SELECT name FROM sales AS sale
WHERE salary > (
SELECT MAX(value) 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": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08663 | train |
v2 | Schema:
customers (alias: cust)(id, level, date, type)
products(name, date, salary, value)
Task: Retrieve value from customers that have at least one corresponding entry in products sharing the same type.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08664 | train |
v1 | Schema:
employees (alias: emp)(type, date, amount, salary)
branches(code, status, type, id)
Task: Select amount from employees where type exists in branches for the same code.
SQL: | SELECT amount FROM employees AS emp
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08665 | train |
v2 | Schema:
requests (alias: ordr)(name, amount, type, status)
projects(date, type, salary, status)
Task: Retrieve code from requests that have at least one corresponding entry in projects sharing the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08666 | train |
v3 | Schema:
customers (alias: cust)(value, salary, status, code)
accounts(level, code, value, amount)
Task: Retrieve name from customers with salary above the AVG(amount) of accounts rows sharing the same code.
SQL: | SELECT name FROM customers AS cust
WHERE salary > (
SELECT AVG(amount) FROM accounts AS acct
WHERE acct.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08667 | train |
v1 | Schema:
staff (alias: empl)(code, amount, status, level)
branches(name, code, date, status)
Task: Retrieve name from staff whose code is found in branches rows where status matches the outer record.
SQL: | SELECT name FROM staff AS empl
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08668 | train |
v3 | Schema:
transactions (alias: txn)(amount, type, level, salary)
managers(id, name, code, status)
Task: Find value from transactions where amount exceeds the total salary from managers for the same status.
SQL: | SELECT value FROM transactions AS txn
WHERE amount > (
SELECT SUM(salary) FROM managers AS mgr
WHERE mgr.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08669 | train |
v2 | Schema:
categories (alias: catg)(amount, status, id, type)
requests(amount, type, date, level)
Task: Find code from categories where a matching record exists in requests with the same id.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08670 | train |
v1 | Schema:
customers (alias: cust)(type, value, salary, code)
regions(code, level, id, status)
Task: Find value from customers where code appears in regions entries with matching status.
SQL: | SELECT value FROM customers AS cust
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08671 | train |
v1 | Schema:
tasks (alias: tsk)(level, code, status, value)
accounts(date, id, code, amount)
Task: Select value from tasks where status exists in accounts for the same type.
SQL: | SELECT value FROM tasks AS tsk
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08672 | train |
v2 | Schema:
managers (alias: mgr)(id, name, type, level)
customers(date, name, value, id)
Task: Find id from managers where a matching record exists in customers with the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08673 | train |
v3 | Schema:
managers (alias: mgr)(date, code, level, id)
projects(status, type, amount, salary)
Task: Find value from managers where salary exceeds the count of value from projects for the same status.
SQL: | SELECT value FROM managers AS mgr
WHERE salary > (
SELECT COUNT(value) FROM projects AS prj
WHERE prj.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08674 | train |
v3 | Schema:
branches (alias: brc)(level, code, id, name)
managers(code, id, value, name)
Task: Retrieve name from branches with salary above the MIN(value) of managers rows sharing the same id.
SQL: | SELECT name FROM branches AS brc
WHERE salary > (
SELECT MIN(value) FROM managers AS mgr
WHERE mgr.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "managers",
"outer_alias": "brc",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08675 | train |
v2 | Schema:
shipments (alias: shp)(status, level, type, id)
staff(salary, id, name, value)
Task: Find value from shipments where a matching record exists in staff with the same code.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08676 | train |
v3 | Schema:
customers (alias: cust)(salary, type, code, level)
invoices(value, id, type, salary)
Task: Retrieve code from customers with value above the MIN(value) of invoices rows sharing the same status.
SQL: | SELECT code FROM customers AS cust
WHERE value > (
SELECT MIN(value) FROM invoices AS inv
WHERE inv.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08677 | train |
v2 | Schema:
requests (alias: ordr)(status, id, amount, salary)
regions(type, status, value, salary)
Task: Find code from requests where a matching record exists in regions with the same status.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08678 | train |
v1 | Schema:
managers (alias: mgr)(status, value, name, code)
categories(level, salary, name, status)
Task: Select id from managers where type exists in categories for the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08679 | train |
v2 | Schema:
products (alias: prod)(salary, amount, status, date)
requests(id, status, amount, level)
Task: Retrieve name from products that have at least one corresponding entry in requests sharing the same id.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = prod.id
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08680 | train |
v2 | Schema:
branches (alias: brc)(type, date, status, value)
sales(amount, value, id, name)
Task: Find name from branches where a matching record exists in sales with the same level.
SQL: | SELECT name FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08681 | train |
v3 | Schema:
invoices (alias: inv)(amount, id, salary, status)
tasks(amount, date, type, salary)
Task: Find code from invoices where value exceeds the total value from tasks for the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE value > (
SELECT SUM(value) FROM tasks AS tsk
WHERE tsk.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08682 | train |
v2 | Schema:
shipments (alias: shp)(level, salary, value, type)
regions(level, date, code, status)
Task: Find id from shipments where a matching record exists in regions with the same id.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08683 | train |
v1 | Schema:
tasks (alias: tsk)(salary, id, code, amount)
sales(name, level, code, date)
Task: Retrieve amount from tasks whose type is found in sales rows where code matches the outer record.
SQL: | SELECT amount FROM tasks AS tsk
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08684 | train |
v2 | Schema:
regions (alias: rgn)(id, salary, type, level)
staff(status, id, salary, amount)
Task: Find code from regions where a matching record exists in staff with the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08685 | train |
v1 | Schema:
tasks (alias: tsk)(type, name, level, amount)
sales(code, value, name, status)
Task: Select id from tasks where code exists in sales for the same type.
SQL: | SELECT id FROM tasks AS tsk
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08686 | train |
v2 | Schema:
requests (alias: ordr)(name, code, salary, amount)
projects(id, amount, date, value)
Task: Find code from requests where a matching record exists in projects with the same type.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08687 | train |
v2 | Schema:
invoices (alias: inv)(code, level, value, amount)
branches(salary, type, level, value)
Task: Find salary from invoices where a matching record exists in branches with the same type.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08688 | train |
v1 | Schema:
staff (alias: empl)(id, name, date, status)
products(type, amount, level, code)
Task: Find value from staff where code appears in products entries with matching status.
SQL: | SELECT value FROM staff AS empl
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08689 | train |
v3 | Schema:
staff (alias: empl)(status, salary, date, name)
departments(id, value, date, status)
Task: Retrieve value from staff with value above the MAX(salary) of departments rows sharing the same id.
SQL: | SELECT value FROM staff AS empl
WHERE value > (
SELECT MAX(salary) FROM departments AS dept
WHERE dept.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08690 | train |
v2 | Schema:
items (alias: lne)(code, status, salary, level)
accounts(salary, date, name, value)
Task: Find amount from items where a matching record exists in accounts with the same id.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = lne.id
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08691 | train |
v3 | Schema:
products (alias: prod)(date, id, code, value)
items(level, name, type, status)
Task: Retrieve name from products with value above the AVG(value) of items rows sharing the same level.
SQL: | SELECT name FROM products AS prod
WHERE value > (
SELECT AVG(value) FROM items AS lne
WHERE lne.level = prod.level
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08692 | train |
v1 | Schema:
employees (alias: emp)(value, name, level, status)
accounts(level, salary, id, date)
Task: Find amount from employees where id appears in accounts entries with matching status.
SQL: | SELECT amount FROM employees AS emp
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08693 | train |
v2 | Schema:
employees (alias: emp)(level, salary, amount, id)
tasks(code, value, level, salary)
Task: Find salary from employees where a matching record exists in tasks with the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08694 | train |
v1 | Schema:
departments (alias: dept)(code, salary, level, type)
schedules(level, type, name, salary)
Task: Retrieve id from departments whose status is found in schedules rows where id matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08695 | train |
v1 | Schema:
employees (alias: emp)(level, value, amount, id)
sales(date, salary, name, type)
Task: Select code from employees where id exists in sales for the same level.
SQL: | SELECT code FROM employees AS emp
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08696 | train |
v2 | Schema:
items (alias: lne)(salary, id, date, name)
branches(id, name, value, amount)
Task: Find value from items where a matching record exists in branches with the same status.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = lne.status
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08697 | train |
v3 | Schema:
items (alias: lne)(id, value, date, type)
managers(status, name, level, type)
Task: Find salary from items where salary exceeds the maximum amount from managers for the same id.
SQL: | SELECT salary FROM items AS lne
WHERE salary > (
SELECT MAX(amount) FROM managers AS mgr
WHERE mgr.id = lne.id
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "salary",
"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_08698 | train |
v2 | Schema:
regions (alias: rgn)(name, value, status, amount)
requests(value, date, salary, level)
Task: Retrieve amount from regions that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08699 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.