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:
invoices (alias: inv)(code, salary, level, id)
categories(status, name, salary, code)
Task: Find name from invoices where a matching record exists in categories with the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07900 | train |
v3 | Schema:
managers (alias: mgr)(type, date, name, status)
items(name, id, salary, amount)
Task: Retrieve name from managers with amount above the COUNT(value) of items rows sharing the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE amount > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07901 | train |
v1 | Schema:
customers (alias: cust)(status, amount, salary, code)
branches(status, salary, date, name)
Task: Select value from customers where level exists in branches for the same code.
SQL: | SELECT value FROM customers AS cust
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "branches",
"outer_alias": "cust",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07902 | train |
v2 | Schema:
managers (alias: mgr)(name, level, amount, code)
branches(amount, name, date, value)
Task: Retrieve id from managers that have at least one corresponding entry in branches sharing the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07903 | train |
v1 | Schema:
tasks (alias: tsk)(value, name, id, amount)
staff(value, id, date, amount)
Task: Select id from tasks where code exists in staff for the same status.
SQL: | SELECT id FROM tasks AS tsk
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "staff",
"outer_alias": "tsk",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07904 | train |
v3 | Schema:
products (alias: prod)(amount, level, salary, status)
accounts(value, name, level, type)
Task: Find value from products where amount exceeds the maximum value from accounts for the same status.
SQL: | SELECT value FROM products AS prod
WHERE amount > (
SELECT MAX(value) FROM accounts AS acct
WHERE acct.status = prod.status
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07905 | train |
v3 | Schema:
categories (alias: catg)(amount, date, id, level)
departments(date, id, amount, level)
Task: Find id from categories where salary exceeds the count of amount from departments for the same code.
SQL: | SELECT id FROM categories AS catg
WHERE salary > (
SELECT COUNT(amount) FROM departments AS dept
WHERE dept.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07906 | train |
v3 | Schema:
branches (alias: brc)(level, name, type, value)
products(status, date, value, name)
Task: Find value from branches where salary exceeds the total salary from products for the same code.
SQL: | SELECT value FROM branches AS brc
WHERE salary > (
SELECT SUM(salary) FROM products AS prod
WHERE prod.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07907 | train |
v1 | Schema:
customers (alias: cust)(type, name, value, amount)
regions(id, level, amount, value)
Task: Find code from customers where id appears in regions entries with matching status.
SQL: | SELECT code FROM customers AS cust
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07908 | train |
v2 | Schema:
requests (alias: ordr)(code, status, level, salary)
accounts(amount, date, name, status)
Task: Find salary from requests where a matching record exists in accounts with the same code.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07909 | train |
v3 | Schema:
staff (alias: empl)(id, value, type, level)
schedules(level, salary, name, date)
Task: Retrieve value from staff with salary above the MIN(salary) of schedules rows sharing the same type.
SQL: | SELECT value FROM staff AS empl
WHERE salary > (
SELECT MIN(salary) FROM schedules AS schd
WHERE schd.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07910 | train |
v1 | Schema:
customers (alias: cust)(type, date, status, code)
categories(salary, code, type, name)
Task: Find id from customers where status appears in categories entries with matching type.
SQL: | SELECT id FROM customers AS cust
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07911 | train |
v3 | Schema:
projects (alias: prj)(id, code, type, date)
staff(level, date, salary, code)
Task: Retrieve code from projects with value above the SUM(salary) of staff rows sharing the same code.
SQL: | SELECT code FROM projects AS prj
WHERE value > (
SELECT SUM(salary) FROM staff AS empl
WHERE empl.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "staff",
"outer_alias": "prj",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07912 | train |
v2 | Schema:
employees (alias: emp)(id, amount, date, code)
branches(salary, value, date, status)
Task: Find code from employees where a matching record exists in branches with the same level.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07913 | train |
v3 | Schema:
sales (alias: sale)(value, name, status, type)
tasks(code, type, status, level)
Task: Find amount from sales where amount exceeds the count of salary from tasks for the same status.
SQL: | SELECT amount FROM sales AS sale
WHERE amount > (
SELECT COUNT(salary) FROM tasks AS tsk
WHERE tsk.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07914 | train |
v3 | Schema:
requests (alias: ordr)(name, status, date, amount)
schedules(amount, id, date, name)
Task: Retrieve id from requests with amount above the AVG(value) of schedules rows sharing the same id.
SQL: | SELECT id FROM requests AS ordr
WHERE amount > (
SELECT AVG(value) FROM schedules AS schd
WHERE schd.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07915 | train |
v3 | Schema:
orders (alias: ord)(amount, salary, type, id)
items(amount, code, value, id)
Task: Find salary from orders where salary exceeds the minimum amount from items for the same id.
SQL: | SELECT salary FROM orders AS ord
WHERE salary > (
SELECT MIN(amount) FROM items AS lne
WHERE lne.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07916 | train |
v1 | Schema:
tasks (alias: tsk)(name, code, date, level)
items(name, id, salary, level)
Task: Find value from tasks where level appears in items entries with matching code.
SQL: | SELECT value FROM tasks AS tsk
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "items",
"outer_alias": "tsk",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07917 | train |
v3 | Schema:
schedules (alias: schd)(type, value, level, amount)
categories(salary, id, name, amount)
Task: Find salary from schedules where salary exceeds the minimum salary from categories for the same status.
SQL: | SELECT salary FROM schedules AS schd
WHERE salary > (
SELECT MIN(salary) FROM categories AS catg
WHERE catg.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07918 | train |
v2 | Schema:
tasks (alias: tsk)(level, value, id, code)
employees(name, type, level, status)
Task: Retrieve id from tasks that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "tsk",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07919 | train |
v2 | Schema:
products (alias: prod)(amount, value, date, level)
branches(name, date, status, level)
Task: Retrieve id from products that have at least one corresponding entry in branches sharing the same type.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = prod.type
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07920 | train |
v1 | Schema:
branches (alias: brc)(amount, code, name, salary)
orders(value, salary, amount, code)
Task: Find value from branches where level appears in orders entries with matching status.
SQL: | SELECT value FROM branches AS brc
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07921 | train |
v1 | Schema:
shipments (alias: shp)(status, name, type, amount)
regions(type, value, code, salary)
Task: Retrieve amount from shipments whose status is found in regions rows where type matches the outer record.
SQL: | SELECT amount FROM shipments AS shp
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07922 | train |
v3 | Schema:
shipments (alias: shp)(date, type, status, amount)
branches(level, id, amount, value)
Task: Retrieve amount from shipments with salary above the MAX(amount) of branches rows sharing the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE salary > (
SELECT MAX(amount) FROM branches AS brc
WHERE brc.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07923 | train |
v3 | Schema:
products (alias: prod)(name, salary, value, status)
transactions(value, code, id, level)
Task: Find value from products where amount exceeds the average amount from transactions for the same type.
SQL: | SELECT value FROM products AS prod
WHERE amount > (
SELECT AVG(amount) FROM transactions AS txn
WHERE txn.type = prod.type
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07924 | train |
v3 | Schema:
staff (alias: empl)(code, type, amount, status)
accounts(date, code, value, level)
Task: Retrieve id from staff with salary above the SUM(salary) of accounts rows sharing the same status.
SQL: | SELECT id FROM staff AS empl
WHERE salary > (
SELECT SUM(salary) FROM accounts AS acct
WHERE acct.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07925 | train |
v1 | Schema:
transactions (alias: txn)(name, id, code, date)
customers(status, type, amount, date)
Task: Retrieve name from transactions whose status is found in customers rows where type matches the outer record.
SQL: | SELECT name FROM transactions AS txn
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07926 | train |
v3 | Schema:
items (alias: lne)(value, date, level, status)
tasks(status, id, level, name)
Task: Find amount from items where value exceeds the count of salary from tasks for the same code.
SQL: | SELECT amount FROM items AS lne
WHERE value > (
SELECT COUNT(salary) FROM tasks AS tsk
WHERE tsk.code = lne.code
); | {
"outer_table": "items",
"inner_table": "tasks",
"outer_alias": "lne",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07927 | train |
v2 | Schema:
shipments (alias: shp)(level, status, code, amount)
invoices(status, code, value, amount)
Task: Find code from shipments where a matching record exists in invoices with the same level.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07928 | train |
v1 | Schema:
orders (alias: ord)(value, type, code, status)
items(status, code, salary, value)
Task: Find name from orders where code appears in items entries with matching status.
SQL: | SELECT name FROM orders AS ord
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07929 | train |
v2 | Schema:
categories (alias: catg)(salary, level, amount, name)
managers(level, name, date, value)
Task: Find amount from categories where a matching record exists in managers with the same id.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07930 | train |
v1 | Schema:
items (alias: lne)(name, salary, status, id)
invoices(salary, amount, id, code)
Task: Select amount from items where status exists in invoices for the same code.
SQL: | SELECT amount FROM items AS lne
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.code = lne.code
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07931 | train |
v2 | Schema:
schedules (alias: schd)(date, id, name, status)
categories(salary, status, code, date)
Task: Find code from schedules where a matching record exists in categories with the same status.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07932 | train |
v3 | Schema:
tasks (alias: tsk)(amount, code, status, type)
branches(value, type, id, amount)
Task: Find amount from tasks where amount exceeds the average amount from branches for the same level.
SQL: | SELECT amount FROM tasks AS tsk
WHERE amount > (
SELECT AVG(amount) FROM branches AS brc
WHERE brc.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07933 | train |
v2 | Schema:
shipments (alias: shp)(name, status, date, type)
products(id, value, status, date)
Task: Retrieve value from shipments that have at least one corresponding entry in products sharing the same code.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07934 | train |
v3 | Schema:
accounts (alias: acct)(value, code, level, status)
orders(salary, date, id, status)
Task: Find amount from accounts where amount exceeds the total salary from orders for the same status.
SQL: | SELECT amount FROM accounts AS acct
WHERE amount > (
SELECT SUM(salary) FROM orders AS ord
WHERE ord.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07935 | train |
v3 | Schema:
requests (alias: ordr)(type, name, amount, status)
branches(salary, id, date, status)
Task: Find name from requests where value exceeds the maximum amount from branches for the same type.
SQL: | SELECT name FROM requests AS ordr
WHERE value > (
SELECT MAX(amount) FROM branches AS brc
WHERE brc.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07936 | train |
v1 | Schema:
accounts (alias: acct)(date, level, code, name)
projects(amount, code, id, level)
Task: Find code from accounts where type appears in projects entries with matching code.
SQL: | SELECT code FROM accounts AS acct
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07937 | train |
v3 | Schema:
products (alias: prod)(level, amount, name, status)
departments(level, name, value, amount)
Task: Find id from products where amount exceeds the minimum value from departments for the same code.
SQL: | SELECT id FROM products AS prod
WHERE amount > (
SELECT MIN(value) FROM departments AS dept
WHERE dept.code = prod.code
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07938 | train |
v1 | Schema:
customers (alias: cust)(type, name, value, level)
schedules(type, name, salary, date)
Task: Select salary from customers where level exists in schedules for the same status.
SQL: | SELECT salary FROM customers AS cust
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07939 | train |
v3 | Schema:
customers (alias: cust)(value, code, level, id)
managers(type, id, code, status)
Task: Find value from customers where value exceeds the minimum value from managers for the same id.
SQL: | SELECT value FROM customers AS cust
WHERE value > (
SELECT MIN(value) FROM managers AS mgr
WHERE mgr.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07940 | train |
v3 | Schema:
transactions (alias: txn)(type, id, amount, status)
items(salary, amount, level, name)
Task: Find name from transactions where salary exceeds the maximum value from items for the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE salary > (
SELECT MAX(value) FROM items AS lne
WHERE lne.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07941 | train |
v2 | Schema:
accounts (alias: acct)(name, code, type, id)
branches(amount, type, level, salary)
Task: Retrieve code from accounts that have at least one corresponding entry in branches sharing the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07942 | train |
v1 | Schema:
managers (alias: mgr)(amount, type, name, level)
employees(salary, value, code, status)
Task: Find id from managers where code appears in employees entries with matching status.
SQL: | SELECT id FROM managers AS mgr
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07943 | train |
v1 | Schema:
regions (alias: rgn)(id, level, amount, value)
products(id, status, salary, amount)
Task: Retrieve value from regions whose level is found in products rows where code matches the outer record.
SQL: | SELECT value FROM regions AS rgn
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07944 | train |
v3 | Schema:
accounts (alias: acct)(value, id, amount, name)
staff(id, date, level, amount)
Task: Find code from accounts where amount exceeds the average value from staff for the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE amount > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07945 | train |
v2 | Schema:
regions (alias: rgn)(salary, level, name, type)
schedules(value, status, amount, level)
Task: Find id from regions where a matching record exists in schedules with the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07946 | train |
v2 | Schema:
invoices (alias: inv)(salary, level, amount, status)
transactions(salary, code, id, value)
Task: Retrieve salary from invoices that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07947 | train |
v3 | Schema:
regions (alias: rgn)(status, date, code, id)
transactions(date, name, salary, type)
Task: Find value from regions where salary exceeds the average salary from transactions for the same status.
SQL: | SELECT value FROM regions AS rgn
WHERE salary > (
SELECT AVG(salary) FROM transactions AS txn
WHERE txn.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07948 | train |
v1 | Schema:
branches (alias: brc)(date, level, status, id)
categories(date, id, level, type)
Task: Select code from branches where type exists in categories for the same type.
SQL: | SELECT code FROM branches AS brc
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07949 | train |
v2 | Schema:
sales (alias: sale)(code, level, status, id)
invoices(level, salary, type, date)
Task: Retrieve code from sales that have at least one corresponding entry in invoices sharing the same code.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07950 | train |
v1 | Schema:
products (alias: prod)(amount, salary, status, date)
invoices(level, salary, date, type)
Task: Find id from products where status appears in invoices entries with matching code.
SQL: | SELECT id FROM products AS prod
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.code = prod.code
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07951 | train |
v1 | Schema:
transactions (alias: txn)(status, amount, value, id)
projects(amount, code, level, salary)
Task: Find value from transactions where level appears in projects entries with matching status.
SQL: | SELECT value FROM transactions AS txn
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07952 | train |
v3 | Schema:
orders (alias: ord)(type, salary, id, name)
sales(level, value, name, code)
Task: Retrieve id from orders with salary above the AVG(value) of sales rows sharing the same status.
SQL: | SELECT id FROM orders AS ord
WHERE salary > (
SELECT AVG(value) FROM sales AS sale
WHERE sale.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07953 | train |
v2 | Schema:
transactions (alias: txn)(status, date, salary, id)
customers(id, type, status, amount)
Task: Retrieve name from transactions that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07954 | train |
v2 | Schema:
departments (alias: dept)(amount, code, id, type)
requests(date, amount, code, level)
Task: Retrieve name from departments that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07955 | train |
v1 | Schema:
requests (alias: ordr)(amount, type, code, salary)
accounts(status, amount, code, salary)
Task: Retrieve salary from requests whose code is found in accounts rows where level matches the outer record.
SQL: | SELECT salary FROM requests AS ordr
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07956 | train |
v3 | Schema:
categories (alias: catg)(salary, level, name, id)
transactions(name, salary, level, code)
Task: Find name from categories where amount exceeds the count of amount from transactions for the same type.
SQL: | SELECT name FROM categories AS catg
WHERE amount > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07957 | train |
v3 | Schema:
transactions (alias: txn)(value, date, amount, status)
shipments(amount, id, value, date)
Task: Retrieve name from transactions with amount above the MIN(salary) of shipments rows sharing the same type.
SQL: | SELECT name FROM transactions AS txn
WHERE amount > (
SELECT MIN(salary) FROM shipments AS shp
WHERE shp.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07958 | train |
v3 | Schema:
schedules (alias: schd)(code, type, date, amount)
staff(id, level, value, salary)
Task: Retrieve amount from schedules with value above the SUM(value) of staff rows sharing the same id.
SQL: | SELECT amount FROM schedules AS schd
WHERE value > (
SELECT SUM(value) FROM staff AS empl
WHERE empl.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07959 | train |
v1 | Schema:
sales (alias: sale)(name, code, amount, type)
tasks(value, level, type, amount)
Task: Find salary from sales where id appears in tasks entries with matching status.
SQL: | SELECT salary FROM sales AS sale
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07960 | train |
v1 | Schema:
orders (alias: ord)(type, level, code, value)
employees(code, amount, value, id)
Task: Select value from orders where id exists in employees for the same id.
SQL: | SELECT value FROM orders AS ord
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07961 | train |
v3 | Schema:
projects (alias: prj)(status, amount, id, type)
regions(amount, code, value, type)
Task: Find salary from projects where value exceeds the total amount from regions for the same status.
SQL: | SELECT salary FROM projects AS prj
WHERE value > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07962 | train |
v1 | Schema:
departments (alias: dept)(id, code, name, type)
tasks(code, name, date, value)
Task: Retrieve code from departments whose code is found in tasks rows where status matches the outer record.
SQL: | SELECT code FROM departments AS dept
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07963 | train |
v3 | Schema:
regions (alias: rgn)(code, status, level, type)
accounts(salary, status, type, id)
Task: Retrieve code from regions with amount above the COUNT(value) of accounts rows sharing the same status.
SQL: | SELECT code FROM regions AS rgn
WHERE amount > (
SELECT COUNT(value) FROM accounts AS acct
WHERE acct.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07964 | train |
v3 | Schema:
sales (alias: sale)(value, status, amount, name)
staff(amount, date, salary, name)
Task: Find value from sales where amount exceeds the minimum salary from staff for the same type.
SQL: | SELECT value FROM sales AS sale
WHERE amount > (
SELECT MIN(salary) FROM staff AS empl
WHERE empl.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07965 | train |
v2 | Schema:
departments (alias: dept)(level, amount, date, name)
branches(date, type, level, salary)
Task: Retrieve id from departments that have at least one corresponding entry in branches sharing the same type.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07966 | train |
v2 | Schema:
staff (alias: empl)(code, salary, value, level)
transactions(name, amount, level, value)
Task: Retrieve code from staff that have at least one corresponding entry in transactions sharing the same code.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07967 | train |
v1 | Schema:
projects (alias: prj)(value, id, code, name)
managers(name, id, status, amount)
Task: Retrieve amount from projects whose code is found in managers rows where level matches the outer record.
SQL: | SELECT amount FROM projects AS prj
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07968 | train |
v2 | Schema:
invoices (alias: inv)(id, code, amount, value)
accounts(date, name, amount, status)
Task: Retrieve salary from invoices that have at least one corresponding entry in accounts sharing the same type.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07969 | train |
v1 | Schema:
categories (alias: catg)(name, type, code, value)
departments(amount, level, id, name)
Task: Select id from categories where status exists in departments for the same level.
SQL: | SELECT id FROM categories AS catg
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07970 | train |
v3 | Schema:
departments (alias: dept)(type, code, date, level)
managers(date, level, salary, code)
Task: Retrieve value from departments with salary above the AVG(amount) of managers rows sharing the same type.
SQL: | SELECT value FROM departments AS dept
WHERE salary > (
SELECT AVG(amount) FROM managers AS mgr
WHERE mgr.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07971 | train |
v1 | Schema:
projects (alias: prj)(salary, type, id, date)
invoices(status, level, value, date)
Task: Find id from projects where code appears in invoices entries with matching level.
SQL: | SELECT id FROM projects AS prj
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07972 | train |
v1 | Schema:
staff (alias: empl)(salary, date, name, value)
requests(level, code, type, id)
Task: Retrieve value from staff whose level is found in requests rows where code matches the outer record.
SQL: | SELECT value FROM staff AS empl
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07973 | train |
v3 | Schema:
tasks (alias: tsk)(amount, status, type, name)
shipments(date, value, name, salary)
Task: Find amount from tasks where amount exceeds the maximum value from shipments for the same status.
SQL: | SELECT amount FROM tasks AS tsk
WHERE amount > (
SELECT MAX(value) FROM shipments AS shp
WHERE shp.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07974 | train |
v1 | Schema:
managers (alias: mgr)(status, amount, name, level)
projects(level, type, id, code)
Task: Select amount from managers where status exists in projects for the same level.
SQL: | SELECT amount FROM managers AS mgr
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07975 | train |
v2 | Schema:
branches (alias: brc)(salary, amount, level, id)
schedules(value, type, name, amount)
Task: Retrieve name from branches that have at least one corresponding entry in schedules sharing the same level.
SQL: | SELECT name FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "schedules",
"outer_alias": "brc",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07976 | train |
v1 | Schema:
items (alias: lne)(salary, type, date, value)
projects(id, value, salary, level)
Task: Select value from items where id exists in projects for the same type.
SQL: | SELECT value FROM items AS lne
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.type = lne.type
); | {
"outer_table": "items",
"inner_table": "projects",
"outer_alias": "lne",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07977 | train |
v3 | Schema:
items (alias: lne)(type, amount, date, salary)
departments(type, status, level, code)
Task: Find id from items where salary exceeds the minimum amount from departments for the same level.
SQL: | SELECT id FROM items AS lne
WHERE salary > (
SELECT MIN(amount) FROM departments AS dept
WHERE dept.level = lne.level
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07978 | train |
v3 | Schema:
requests (alias: ordr)(amount, code, value, id)
accounts(code, amount, type, level)
Task: Find amount from requests where value exceeds the count of salary from accounts for the same type.
SQL: | SELECT amount FROM requests AS ordr
WHERE value > (
SELECT COUNT(salary) FROM accounts AS acct
WHERE acct.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07979 | train |
v1 | Schema:
employees (alias: emp)(salary, name, value, status)
tasks(type, date, name, code)
Task: Retrieve id from employees whose code is found in tasks rows where code matches the outer record.
SQL: | SELECT id FROM employees AS emp
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07980 | train |
v1 | Schema:
categories (alias: catg)(code, status, amount, value)
accounts(level, date, amount, code)
Task: Retrieve amount from categories whose status is found in accounts rows where id matches the outer record.
SQL: | SELECT amount FROM categories AS catg
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07981 | train |
v1 | Schema:
requests (alias: ordr)(value, level, status, code)
tasks(status, level, salary, code)
Task: Select name from requests where level exists in tasks for the same level.
SQL: | SELECT name FROM requests AS ordr
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07982 | train |
v3 | Schema:
customers (alias: cust)(id, amount, level, date)
invoices(id, status, salary, date)
Task: Find code from customers where amount exceeds the maximum amount from invoices for the same status.
SQL: | SELECT code FROM customers AS cust
WHERE amount > (
SELECT MAX(amount) 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": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07983 | train |
v2 | Schema:
departments (alias: dept)(id, code, date, salary)
accounts(salary, amount, status, id)
Task: Find code from departments where a matching record exists in accounts with the same level.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07984 | train |
v3 | Schema:
projects (alias: prj)(name, salary, amount, date)
accounts(code, status, salary, amount)
Task: Find amount from projects where salary exceeds the maximum amount from accounts for the same id.
SQL: | SELECT amount FROM projects AS prj
WHERE salary > (
SELECT MAX(amount) FROM accounts AS acct
WHERE acct.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07985 | train |
v2 | Schema:
branches (alias: brc)(amount, salary, status, id)
projects(id, name, code, level)
Task: Retrieve amount from branches that have at least one corresponding entry in projects sharing the same code.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07986 | train |
v1 | Schema:
regions (alias: rgn)(date, name, salary, amount)
schedules(value, name, amount, status)
Task: Retrieve code from regions whose type is found in schedules rows where level matches the outer record.
SQL: | SELECT code FROM regions AS rgn
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07987 | train |
v2 | Schema:
staff (alias: empl)(level, date, id, amount)
sales(name, value, status, type)
Task: Find name from staff where a matching record exists in sales with the same level.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07988 | train |
v3 | Schema:
tasks (alias: tsk)(status, value, date, id)
transactions(date, salary, level, code)
Task: Find value from tasks where salary exceeds the maximum value from transactions for the same type.
SQL: | SELECT value FROM tasks AS tsk
WHERE salary > (
SELECT MAX(value) FROM transactions AS txn
WHERE txn.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07989 | train |
v1 | Schema:
managers (alias: mgr)(status, value, name, salary)
branches(code, salary, amount, name)
Task: Find name from managers where id appears in branches entries with matching status.
SQL: | SELECT name FROM managers AS mgr
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07990 | train |
v3 | Schema:
employees (alias: emp)(amount, name, value, status)
transactions(code, name, status, value)
Task: Find name from employees where amount exceeds the average salary from transactions for the same code.
SQL: | SELECT name FROM employees AS emp
WHERE amount > (
SELECT AVG(salary) FROM transactions AS txn
WHERE txn.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07991 | train |
v2 | Schema:
products (alias: prod)(date, amount, level, salary)
requests(salary, code, id, type)
Task: Retrieve amount from products that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = prod.code
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07992 | train |
v3 | Schema:
transactions (alias: txn)(value, status, code, level)
items(amount, status, value, id)
Task: Retrieve value from transactions with amount above the COUNT(salary) of items rows sharing the same code.
SQL: | SELECT value FROM transactions AS txn
WHERE amount > (
SELECT COUNT(salary) FROM items AS lne
WHERE lne.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07993 | train |
v2 | Schema:
employees (alias: emp)(value, salary, level, date)
shipments(level, type, name, code)
Task: Retrieve name from employees that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07994 | train |
v2 | Schema:
managers (alias: mgr)(value, id, type, status)
branches(level, value, id, status)
Task: Find name from managers where a matching record exists in branches with the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07995 | train |
v3 | Schema:
orders (alias: ord)(id, status, salary, level)
shipments(amount, salary, level, code)
Task: Retrieve id from orders with salary above the COUNT(amount) of shipments rows sharing the same id.
SQL: | SELECT id FROM orders AS ord
WHERE salary > (
SELECT COUNT(amount) FROM shipments AS shp
WHERE shp.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07996 | train |
v1 | Schema:
projects (alias: prj)(level, date, amount, code)
tasks(id, code, status, salary)
Task: Find value from projects where level appears in tasks entries with matching level.
SQL: | SELECT value FROM projects AS prj
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "prj",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07997 | train |
v2 | Schema:
branches (alias: brc)(level, salary, status, name)
items(salary, type, id, level)
Task: Retrieve amount from branches that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07998 | train |
v2 | Schema:
orders (alias: ord)(value, level, name, id)
shipments(type, salary, code, amount)
Task: Retrieve name from orders that have at least one corresponding entry in shipments sharing the same status.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07999 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.