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:
projects (alias: prj)(type, salary, date, status)
branches(amount, status, value, level)
Task: Retrieve amount from projects that have at least one corresponding entry in branches sharing the same code.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_09600 | train |
v3 | Schema:
schedules (alias: schd)(name, value, code, salary)
staff(code, date, status, level)
Task: Find name from schedules where amount exceeds the total value from staff for the same code.
SQL: | SELECT name FROM schedules AS schd
WHERE amount > (
SELECT SUM(value) FROM staff AS empl
WHERE empl.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09601 | train |
v2 | Schema:
employees (alias: emp)(id, value, name, level)
shipments(level, amount, id, type)
Task: Find name from employees where a matching record exists in shipments with the same type.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09602 | train |
v3 | Schema:
transactions (alias: txn)(date, value, level, id)
staff(code, salary, status, date)
Task: Find amount from transactions where salary exceeds the average amount from staff for the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE salary > (
SELECT AVG(amount) FROM staff AS empl
WHERE empl.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09603 | train |
v3 | Schema:
shipments (alias: shp)(salary, status, value, level)
managers(status, salary, name, id)
Task: Retrieve id from shipments with value above the SUM(value) of managers rows sharing the same status.
SQL: | SELECT id FROM shipments AS shp
WHERE value > (
SELECT SUM(value) FROM managers AS mgr
WHERE mgr.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09604 | train |
v3 | Schema:
accounts (alias: acct)(level, date, value, id)
employees(name, id, level, salary)
Task: Find id from accounts where value exceeds the count of salary from employees for the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE value > (
SELECT COUNT(salary) FROM employees AS emp
WHERE emp.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09605 | train |
v1 | Schema:
products (alias: prod)(type, value, status, date)
employees(value, code, salary, id)
Task: Retrieve name from products whose code is found in employees rows where code matches the outer record.
SQL: | SELECT name FROM products AS prod
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.code = prod.code
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09606 | train |
v3 | Schema:
schedules (alias: schd)(type, id, status, amount)
regions(amount, type, name, code)
Task: Find amount from schedules where amount exceeds the total amount from regions for the same level.
SQL: | SELECT amount FROM schedules AS schd
WHERE amount > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09607 | train |
v3 | Schema:
regions (alias: rgn)(id, code, date, name)
departments(id, amount, status, code)
Task: Find salary from regions where salary exceeds the total amount from departments for the same code.
SQL: | SELECT salary FROM regions AS rgn
WHERE salary > (
SELECT SUM(amount) FROM departments AS dept
WHERE dept.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_09608 | train |
v2 | Schema:
invoices (alias: inv)(id, date, amount, value)
customers(status, salary, date, type)
Task: Retrieve salary from invoices that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09609 | train |
v2 | Schema:
managers (alias: mgr)(level, amount, name, code)
branches(id, name, status, salary)
Task: Find name from managers where a matching record exists in branches with the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09610 | train |
v3 | Schema:
orders (alias: ord)(value, date, level, code)
shipments(name, status, date, salary)
Task: Retrieve code from orders with value above the COUNT(amount) of shipments rows sharing the same level.
SQL: | SELECT code FROM orders AS ord
WHERE value > (
SELECT COUNT(amount) FROM shipments AS shp
WHERE shp.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09611 | train |
v1 | Schema:
sales (alias: sale)(salary, date, amount, id)
transactions(date, salary, level, value)
Task: Find value from sales where code appears in transactions entries with matching id.
SQL: | SELECT value FROM sales AS sale
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09612 | train |
v3 | Schema:
accounts (alias: acct)(salary, status, amount, type)
schedules(status, code, salary, name)
Task: Retrieve id from accounts with salary above the MIN(amount) of schedules rows sharing the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE salary > (
SELECT MIN(amount) FROM schedules AS schd
WHERE schd.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09613 | train |
v1 | Schema:
transactions (alias: txn)(date, id, name, type)
managers(name, id, date, amount)
Task: Retrieve value from transactions whose code is found in managers rows where level matches the outer record.
SQL: | SELECT value FROM transactions AS txn
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09614 | train |
v3 | Schema:
requests (alias: ordr)(code, value, type, status)
accounts(name, value, code, status)
Task: Retrieve amount from requests with value above the SUM(value) of accounts rows sharing the same status.
SQL: | SELECT amount FROM requests AS ordr
WHERE value > (
SELECT SUM(value) FROM accounts AS acct
WHERE acct.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_09615 | train |
v3 | Schema:
shipments (alias: shp)(value, date, salary, level)
requests(date, code, id, name)
Task: Find id from shipments where value exceeds the maximum amount from requests for the same id.
SQL: | SELECT id FROM shipments AS shp
WHERE value > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09616 | train |
v1 | Schema:
categories (alias: catg)(name, level, status, id)
orders(status, type, value, salary)
Task: Find id from categories where code appears in orders entries with matching type.
SQL: | SELECT id FROM categories AS catg
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09617 | train |
v2 | Schema:
employees (alias: emp)(code, value, date, type)
accounts(type, name, salary, level)
Task: Find id from employees where a matching record exists in accounts with the same status.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09618 | train |
v2 | Schema:
invoices (alias: inv)(date, type, salary, name)
categories(salary, date, code, level)
Task: Retrieve amount from invoices that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09619 | train |
v2 | Schema:
branches (alias: brc)(salary, status, id, date)
projects(id, date, type, status)
Task: Find id from branches where a matching record exists in projects with the same code.
SQL: | SELECT id 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": "id",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_09620 | train |
v2 | Schema:
managers (alias: mgr)(code, date, value, name)
employees(level, code, amount, salary)
Task: Retrieve value from managers that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09621 | train |
v3 | Schema:
customers (alias: cust)(status, amount, type, salary)
orders(id, type, amount, salary)
Task: Retrieve amount from customers with salary above the AVG(amount) of orders rows sharing the same level.
SQL: | SELECT amount FROM customers AS cust
WHERE salary > (
SELECT AVG(amount) FROM orders AS ord
WHERE ord.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09622 | train |
v2 | Schema:
branches (alias: brc)(id, code, date, name)
transactions(value, date, id, salary)
Task: Retrieve amount from branches that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "transactions",
"outer_alias": "brc",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_09623 | train |
v2 | Schema:
departments (alias: dept)(level, name, amount, value)
orders(code, type, name, id)
Task: Retrieve name from departments that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09624 | train |
v1 | Schema:
sales (alias: sale)(salary, code, amount, level)
tasks(status, code, id, salary)
Task: Retrieve value from sales whose level is found in tasks rows where id matches the outer record.
SQL: | SELECT value FROM sales AS sale
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09625 | train |
v2 | Schema:
managers (alias: mgr)(level, value, id, date)
tasks(amount, salary, status, code)
Task: Find amount from managers where a matching record exists in tasks with the same type.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09626 | train |
v2 | Schema:
projects (alias: prj)(amount, value, status, type)
categories(date, type, status, amount)
Task: Find code from projects where a matching record exists in categories with the same type.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_09627 | train |
v1 | Schema:
shipments (alias: shp)(date, status, id, value)
sales(date, code, level, salary)
Task: Retrieve id from shipments whose type is found in sales rows where id matches the outer record.
SQL: | SELECT id FROM shipments AS shp
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09628 | train |
v2 | Schema:
schedules (alias: schd)(date, status, code, salary)
projects(level, value, amount, status)
Task: Find name from schedules where a matching record exists in projects with the same id.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09629 | train |
v1 | Schema:
sales (alias: sale)(code, amount, type, status)
transactions(date, status, salary, name)
Task: Find value from sales where status appears in transactions entries with matching type.
SQL: | SELECT value FROM sales AS sale
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09630 | train |
v2 | Schema:
requests (alias: ordr)(level, id, date, amount)
tasks(name, status, level, code)
Task: Retrieve amount from requests that have at least one corresponding entry in tasks sharing the same code.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_09631 | train |
v2 | Schema:
categories (alias: catg)(value, name, type, salary)
customers(level, id, code, date)
Task: Find name from categories where a matching record exists in customers with the same code.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09632 | train |
v3 | Schema:
projects (alias: prj)(date, id, status, name)
items(id, value, level, code)
Task: Retrieve id from projects with value above the MAX(amount) of items rows sharing the same id.
SQL: | SELECT id FROM projects AS prj
WHERE value > (
SELECT MAX(amount) FROM items AS lne
WHERE lne.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_09633 | train |
v2 | Schema:
products (alias: prod)(date, level, amount, value)
categories(status, value, date, code)
Task: Retrieve name from products that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = prod.type
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09634 | train |
v1 | Schema:
products (alias: prod)(type, code, name, date)
employees(level, status, name, type)
Task: Select salary from products where type exists in employees for the same code.
SQL: | SELECT salary FROM products AS prod
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.code = prod.code
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09635 | train |
v1 | Schema:
requests (alias: ordr)(id, amount, type, date)
tasks(status, id, code, amount)
Task: Retrieve id from requests whose code is found in tasks rows where type matches the outer record.
SQL: | SELECT id FROM requests AS ordr
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_09636 | train |
v3 | Schema:
tasks (alias: tsk)(salary, status, name, amount)
staff(date, name, type, id)
Task: Find name from tasks where salary exceeds the count of amount from staff for the same status.
SQL: | SELECT name FROM tasks AS tsk
WHERE salary > (
SELECT COUNT(amount) FROM staff AS empl
WHERE empl.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "staff",
"outer_alias": "tsk",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_09637 | train |
v2 | Schema:
categories (alias: catg)(id, name, type, status)
employees(id, level, salary, name)
Task: Retrieve value from categories that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09638 | train |
v1 | Schema:
products (alias: prod)(type, code, level, name)
accounts(value, level, amount, salary)
Task: Retrieve salary from products whose level is found in accounts rows where level matches the outer record.
SQL: | SELECT salary FROM products AS prod
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.level = prod.level
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09639 | train |
v3 | Schema:
accounts (alias: acct)(level, salary, date, name)
employees(value, level, code, type)
Task: Find id from accounts where salary exceeds the total amount from employees for the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE salary > (
SELECT SUM(amount) FROM employees AS emp
WHERE emp.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09640 | train |
v3 | Schema:
employees (alias: emp)(level, name, salary, type)
requests(value, status, type, salary)
Task: Find amount from employees where salary exceeds the maximum value from requests for the same id.
SQL: | SELECT amount FROM employees AS emp
WHERE salary > (
SELECT MAX(value) FROM requests AS ordr
WHERE ordr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09641 | train |
v2 | Schema:
branches (alias: brc)(code, id, value, level)
projects(amount, type, value, salary)
Task: Retrieve salary from branches that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_09642 | train |
v2 | Schema:
transactions (alias: txn)(code, value, amount, date)
orders(level, status, amount, code)
Task: Find amount from transactions where a matching record exists in orders with the same type.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09643 | train |
v2 | Schema:
employees (alias: emp)(type, date, value, code)
items(id, status, code, name)
Task: Retrieve name from employees that have at least one corresponding entry in items sharing the same status.
SQL: | SELECT name 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": "name",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09644 | train |
v3 | Schema:
customers (alias: cust)(date, amount, type, level)
orders(salary, id, status, value)
Task: Retrieve value from customers with value above the AVG(amount) of orders rows sharing the same code.
SQL: | SELECT value FROM customers AS cust
WHERE value > (
SELECT AVG(amount) FROM orders AS ord
WHERE ord.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09645 | train |
v1 | Schema:
items (alias: lne)(salary, level, type, date)
shipments(status, code, name, date)
Task: Find id from items where level appears in shipments entries with matching code.
SQL: | SELECT id FROM items AS lne
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.code = lne.code
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_09646 | train |
v2 | Schema:
schedules (alias: schd)(amount, id, name, type)
tasks(id, code, amount, name)
Task: Find value from schedules where a matching record exists in tasks with the same status.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09647 | train |
v3 | Schema:
transactions (alias: txn)(id, status, salary, value)
branches(date, id, level, value)
Task: Retrieve code from transactions with salary above the MIN(value) of branches rows sharing the same id.
SQL: | SELECT code FROM transactions AS txn
WHERE salary > (
SELECT MIN(value) FROM branches AS brc
WHERE brc.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09648 | train |
v3 | Schema:
categories (alias: catg)(code, value, salary, id)
sales(type, salary, name, status)
Task: Retrieve id from categories with value above the MIN(salary) of sales rows sharing the same id.
SQL: | SELECT id FROM categories AS catg
WHERE value > (
SELECT MIN(salary) FROM sales AS sale
WHERE sale.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09649 | train |
v3 | Schema:
schedules (alias: schd)(value, name, amount, date)
projects(salary, status, id, code)
Task: Retrieve amount from schedules with salary above the MAX(value) of projects rows sharing the same code.
SQL: | SELECT amount FROM schedules AS schd
WHERE salary > (
SELECT MAX(value) FROM projects AS prj
WHERE prj.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09650 | train |
v2 | Schema:
staff (alias: empl)(amount, status, salary, name)
managers(amount, value, salary, name)
Task: Retrieve amount from staff that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_09651 | train |
v2 | Schema:
invoices (alias: inv)(name, id, status, type)
items(code, date, name, status)
Task: Find amount from invoices where a matching record exists in items with the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09652 | train |
v1 | Schema:
branches (alias: brc)(value, salary, type, amount)
sales(amount, status, name, code)
Task: Retrieve value from branches whose status is found in sales rows where level matches the outer record.
SQL: | SELECT value FROM branches AS brc
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_09653 | train |
v3 | Schema:
accounts (alias: acct)(level, status, value, id)
shipments(name, status, type, id)
Task: Retrieve salary from accounts with amount above the MAX(salary) of shipments rows sharing the same id.
SQL: | SELECT salary FROM accounts AS acct
WHERE amount > (
SELECT MAX(salary) FROM shipments AS shp
WHERE shp.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09654 | train |
v1 | Schema:
employees (alias: emp)(date, amount, name, code)
regions(status, type, date, salary)
Task: Select amount from employees where status exists in regions for the same status.
SQL: | SELECT amount FROM employees AS emp
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09655 | train |
v2 | Schema:
transactions (alias: txn)(value, status, type, code)
products(type, date, salary, name)
Task: Retrieve salary from transactions that have at least one corresponding entry in products sharing the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09656 | train |
v2 | Schema:
departments (alias: dept)(date, id, code, level)
managers(value, salary, level, name)
Task: Retrieve name from departments that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09657 | train |
v2 | Schema:
employees (alias: emp)(type, id, status, amount)
tasks(id, salary, amount, level)
Task: Retrieve name from employees that have at least one corresponding entry in tasks sharing the same code.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09658 | train |
v1 | Schema:
branches (alias: brc)(name, amount, salary, level)
employees(level, salary, id, code)
Task: Select id from branches where id exists in employees for the same status.
SQL: | SELECT id FROM branches AS brc
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_09659 | train |
v2 | Schema:
regions (alias: rgn)(code, id, name, date)
orders(code, status, id, date)
Task: Retrieve amount from regions that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_09660 | train |
v3 | Schema:
departments (alias: dept)(name, type, level, id)
requests(date, value, level, type)
Task: Retrieve name from departments with salary above the MAX(value) of requests rows sharing the same level.
SQL: | SELECT name FROM departments AS dept
WHERE salary > (
SELECT MAX(value) FROM requests AS ordr
WHERE ordr.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09661 | train |
v3 | Schema:
customers (alias: cust)(amount, level, date, code)
projects(name, salary, status, date)
Task: Retrieve id from customers with salary above the COUNT(value) of projects rows sharing the same type.
SQL: | SELECT id FROM customers AS cust
WHERE salary > (
SELECT COUNT(value) FROM projects AS prj
WHERE prj.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09662 | train |
v3 | Schema:
staff (alias: empl)(salary, value, id, amount)
tasks(type, status, value, name)
Task: Find code from staff where value exceeds the average amount from tasks for the same type.
SQL: | SELECT code FROM staff AS empl
WHERE value > (
SELECT AVG(amount) FROM tasks AS tsk
WHERE tsk.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_09663 | train |
v1 | Schema:
departments (alias: dept)(salary, status, value, type)
tasks(salary, id, value, amount)
Task: Retrieve name from departments whose code is found in tasks rows where status matches the outer record.
SQL: | SELECT name 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": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09664 | train |
v2 | Schema:
transactions (alias: txn)(type, amount, status, level)
sales(status, salary, date, amount)
Task: Find amount from transactions where a matching record exists in sales with the same type.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09665 | train |
v1 | Schema:
shipments (alias: shp)(amount, name, id, value)
transactions(code, value, status, type)
Task: Retrieve amount from shipments whose id is found in transactions rows where type matches the outer record.
SQL: | SELECT amount FROM shipments AS shp
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09666 | train |
v2 | Schema:
staff (alias: empl)(date, salary, name, status)
accounts(value, amount, code, salary)
Task: Retrieve id from staff that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_09667 | train |
v1 | Schema:
branches (alias: brc)(salary, value, id, amount)
products(status, amount, level, salary)
Task: Retrieve code from branches whose code is found in products rows where status matches the outer record.
SQL: | SELECT code FROM branches AS brc
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_09668 | train |
v3 | Schema:
branches (alias: brc)(date, amount, code, type)
categories(amount, value, status, salary)
Task: Find id from branches where salary exceeds the total value from categories for the same level.
SQL: | SELECT id FROM branches AS brc
WHERE salary > (
SELECT SUM(value) FROM categories AS catg
WHERE catg.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"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_09669 | train |
v1 | Schema:
orders (alias: ord)(amount, level, code, date)
branches(name, salary, id, value)
Task: Find salary from orders where level appears in branches entries with matching status.
SQL: | SELECT salary FROM orders AS ord
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09670 | train |
v1 | Schema:
customers (alias: cust)(status, value, name, type)
projects(id, name, date, code)
Task: Retrieve value from customers whose id is found in projects rows where id matches the outer record.
SQL: | SELECT value FROM customers AS cust
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09671 | train |
v1 | Schema:
departments (alias: dept)(type, level, salary, value)
regions(code, salary, amount, status)
Task: Retrieve id from departments whose level is found in regions rows where level matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09672 | train |
v3 | Schema:
categories (alias: catg)(level, amount, status, value)
sales(level, value, name, code)
Task: Find id from categories where salary exceeds the count of salary from sales for the same id.
SQL: | SELECT id FROM categories AS catg
WHERE salary > (
SELECT COUNT(salary) FROM sales AS sale
WHERE sale.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09673 | train |
v2 | Schema:
orders (alias: ord)(status, code, name, amount)
invoices(name, value, id, status)
Task: Retrieve name from orders that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09674 | train |
v2 | Schema:
invoices (alias: inv)(value, id, date, name)
categories(code, status, level, date)
Task: Retrieve value from invoices that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09675 | train |
v2 | Schema:
schedules (alias: schd)(salary, name, level, id)
invoices(level, name, salary, value)
Task: Retrieve salary from schedules that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09676 | train |
v2 | Schema:
accounts (alias: acct)(name, value, date, salary)
invoices(type, level, value, status)
Task: Retrieve code from accounts that have at least one corresponding entry in invoices sharing the same id.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09677 | train |
v3 | Schema:
items (alias: lne)(value, amount, salary, type)
branches(amount, type, value, name)
Task: Retrieve id from items with value above the MIN(value) of branches rows sharing the same id.
SQL: | SELECT id FROM items AS lne
WHERE value > (
SELECT MIN(value) FROM branches AS brc
WHERE brc.id = lne.id
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_09678 | train |
v1 | Schema:
items (alias: lne)(id, status, amount, value)
sales(id, type, value, code)
Task: Retrieve amount from items whose code is found in sales rows where level matches the outer record.
SQL: | SELECT amount FROM items AS lne
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.level = lne.level
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_09679 | train |
v1 | Schema:
accounts (alias: acct)(code, id, type, salary)
branches(amount, salary, id, status)
Task: Retrieve amount from accounts whose code is found in branches rows where id matches the outer record.
SQL: | SELECT amount FROM accounts AS acct
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09680 | train |
v1 | Schema:
orders (alias: ord)(date, type, id, amount)
sales(name, code, level, amount)
Task: Select name from orders where status exists in sales for the same id.
SQL: | SELECT name FROM orders AS ord
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09681 | train |
v3 | Schema:
regions (alias: rgn)(name, date, code, id)
items(type, status, name, id)
Task: Find value from regions where value exceeds the maximum salary from items for the same status.
SQL: | SELECT value FROM regions AS rgn
WHERE value > (
SELECT MAX(salary) FROM items AS lne
WHERE lne.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_09682 | train |
v1 | Schema:
departments (alias: dept)(date, id, code, amount)
items(level, salary, status, amount)
Task: Find id from departments where code appears in items entries with matching type.
SQL: | SELECT id FROM departments AS dept
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09683 | train |
v2 | Schema:
departments (alias: dept)(id, value, type, salary)
employees(status, type, value, salary)
Task: Retrieve amount from departments that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09684 | train |
v2 | Schema:
managers (alias: mgr)(level, code, name, id)
employees(value, amount, id, date)
Task: Retrieve code from managers that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09685 | train |
v1 | Schema:
transactions (alias: txn)(type, date, code, salary)
staff(salary, name, status, level)
Task: Find name from transactions where id appears in staff entries with matching type.
SQL: | SELECT name FROM transactions AS txn
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09686 | train |
v2 | Schema:
transactions (alias: txn)(type, salary, level, amount)
shipments(value, date, level, status)
Task: Find id from transactions where a matching record exists in shipments with the same level.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09687 | train |
v3 | Schema:
products (alias: prod)(date, amount, type, value)
requests(code, amount, date, id)
Task: Find id from products where salary exceeds the average value from requests for the same code.
SQL: | SELECT id FROM products AS prod
WHERE salary > (
SELECT AVG(value) FROM requests AS ordr
WHERE ordr.code = prod.code
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09688 | train |
v1 | Schema:
categories (alias: catg)(level, id, date, type)
regions(level, amount, date, status)
Task: Find code from categories where type appears in regions entries with matching status.
SQL: | SELECT code FROM categories AS catg
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09689 | train |
v1 | Schema:
regions (alias: rgn)(id, date, value, level)
customers(type, date, value, level)
Task: Select amount from regions where type exists in customers for the same status.
SQL: | SELECT amount FROM regions AS rgn
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_09690 | train |
v3 | Schema:
invoices (alias: inv)(date, name, salary, status)
transactions(type, date, id, value)
Task: Find code from invoices where salary exceeds the count of salary from transactions for the same code.
SQL: | SELECT code FROM invoices AS inv
WHERE salary > (
SELECT COUNT(salary) FROM transactions AS txn
WHERE txn.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09691 | train |
v3 | Schema:
categories (alias: catg)(id, status, salary, type)
schedules(id, amount, code, name)
Task: Retrieve id from categories with salary above the MIN(value) of schedules rows sharing the same id.
SQL: | SELECT id FROM categories AS catg
WHERE salary > (
SELECT MIN(value) FROM schedules AS schd
WHERE schd.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09692 | train |
v2 | Schema:
accounts (alias: acct)(date, value, salary, id)
regions(id, amount, value, level)
Task: Retrieve id from accounts that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09693 | train |
v2 | Schema:
tasks (alias: tsk)(id, value, code, amount)
departments(status, type, id, level)
Task: Find salary from tasks where a matching record exists in departments with the same level.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "tsk",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_09694 | train |
v3 | Schema:
orders (alias: ord)(status, amount, value, date)
invoices(level, salary, type, name)
Task: Find id from orders where amount exceeds the minimum amount from invoices for the same type.
SQL: | SELECT id FROM orders AS ord
WHERE amount > (
SELECT MIN(amount) FROM invoices AS inv
WHERE inv.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09695 | train |
v1 | Schema:
items (alias: lne)(name, code, salary, type)
regions(level, code, status, name)
Task: Select salary from items where status exists in regions for the same code.
SQL: | SELECT salary FROM items AS lne
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.code = lne.code
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_09696 | train |
v2 | Schema:
schedules (alias: schd)(type, id, code, value)
staff(type, date, level, name)
Task: Find id from schedules where a matching record exists in staff with the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09697 | train |
v1 | Schema:
branches (alias: brc)(type, level, code, date)
products(salary, status, id, date)
Task: Retrieve value from branches whose level is found in products rows where id matches the outer record.
SQL: | SELECT value FROM branches AS brc
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_09698 | train |
v3 | Schema:
requests (alias: ordr)(salary, id, date, status)
employees(type, level, name, salary)
Task: Retrieve name from requests with salary above the AVG(amount) of employees rows sharing the same code.
SQL: | SELECT name FROM requests AS ordr
WHERE salary > (
SELECT AVG(amount) FROM employees AS emp
WHERE emp.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_09699 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.