variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v1 | Schema:
requests (alias: ordr)(type, status, date, value)
tasks(status, level, code, date)
Task: Select name from requests where level exists in tasks for the same code.
SQL: | SELECT name FROM requests AS ordr
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02800 | train |
v2 | Schema:
sales (alias: sale)(code, level, id, name)
schedules(name, code, type, value)
Task: Find salary from sales where a matching record exists in schedules with the same id.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02801 | train |
v3 | Schema:
products (alias: prod)(name, salary, code, level)
requests(date, name, type, code)
Task: Find salary from products where value exceeds the total amount from requests for the same status.
SQL: | SELECT salary FROM products AS prod
WHERE value > (
SELECT SUM(amount) FROM requests AS ordr
WHERE ordr.status = prod.status
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02802 | train |
v2 | Schema:
tasks (alias: tsk)(name, amount, code, level)
branches(id, salary, level, status)
Task: Retrieve name from tasks that have at least one corresponding entry in branches sharing the same level.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02803 | train |
v1 | Schema:
staff (alias: empl)(salary, level, value, status)
sales(type, date, amount, code)
Task: Select name from staff where status exists in sales for the same level.
SQL: | SELECT name FROM staff AS empl
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02804 | train |
v2 | Schema:
invoices (alias: inv)(type, amount, code, salary)
accounts(code, level, date, status)
Task: Retrieve amount from invoices that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02805 | train |
v3 | Schema:
departments (alias: dept)(level, salary, id, date)
sales(level, name, type, status)
Task: Find id from departments where amount exceeds the total amount from sales for the same level.
SQL: | SELECT id FROM departments AS dept
WHERE amount > (
SELECT SUM(amount) FROM sales AS sale
WHERE sale.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02806 | train |
v1 | Schema:
accounts (alias: acct)(amount, salary, id, level)
customers(amount, value, salary, status)
Task: Find value from accounts where code appears in customers entries with matching id.
SQL: | SELECT value FROM accounts AS acct
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02807 | train |
v3 | Schema:
shipments (alias: shp)(salary, date, status, code)
branches(name, level, value, type)
Task: Find name from shipments where salary exceeds the maximum value from branches for the same code.
SQL: | SELECT name FROM shipments AS shp
WHERE salary > (
SELECT MAX(value) FROM branches AS brc
WHERE brc.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02808 | train |
v2 | Schema:
managers (alias: mgr)(salary, type, id, amount)
sales(salary, status, level, type)
Task: Find code from managers where a matching record exists in sales with the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02809 | train |
v1 | Schema:
customers (alias: cust)(level, id, name, type)
managers(amount, status, type, date)
Task: Retrieve id from customers whose status is found in managers rows where id matches the outer record.
SQL: | SELECT id FROM customers AS cust
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02810 | train |
v1 | Schema:
schedules (alias: schd)(code, value, status, id)
requests(salary, amount, status, name)
Task: Find value from schedules where type appears in requests entries with matching id.
SQL: | SELECT value FROM schedules AS schd
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02811 | train |
v1 | Schema:
tasks (alias: tsk)(name, code, amount, level)
projects(id, salary, status, code)
Task: Select value from tasks where type exists in projects for the same id.
SQL: | SELECT value FROM tasks AS tsk
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02812 | train |
v3 | Schema:
invoices (alias: inv)(value, type, salary, date)
customers(value, name, status, code)
Task: Find code from invoices where amount exceeds the total value from customers for the same code.
SQL: | SELECT code FROM invoices AS inv
WHERE amount > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02813 | train |
v1 | Schema:
requests (alias: ordr)(name, id, date, amount)
shipments(amount, code, value, level)
Task: Retrieve value from requests whose type is found in shipments rows where type matches the outer record.
SQL: | SELECT value FROM requests AS ordr
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02814 | train |
v1 | Schema:
transactions (alias: txn)(level, id, code, amount)
accounts(status, amount, level, date)
Task: Select salary from transactions where status exists in accounts for the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02815 | train |
v1 | Schema:
regions (alias: rgn)(date, name, status, code)
invoices(code, name, date, type)
Task: Find amount from regions where type appears in invoices entries with matching type.
SQL: | SELECT amount FROM regions AS rgn
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02816 | train |
v1 | Schema:
branches (alias: brc)(code, salary, amount, date)
staff(salary, status, date, code)
Task: Retrieve salary from branches whose status is found in staff rows where id matches the outer record.
SQL: | SELECT salary FROM branches AS brc
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02817 | train |
v3 | Schema:
customers (alias: cust)(type, name, salary, amount)
requests(status, amount, salary, code)
Task: Retrieve value from customers with salary above the COUNT(salary) of requests rows sharing the same level.
SQL: | SELECT value FROM customers AS cust
WHERE salary > (
SELECT COUNT(salary) FROM requests AS ordr
WHERE ordr.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02818 | train |
v3 | Schema:
transactions (alias: txn)(salary, level, value, code)
categories(value, amount, code, name)
Task: Find amount from transactions where value exceeds the maximum amount from categories for the same type.
SQL: | SELECT amount FROM transactions AS txn
WHERE value > (
SELECT MAX(amount) FROM categories AS catg
WHERE catg.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02819 | train |
v3 | Schema:
categories (alias: catg)(code, status, value, id)
sales(amount, type, name, level)
Task: Find amount from categories where value exceeds the count of amount from sales for the same status.
SQL: | SELECT amount FROM categories AS catg
WHERE value > (
SELECT COUNT(amount) FROM sales AS sale
WHERE sale.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02820 | train |
v1 | Schema:
transactions (alias: txn)(id, value, level, date)
staff(type, date, status, id)
Task: Retrieve amount from transactions whose id is found in staff rows where status matches the outer record.
SQL: | SELECT amount FROM transactions AS txn
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02821 | train |
v3 | Schema:
requests (alias: ordr)(value, salary, name, code)
departments(id, name, status, amount)
Task: Retrieve name from requests with amount above the MIN(amount) of departments rows sharing the same code.
SQL: | SELECT name FROM requests AS ordr
WHERE amount > (
SELECT MIN(amount) FROM departments AS dept
WHERE dept.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02822 | train |
v3 | Schema:
accounts (alias: acct)(salary, date, status, level)
items(code, amount, id, level)
Task: Retrieve code from accounts with value above the COUNT(value) of items rows sharing the same status.
SQL: | SELECT code FROM accounts AS acct
WHERE value > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02823 | train |
v3 | Schema:
orders (alias: ord)(type, name, level, id)
customers(name, id, salary, level)
Task: Find name from orders where value exceeds the count of amount from customers for the same type.
SQL: | SELECT name FROM orders AS ord
WHERE value > (
SELECT COUNT(amount) FROM customers AS cust
WHERE cust.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02824 | train |
v3 | Schema:
tasks (alias: tsk)(status, value, id, salary)
categories(value, amount, id, type)
Task: Find salary from tasks where salary exceeds the count of value from categories for the same type.
SQL: | SELECT salary FROM tasks AS tsk
WHERE salary > (
SELECT COUNT(value) FROM categories AS catg
WHERE catg.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02825 | train |
v3 | Schema:
tasks (alias: tsk)(code, value, level, salary)
invoices(name, code, type, status)
Task: Retrieve value from tasks with amount above the SUM(amount) of invoices rows sharing the same level.
SQL: | SELECT value FROM tasks AS tsk
WHERE amount > (
SELECT SUM(amount) FROM invoices AS inv
WHERE inv.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02826 | train |
v1 | Schema:
categories (alias: catg)(id, salary, type, name)
orders(date, name, amount, value)
Task: Retrieve salary from categories whose id is found in orders rows where type matches the outer record.
SQL: | SELECT salary FROM categories AS catg
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02827 | train |
v3 | Schema:
staff (alias: empl)(value, salary, status, level)
schedules(level, id, salary, amount)
Task: Retrieve salary from staff with amount above the AVG(salary) of schedules rows sharing the same type.
SQL: | SELECT salary FROM staff AS empl
WHERE amount > (
SELECT AVG(salary) FROM schedules AS schd
WHERE schd.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02828 | train |
v1 | Schema:
tasks (alias: tsk)(date, value, type, salary)
shipments(name, code, status, id)
Task: Retrieve amount from tasks whose type is found in shipments rows where code matches the outer record.
SQL: | SELECT amount FROM tasks AS tsk
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02829 | train |
v2 | Schema:
regions (alias: rgn)(code, id, salary, level)
projects(type, salary, name, level)
Task: Find name from regions where a matching record exists in projects with the same type.
SQL: | SELECT name 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": "name",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02830 | train |
v2 | Schema:
items (alias: lne)(status, value, amount, type)
accounts(name, level, id, amount)
Task: Retrieve salary from items that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = lne.level
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02831 | train |
v1 | Schema:
requests (alias: ordr)(value, name, salary, id)
invoices(value, id, name, status)
Task: Retrieve id from requests whose status is found in invoices rows where type matches the outer record.
SQL: | SELECT id FROM requests AS ordr
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02832 | train |
v1 | Schema:
projects (alias: prj)(status, name, level, date)
staff(salary, amount, type, value)
Task: Retrieve id from projects whose id is found in staff rows where level matches the outer record.
SQL: | SELECT id FROM projects AS prj
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "staff",
"outer_alias": "prj",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02833 | train |
v3 | Schema:
staff (alias: empl)(salary, amount, code, date)
customers(level, name, date, amount)
Task: Retrieve id from staff with value above the MAX(salary) of customers rows sharing the same code.
SQL: | SELECT id FROM staff AS empl
WHERE value > (
SELECT MAX(salary) FROM customers AS cust
WHERE cust.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02834 | train |
v2 | Schema:
staff (alias: empl)(amount, value, id, name)
items(level, code, salary, name)
Task: Find id from staff where a matching record exists in items with the same level.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02835 | train |
v2 | Schema:
invoices (alias: inv)(date, level, value, id)
schedules(code, name, value, amount)
Task: Find value from invoices where a matching record exists in schedules with the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02836 | train |
v3 | Schema:
customers (alias: cust)(type, amount, code, status)
transactions(amount, date, value, level)
Task: Find id from customers where salary exceeds the minimum value from transactions for the same id.
SQL: | SELECT id FROM customers AS cust
WHERE salary > (
SELECT MIN(value) FROM transactions AS txn
WHERE txn.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02837 | train |
v3 | Schema:
managers (alias: mgr)(status, level, amount, id)
invoices(code, type, status, name)
Task: Find name from managers where value exceeds the maximum value from invoices for the same code.
SQL: | SELECT name FROM managers AS mgr
WHERE value > (
SELECT MAX(value) FROM invoices AS inv
WHERE inv.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02838 | train |
v1 | Schema:
customers (alias: cust)(status, name, id, date)
invoices(type, level, salary, status)
Task: Select code from customers where type exists in invoices for the same id.
SQL: | SELECT code FROM customers AS cust
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02839 | train |
v3 | Schema:
schedules (alias: schd)(id, code, name, status)
items(salary, amount, status, level)
Task: Find salary from schedules where salary exceeds the total salary from items for the same code.
SQL: | SELECT salary FROM schedules AS schd
WHERE salary > (
SELECT SUM(salary) FROM items AS lne
WHERE lne.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02840 | train |
v1 | Schema:
regions (alias: rgn)(name, salary, value, status)
managers(value, status, name, level)
Task: Select id from regions where id exists in managers for the same status.
SQL: | SELECT id FROM regions AS rgn
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02841 | train |
v2 | Schema:
orders (alias: ord)(salary, date, level, code)
sales(id, value, code, level)
Task: Retrieve id from orders that have at least one corresponding entry in sales sharing the same status.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02842 | train |
v3 | Schema:
employees (alias: emp)(code, salary, name, status)
schedules(name, level, type, id)
Task: Find salary from employees where salary exceeds the minimum value from schedules for the same level.
SQL: | SELECT salary FROM employees AS emp
WHERE salary > (
SELECT MIN(value) FROM schedules AS schd
WHERE schd.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02843 | train |
v1 | Schema:
invoices (alias: inv)(salary, level, value, id)
transactions(date, status, value, id)
Task: Find name from invoices where code appears in transactions entries with matching code.
SQL: | SELECT name FROM invoices AS inv
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02844 | train |
v2 | Schema:
schedules (alias: schd)(value, type, name, level)
sales(salary, id, name, value)
Task: Retrieve id from schedules that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02845 | train |
v1 | Schema:
products (alias: prod)(name, id, status, code)
branches(type, salary, level, date)
Task: Find code from products where level appears in branches entries with matching id.
SQL: | SELECT code FROM products AS prod
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.id = prod.id
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02846 | train |
v2 | Schema:
employees (alias: emp)(id, status, salary, type)
items(type, name, date, salary)
Task: Find amount from employees where a matching record exists in items with the same status.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02847 | train |
v3 | Schema:
managers (alias: mgr)(amount, name, id, value)
branches(status, value, date, code)
Task: Retrieve name from managers with amount above the MAX(amount) of branches rows sharing the same type.
SQL: | SELECT name FROM managers AS mgr
WHERE amount > (
SELECT MAX(amount) FROM branches AS brc
WHERE brc.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02848 | train |
v1 | Schema:
branches (alias: brc)(salary, type, status, value)
accounts(code, id, name, amount)
Task: Select amount from branches where status exists in accounts for the same status.
SQL: | SELECT amount FROM branches AS brc
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "accounts",
"outer_alias": "brc",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02849 | train |
v3 | Schema:
employees (alias: emp)(status, code, level, id)
invoices(code, salary, date, status)
Task: Find code from employees where salary exceeds the average salary from invoices for the same type.
SQL: | SELECT code FROM employees AS emp
WHERE salary > (
SELECT AVG(salary) FROM invoices AS inv
WHERE inv.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02850 | train |
v2 | Schema:
accounts (alias: acct)(id, value, type, amount)
projects(value, amount, date, salary)
Task: Retrieve value from accounts that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02851 | train |
v3 | Schema:
transactions (alias: txn)(status, date, salary, level)
branches(type, id, value, status)
Task: Find value from transactions where value exceeds the total amount from branches for the same id.
SQL: | SELECT value FROM transactions AS txn
WHERE value > (
SELECT SUM(amount) FROM branches AS brc
WHERE brc.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "value",
"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_02852 | train |
v2 | Schema:
items (alias: lne)(value, id, status, name)
products(status, level, salary, type)
Task: Retrieve name from items that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = lne.level
); | {
"outer_table": "items",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02853 | train |
v3 | Schema:
categories (alias: catg)(id, type, code, status)
shipments(status, type, name, value)
Task: Find value from categories where salary exceeds the maximum value from shipments for the same id.
SQL: | SELECT value FROM categories AS catg
WHERE salary > (
SELECT MAX(value) FROM shipments AS shp
WHERE shp.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "value",
"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_02854 | train |
v1 | Schema:
staff (alias: empl)(type, date, status, value)
shipments(id, type, value, level)
Task: Find salary from staff where code appears in shipments entries with matching id.
SQL: | SELECT salary FROM staff AS empl
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02855 | train |
v2 | Schema:
employees (alias: emp)(date, value, amount, salary)
products(name, id, amount, level)
Task: Find name from employees where a matching record exists in products with the same type.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02856 | train |
v1 | Schema:
categories (alias: catg)(name, salary, amount, level)
invoices(level, value, date, type)
Task: Find amount from categories where id appears in invoices entries with matching id.
SQL: | SELECT amount FROM categories AS catg
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02857 | train |
v2 | Schema:
invoices (alias: inv)(name, date, status, salary)
transactions(date, name, id, type)
Task: Retrieve name from invoices that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02858 | train |
v3 | Schema:
accounts (alias: acct)(name, amount, code, value)
customers(id, date, code, type)
Task: Find salary from accounts where value exceeds the average value from customers for the same type.
SQL: | SELECT salary FROM accounts AS acct
WHERE value > (
SELECT AVG(value) FROM customers AS cust
WHERE cust.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02859 | train |
v3 | Schema:
branches (alias: brc)(amount, id, status, level)
regions(type, value, salary, level)
Task: Retrieve id from branches with salary above the SUM(value) of regions rows sharing the same level.
SQL: | SELECT id FROM branches AS brc
WHERE salary > (
SELECT SUM(value) FROM regions AS rgn
WHERE rgn.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02860 | train |
v2 | Schema:
schedules (alias: schd)(level, salary, type, date)
departments(id, value, type, level)
Task: Retrieve salary from schedules that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02861 | train |
v3 | Schema:
shipments (alias: shp)(name, date, level, status)
categories(type, code, status, salary)
Task: Find name from shipments where amount exceeds the count of salary from categories for the same level.
SQL: | SELECT name FROM shipments AS shp
WHERE amount > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02862 | train |
v2 | Schema:
orders (alias: ord)(code, type, id, level)
branches(type, value, code, name)
Task: Retrieve salary from orders that have at least one corresponding entry in branches sharing the same level.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02863 | train |
v1 | Schema:
transactions (alias: txn)(status, code, salary, type)
products(amount, name, salary, id)
Task: Find amount from transactions where level appears in products entries with matching level.
SQL: | SELECT amount FROM transactions AS txn
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02864 | train |
v1 | Schema:
transactions (alias: txn)(amount, status, level, salary)
items(value, name, date, salary)
Task: Select code from transactions where type exists in items for the same code.
SQL: | SELECT code FROM transactions AS txn
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02865 | train |
v1 | Schema:
items (alias: lne)(amount, value, level, type)
requests(id, code, salary, status)
Task: Find value from items where id appears in requests entries with matching level.
SQL: | SELECT value FROM items AS lne
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.level = lne.level
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02866 | train |
v2 | Schema:
accounts (alias: acct)(level, date, salary, code)
projects(id, amount, name, status)
Task: Find amount from accounts where a matching record exists in projects with the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02867 | train |
v1 | Schema:
orders (alias: ord)(value, id, level, amount)
shipments(amount, level, id, status)
Task: Select salary from orders where code exists in shipments for the same id.
SQL: | SELECT salary FROM orders AS ord
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02868 | train |
v2 | Schema:
customers (alias: cust)(id, level, date, salary)
projects(salary, date, type, code)
Task: Find salary from customers where a matching record exists in projects with the same type.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02869 | train |
v3 | Schema:
departments (alias: dept)(name, value, code, id)
branches(amount, type, value, id)
Task: Retrieve name from departments with salary above the COUNT(amount) of branches rows sharing the same id.
SQL: | SELECT name FROM departments AS dept
WHERE salary > (
SELECT COUNT(amount) FROM branches AS brc
WHERE brc.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02870 | train |
v3 | Schema:
products (alias: prod)(date, status, level, id)
categories(type, value, salary, amount)
Task: Retrieve id from products with amount above the MAX(value) of categories rows sharing the same level.
SQL: | SELECT id FROM products AS prod
WHERE amount > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.level = prod.level
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02871 | train |
v2 | Schema:
items (alias: lne)(type, status, code, id)
departments(date, name, status, salary)
Task: Retrieve code from items that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = lne.level
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02872 | train |
v1 | Schema:
sales (alias: sale)(level, value, date, amount)
staff(id, type, salary, name)
Task: Select amount from sales where status exists in staff for the same level.
SQL: | SELECT amount FROM sales AS sale
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02873 | train |
v3 | Schema:
employees (alias: emp)(code, salary, name, amount)
branches(level, id, salary, name)
Task: Retrieve value from employees with salary above the SUM(amount) of branches rows sharing the same code.
SQL: | SELECT value FROM employees AS emp
WHERE salary > (
SELECT SUM(amount) FROM branches AS brc
WHERE brc.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02874 | train |
v3 | Schema:
managers (alias: mgr)(status, date, name, amount)
departments(name, amount, level, id)
Task: Retrieve value from managers with value above the MIN(value) of departments rows sharing the same type.
SQL: | SELECT value FROM managers AS mgr
WHERE value > (
SELECT MIN(value) FROM departments AS dept
WHERE dept.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02875 | train |
v3 | Schema:
items (alias: lne)(salary, name, status, code)
categories(salary, name, date, type)
Task: Retrieve amount from items with amount above the COUNT(value) of categories rows sharing the same id.
SQL: | SELECT amount FROM items AS lne
WHERE amount > (
SELECT COUNT(value) FROM categories AS catg
WHERE catg.id = lne.id
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02876 | train |
v1 | Schema:
staff (alias: empl)(status, level, name, code)
projects(code, id, value, name)
Task: Select salary from staff where level exists in projects for the same id.
SQL: | SELECT salary FROM staff AS empl
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02877 | train |
v1 | Schema:
invoices (alias: inv)(name, code, salary, amount)
tasks(salary, amount, name, level)
Task: Select code from invoices where id exists in tasks for the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE id IN (
SELECT id 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": "id",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02878 | train |
v3 | Schema:
regions (alias: rgn)(status, date, value, name)
transactions(type, salary, name, code)
Task: Retrieve value from regions with value above the MIN(salary) of transactions rows sharing the same level.
SQL: | SELECT value FROM regions AS rgn
WHERE value > (
SELECT MIN(salary) FROM transactions AS txn
WHERE txn.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02879 | train |
v3 | Schema:
schedules (alias: schd)(level, salary, status, value)
shipments(level, type, code, amount)
Task: Find value from schedules where value exceeds the average value from shipments for the same level.
SQL: | SELECT value FROM schedules AS schd
WHERE value > (
SELECT AVG(value) FROM shipments AS shp
WHERE shp.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02880 | train |
v1 | Schema:
projects (alias: prj)(salary, date, amount, code)
staff(value, code, status, name)
Task: Retrieve value from projects whose status is found in staff rows where code matches the outer record.
SQL: | SELECT value FROM projects AS prj
WHERE status IN (
SELECT status 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": "status",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02881 | train |
v2 | Schema:
staff (alias: empl)(value, status, date, salary)
transactions(id, level, amount, salary)
Task: Find amount from staff where a matching record exists in transactions with the same type.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02882 | train |
v3 | Schema:
customers (alias: cust)(code, level, salary, status)
departments(status, name, level, amount)
Task: Retrieve id from customers with amount above the COUNT(salary) of departments rows sharing the same type.
SQL: | SELECT id FROM customers AS cust
WHERE amount > (
SELECT COUNT(salary) FROM departments AS dept
WHERE dept.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02883 | train |
v3 | Schema:
items (alias: lne)(level, value, id, name)
regions(status, level, type, salary)
Task: Retrieve value from items with amount above the MAX(value) of regions rows sharing the same status.
SQL: | SELECT value FROM items AS lne
WHERE amount > (
SELECT MAX(value) FROM regions AS rgn
WHERE rgn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02884 | train |
v2 | Schema:
customers (alias: cust)(level, salary, amount, code)
schedules(status, value, amount, level)
Task: Retrieve salary from customers that have at least one corresponding entry in schedules sharing the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02885 | train |
v1 | Schema:
customers (alias: cust)(type, name, status, value)
categories(value, level, id, code)
Task: Select code from customers where id exists in categories for the same status.
SQL: | SELECT code FROM customers AS cust
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02886 | train |
v3 | Schema:
departments (alias: dept)(salary, code, level, date)
sales(code, amount, level, id)
Task: Find value from departments where value exceeds the count of value from sales for the same id.
SQL: | SELECT value FROM departments AS dept
WHERE value > (
SELECT COUNT(value) FROM sales AS sale
WHERE sale.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02887 | train |
v2 | Schema:
shipments (alias: shp)(status, amount, name, type)
requests(date, status, name, code)
Task: Retrieve amount from shipments that have at least one corresponding entry in requests sharing the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02888 | train |
v3 | Schema:
products (alias: prod)(id, level, date, name)
requests(code, salary, type, id)
Task: Find amount from products where salary exceeds the total amount from requests for the same type.
SQL: | SELECT amount FROM products AS prod
WHERE salary > (
SELECT SUM(amount) FROM requests AS ordr
WHERE ordr.type = prod.type
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02889 | train |
v3 | Schema:
shipments (alias: shp)(salary, name, value, type)
schedules(code, date, amount, id)
Task: Find value from shipments where amount exceeds the average amount from schedules for the same id.
SQL: | SELECT value FROM shipments AS shp
WHERE amount > (
SELECT AVG(amount) FROM schedules AS schd
WHERE schd.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02890 | train |
v1 | Schema:
staff (alias: empl)(value, amount, salary, id)
employees(type, value, id, amount)
Task: Retrieve code from staff whose level is found in employees rows where status matches the outer record.
SQL: | SELECT code FROM staff AS empl
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02891 | train |
v2 | Schema:
categories (alias: catg)(value, level, id, code)
schedules(date, level, type, salary)
Task: Find name from categories where a matching record exists in schedules with the same level.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02892 | train |
v3 | Schema:
projects (alias: prj)(type, salary, date, name)
products(salary, date, amount, type)
Task: Find name from projects where salary exceeds the total salary from products for the same status.
SQL: | SELECT name FROM projects AS prj
WHERE salary > (
SELECT SUM(salary) FROM products AS prod
WHERE prod.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02893 | train |
v3 | Schema:
transactions (alias: txn)(name, type, id, salary)
products(code, status, amount, id)
Task: Retrieve amount from transactions with value above the MIN(value) of products rows sharing the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE value > (
SELECT MIN(value) FROM products AS prod
WHERE prod.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"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_02894 | train |
v2 | Schema:
transactions (alias: txn)(salary, type, status, amount)
regions(status, type, date, code)
Task: Find value from transactions where a matching record exists in regions with the same level.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02895 | train |
v1 | Schema:
sales (alias: sale)(status, salary, amount, date)
accounts(status, date, salary, amount)
Task: Find id from sales where level appears in accounts entries with matching id.
SQL: | SELECT id FROM sales AS sale
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02896 | train |
v3 | Schema:
orders (alias: ord)(date, amount, level, value)
departments(amount, type, date, level)
Task: Retrieve id from orders with salary above the MIN(amount) of departments rows sharing the same status.
SQL: | SELECT id FROM orders AS ord
WHERE salary > (
SELECT MIN(amount) FROM departments AS dept
WHERE dept.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02897 | train |
v2 | Schema:
categories (alias: catg)(status, name, date, amount)
staff(name, date, id, salary)
Task: Retrieve salary from categories that have at least one corresponding entry in staff sharing the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02898 | train |
v2 | Schema:
regions (alias: rgn)(code, name, status, level)
products(code, amount, value, status)
Task: Retrieve id from regions that have at least one corresponding entry in products sharing the same code.
SQL: | SELECT id 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": "id",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02899 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.