variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v1 | Schema:
branches (alias: brc)(name, code, type, date)
items(name, type, id, salary)
Task: Find value from branches where id appears in items entries with matching code.
SQL: | SELECT value FROM branches AS brc
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01700 | train |
v1 | Schema:
projects (alias: prj)(level, salary, date, value)
invoices(value, date, type, id)
Task: Retrieve value from projects whose status is found in invoices rows where code matches the outer record.
SQL: | SELECT value FROM projects AS prj
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01701 | train |
v3 | Schema:
employees (alias: emp)(status, value, amount, type)
invoices(name, amount, type, date)
Task: Retrieve id from employees with amount above the MAX(amount) of invoices rows sharing the same status.
SQL: | SELECT id FROM employees AS emp
WHERE amount > (
SELECT MAX(amount) FROM invoices AS inv
WHERE inv.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01702 | train |
v2 | Schema:
invoices (alias: inv)(name, type, value, status)
sales(id, type, salary, value)
Task: Find value from invoices where a matching record exists in sales with the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01703 | train |
v2 | Schema:
products (alias: prod)(code, salary, id, status)
transactions(type, level, amount, value)
Task: Retrieve amount from products that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = prod.level
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01704 | train |
v2 | Schema:
schedules (alias: schd)(salary, status, amount, level)
projects(level, date, amount, salary)
Task: Retrieve name from schedules that have at least one corresponding entry in projects sharing 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_01705 | train |
v3 | Schema:
regions (alias: rgn)(amount, code, date, name)
requests(code, type, salary, name)
Task: Find code from regions where salary exceeds the average amount from requests for the same status.
SQL: | SELECT code FROM regions AS rgn
WHERE salary > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_01706 | train |
v1 | Schema:
regions (alias: rgn)(value, id, status, date)
staff(name, type, salary, level)
Task: Find amount from regions where code appears in staff entries with matching status.
SQL: | SELECT amount FROM regions AS rgn
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_01707 | train |
v2 | Schema:
accounts (alias: acct)(date, status, amount, type)
tasks(id, salary, date, code)
Task: Find value from accounts where a matching record exists in tasks with the same code.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01708 | train |
v2 | Schema:
managers (alias: mgr)(status, name, date, amount)
departments(date, value, amount, name)
Task: Retrieve salary from managers that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01709 | train |
v3 | Schema:
employees (alias: emp)(code, level, name, amount)
transactions(salary, amount, id, date)
Task: Find amount from employees where salary exceeds the average salary from transactions for the same code.
SQL: | SELECT amount FROM employees AS emp
WHERE salary > (
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": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01710 | train |
v2 | Schema:
shipments (alias: shp)(type, amount, name, id)
projects(type, status, level, salary)
Task: Find id from shipments where a matching record exists in projects with the same status.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01711 | train |
v2 | Schema:
invoices (alias: inv)(id, salary, level, type)
shipments(date, id, name, type)
Task: Find amount from invoices where a matching record exists in shipments with the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01712 | train |
v2 | Schema:
transactions (alias: txn)(type, name, code, date)
accounts(salary, date, level, name)
Task: Retrieve value from transactions that have at least one corresponding entry in accounts sharing the same type.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01713 | train |
v2 | Schema:
items (alias: lne)(date, name, amount, level)
invoices(status, amount, code, salary)
Task: Retrieve salary from items that have at least one corresponding entry in invoices sharing the same id.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = lne.id
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01714 | train |
v1 | Schema:
customers (alias: cust)(salary, status, value, id)
departments(salary, value, level, id)
Task: Retrieve id from customers whose level is found in departments rows where code matches the outer record.
SQL: | SELECT id FROM customers AS cust
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01715 | train |
v1 | Schema:
sales (alias: sale)(code, value, status, amount)
departments(code, status, amount, name)
Task: Find salary from sales where code appears in departments entries with matching type.
SQL: | SELECT salary FROM sales AS sale
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01716 | train |
v1 | Schema:
schedules (alias: schd)(amount, status, salary, type)
sales(amount, id, status, type)
Task: Select id from schedules where id exists in sales for the same type.
SQL: | SELECT id FROM schedules AS schd
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01717 | train |
v3 | Schema:
departments (alias: dept)(id, date, level, salary)
requests(id, status, level, amount)
Task: Find name from departments where amount exceeds the count of salary from requests for the same status.
SQL: | SELECT name FROM departments AS dept
WHERE amount > (
SELECT COUNT(salary) FROM requests AS ordr
WHERE ordr.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01718 | train |
v2 | Schema:
employees (alias: emp)(value, level, id, salary)
products(amount, type, level, value)
Task: Find code from employees where a matching record exists in products with the same status.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01719 | train |
v1 | Schema:
tasks (alias: tsk)(value, type, status, amount)
requests(name, level, id, status)
Task: Find name from tasks where type appears in requests entries with matching code.
SQL: | SELECT name FROM tasks AS tsk
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_01720 | train |
v1 | Schema:
regions (alias: rgn)(salary, amount, type, name)
tasks(name, level, salary, date)
Task: Retrieve amount from regions whose code is found in tasks rows where id matches the outer record.
SQL: | SELECT amount FROM regions AS rgn
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_01721 | train |
v3 | Schema:
items (alias: lne)(value, amount, type, status)
regions(salary, level, code, id)
Task: Retrieve salary from items with amount above the SUM(value) of regions rows sharing the same level.
SQL: | SELECT salary FROM items AS lne
WHERE amount > (
SELECT SUM(value) FROM regions AS rgn
WHERE rgn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01722 | train |
v3 | Schema:
accounts (alias: acct)(date, level, type, salary)
regions(id, type, status, value)
Task: Find salary from accounts where value exceeds the minimum salary from regions for the same status.
SQL: | SELECT salary FROM accounts AS acct
WHERE value > (
SELECT MIN(salary) FROM regions AS rgn
WHERE rgn.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01723 | train |
v1 | Schema:
sales (alias: sale)(amount, date, id, level)
products(id, type, status, code)
Task: Select value from sales where type exists in products for the same level.
SQL: | SELECT value FROM sales AS sale
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01724 | train |
v3 | Schema:
categories (alias: catg)(type, value, amount, salary)
requests(status, date, salary, name)
Task: Find amount from categories where amount exceeds the total salary from requests for the same id.
SQL: | SELECT amount FROM categories AS catg
WHERE amount > (
SELECT SUM(salary) FROM requests AS ordr
WHERE ordr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01725 | train |
v1 | Schema:
projects (alias: prj)(level, amount, id, name)
shipments(id, type, name, status)
Task: Find value from projects where type appears in shipments entries with matching type.
SQL: | SELECT value FROM projects AS prj
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01726 | train |
v2 | Schema:
employees (alias: emp)(amount, level, value, code)
branches(type, name, id, amount)
Task: Retrieve code from employees that have at least one corresponding entry in branches sharing the same type.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01727 | train |
v1 | Schema:
employees (alias: emp)(date, salary, type, id)
regions(type, id, name, value)
Task: Select code from employees where status exists in regions for the same level.
SQL: | SELECT code FROM employees AS emp
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01728 | train |
v3 | Schema:
departments (alias: dept)(name, type, code, id)
orders(status, name, amount, salary)
Task: Retrieve code from departments with salary above the MAX(value) of orders rows sharing the same level.
SQL: | SELECT code FROM departments AS dept
WHERE salary > (
SELECT MAX(value) FROM orders AS ord
WHERE ord.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "code",
"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_01729 | train |
v3 | Schema:
accounts (alias: acct)(name, amount, status, code)
items(status, id, level, salary)
Task: Retrieve salary from accounts with amount above the SUM(value) of items rows sharing the same code.
SQL: | SELECT salary FROM accounts AS acct
WHERE amount > (
SELECT SUM(value) FROM items AS lne
WHERE lne.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01730 | train |
v1 | Schema:
projects (alias: prj)(value, status, type, name)
employees(salary, type, code, amount)
Task: Select id from projects where level exists in employees for the same status.
SQL: | SELECT id FROM projects AS prj
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01731 | train |
v3 | Schema:
shipments (alias: shp)(level, name, status, type)
transactions(id, type, level, value)
Task: Retrieve amount from shipments with amount above the COUNT(salary) of transactions rows sharing the same type.
SQL: | SELECT amount FROM shipments AS shp
WHERE amount > (
SELECT COUNT(salary) 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": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01732 | train |
v2 | Schema:
customers (alias: cust)(type, date, status, code)
regions(date, level, salary, type)
Task: Find salary from customers where a matching record exists in regions with the same status.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01733 | train |
v1 | Schema:
shipments (alias: shp)(level, code, type, id)
projects(type, salary, id, level)
Task: Select value from shipments where level exists in projects for the same code.
SQL: | SELECT value FROM shipments AS shp
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01734 | train |
v3 | Schema:
orders (alias: ord)(status, salary, id, name)
shipments(level, type, code, id)
Task: Find salary from orders where salary exceeds the count of value from shipments for the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE salary > (
SELECT COUNT(value) FROM shipments AS shp
WHERE shp.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01735 | train |
v3 | Schema:
managers (alias: mgr)(status, salary, code, amount)
invoices(level, date, type, salary)
Task: Retrieve name from managers with value above the MAX(salary) of invoices rows sharing the same code.
SQL: | SELECT name FROM managers AS mgr
WHERE value > (
SELECT MAX(salary) FROM invoices AS inv
WHERE inv.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01736 | train |
v2 | Schema:
schedules (alias: schd)(status, id, salary, value)
employees(name, value, id, salary)
Task: Find code from schedules where a matching record exists in employees with the same status.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01737 | train |
v3 | Schema:
invoices (alias: inv)(status, level, name, id)
staff(value, salary, date, status)
Task: Retrieve amount from invoices with amount above the MIN(amount) of staff rows sharing the same status.
SQL: | SELECT amount FROM invoices AS inv
WHERE amount > (
SELECT MIN(amount) FROM staff AS empl
WHERE empl.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01738 | train |
v1 | Schema:
projects (alias: prj)(code, name, status, type)
items(type, code, value, id)
Task: Retrieve value from projects whose code is found in items rows where type matches the outer record.
SQL: | SELECT value FROM projects AS prj
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01739 | train |
v2 | Schema:
departments (alias: dept)(id, type, code, status)
invoices(level, code, name, status)
Task: Find name from departments where a matching record exists in invoices with the same level.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "invoices",
"outer_alias": "dept",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01740 | train |
v3 | Schema:
employees (alias: emp)(name, id, status, level)
items(id, status, date, type)
Task: Retrieve salary from employees with salary above the SUM(amount) of items rows sharing the same level.
SQL: | SELECT salary FROM employees AS emp
WHERE salary > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01741 | train |
v3 | Schema:
shipments (alias: shp)(value, amount, name, code)
staff(date, code, name, amount)
Task: Retrieve salary from shipments with amount above the MAX(amount) of staff rows sharing the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE amount > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01742 | train |
v2 | Schema:
requests (alias: ordr)(code, id, date, level)
staff(salary, type, level, amount)
Task: Find name from requests where a matching record exists in staff with the same level.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01743 | train |
v1 | Schema:
departments (alias: dept)(date, status, salary, code)
sales(name, amount, salary, level)
Task: Find id from departments where type appears in sales entries with matching code.
SQL: | SELECT id FROM departments AS dept
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01744 | train |
v2 | Schema:
customers (alias: cust)(amount, name, type, salary)
shipments(level, id, value, amount)
Task: Retrieve salary from customers that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01745 | train |
v1 | Schema:
products (alias: prod)(salary, date, type, status)
projects(type, salary, code, level)
Task: Retrieve amount from products whose level is found in projects rows where status matches the outer record.
SQL: | SELECT amount FROM products AS prod
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.status = prod.status
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "prod",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01746 | train |
v2 | Schema:
managers (alias: mgr)(id, name, code, value)
employees(level, id, salary, date)
Task: Retrieve name from managers that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01747 | train |
v1 | Schema:
departments (alias: dept)(level, status, salary, date)
projects(amount, salary, status, code)
Task: Find amount from departments where level appears in projects entries with matching type.
SQL: | SELECT amount FROM departments AS dept
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01748 | train |
v2 | Schema:
departments (alias: dept)(type, salary, date, code)
products(value, level, type, name)
Task: Retrieve value from departments that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01749 | train |
v1 | Schema:
branches (alias: brc)(salary, status, id, value)
staff(date, name, level, value)
Task: Find salary from branches where type appears in staff entries with matching code.
SQL: | SELECT salary FROM branches AS brc
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01750 | train |
v2 | Schema:
tasks (alias: tsk)(value, id, type, amount)
orders(value, name, level, amount)
Task: Retrieve name from tasks that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_01751 | train |
v2 | Schema:
products (alias: prod)(level, code, name, id)
managers(level, value, amount, date)
Task: Retrieve code from products that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = prod.code
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01752 | train |
v2 | Schema:
orders (alias: ord)(value, amount, id, date)
departments(salary, level, id, code)
Task: Find amount from orders where a matching record exists in departments with the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01753 | train |
v3 | Schema:
accounts (alias: acct)(code, status, value, name)
categories(level, name, date, salary)
Task: Find value from accounts where value exceeds the maximum amount from categories for the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE value > (
SELECT MAX(amount) FROM categories AS catg
WHERE catg.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01754 | train |
v1 | Schema:
products (alias: prod)(amount, value, code, salary)
orders(salary, code, value, status)
Task: Select value from products where level exists in orders for the same type.
SQL: | SELECT value FROM products AS prod
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.type = prod.type
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01755 | train |
v2 | Schema:
accounts (alias: acct)(id, value, code, name)
orders(salary, amount, name, type)
Task: Find id from accounts where a matching record exists in orders with the same level.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01756 | train |
v2 | Schema:
tasks (alias: tsk)(level, amount, salary, status)
products(date, id, status, code)
Task: Retrieve code from tasks that have at least one corresponding entry in products sharing the same status.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_01757 | train |
v3 | Schema:
requests (alias: ordr)(value, level, name, status)
products(amount, date, level, salary)
Task: Find name from requests where salary exceeds the average value from products for the same code.
SQL: | SELECT name FROM requests AS ordr
WHERE salary > (
SELECT AVG(value) FROM products AS prod
WHERE prod.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01758 | train |
v2 | Schema:
transactions (alias: txn)(id, status, code, name)
categories(type, amount, level, name)
Task: Retrieve name from transactions that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01759 | train |
v2 | Schema:
branches (alias: brc)(id, status, value, amount)
staff(level, salary, id, name)
Task: Find amount from branches where a matching record exists in staff with the same type.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01760 | train |
v2 | Schema:
customers (alias: cust)(status, code, date, amount)
schedules(level, type, status, value)
Task: Find value from customers where a matching record exists in schedules with the same type.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01761 | train |
v3 | Schema:
orders (alias: ord)(amount, type, code, status)
regions(type, date, level, amount)
Task: Retrieve amount from orders with value above the MIN(salary) of regions rows sharing the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE value > (
SELECT MIN(salary) FROM regions AS rgn
WHERE rgn.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01762 | train |
v2 | Schema:
items (alias: lne)(salary, type, code, value)
sales(code, level, name, amount)
Task: Find amount from items where a matching record exists in sales with the same code.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = lne.code
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01763 | train |
v3 | Schema:
regions (alias: rgn)(code, amount, status, name)
requests(id, name, level, date)
Task: Find name from regions where value exceeds the maximum amount from requests for the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE value > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_01764 | train |
v2 | Schema:
staff (alias: empl)(salary, amount, name, value)
regions(name, code, salary, value)
Task: Find name from staff where a matching record exists in regions with the same code.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_01765 | train |
v2 | Schema:
transactions (alias: txn)(code, amount, value, type)
departments(amount, salary, type, id)
Task: Find salary from transactions where a matching record exists in departments with the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01766 | train |
v1 | Schema:
employees (alias: emp)(date, status, name, salary)
categories(type, salary, amount, code)
Task: Find amount from employees where level appears in categories entries with matching type.
SQL: | SELECT amount FROM employees AS emp
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01767 | train |
v2 | Schema:
sales (alias: sale)(salary, id, status, amount)
shipments(code, value, type, name)
Task: Find amount from sales where a matching record exists in shipments with the same status.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01768 | train |
v2 | Schema:
tasks (alias: tsk)(status, date, amount, level)
projects(level, type, salary, name)
Task: Retrieve value from tasks that have at least one corresponding entry in projects sharing the same code.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_01769 | train |
v2 | Schema:
tasks (alias: tsk)(salary, date, level, code)
items(name, value, level, amount)
Task: Find value from tasks where a matching record exists in items with the same level.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "items",
"outer_alias": "tsk",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_01770 | train |
v3 | Schema:
schedules (alias: schd)(amount, salary, name, level)
categories(amount, code, id, date)
Task: Retrieve amount from schedules with amount above the SUM(salary) of categories rows sharing the same id.
SQL: | SELECT amount FROM schedules AS schd
WHERE amount > (
SELECT SUM(salary) FROM categories AS catg
WHERE catg.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01771 | train |
v2 | Schema:
branches (alias: brc)(date, code, type, name)
products(salary, type, date, status)
Task: Find amount from branches where a matching record exists in products with the same id.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01772 | train |
v3 | Schema:
branches (alias: brc)(value, code, date, status)
customers(id, level, date, code)
Task: Find value from branches where salary exceeds the count of salary from customers for the same id.
SQL: | SELECT value FROM branches AS brc
WHERE salary > (
SELECT COUNT(salary) FROM customers AS cust
WHERE cust.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01773 | train |
v2 | Schema:
managers (alias: mgr)(type, id, code, amount)
regions(type, amount, date, level)
Task: Find value from managers where a matching record exists in regions with the same level.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01774 | train |
v2 | Schema:
orders (alias: ord)(type, value, level, name)
departments(name, value, code, level)
Task: Retrieve name from orders that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01775 | train |
v3 | Schema:
accounts (alias: acct)(salary, level, name, code)
products(name, amount, level, code)
Task: Retrieve value from accounts with amount above the SUM(salary) of products rows sharing the same type.
SQL: | SELECT value FROM accounts AS acct
WHERE amount > (
SELECT SUM(salary) FROM products AS prod
WHERE prod.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01776 | train |
v2 | Schema:
orders (alias: ord)(status, salary, amount, code)
requests(id, salary, name, date)
Task: Find id from orders where a matching record exists in requests with the same type.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01777 | train |
v1 | Schema:
sales (alias: sale)(code, status, level, amount)
requests(amount, type, salary, value)
Task: Find value from sales where code appears in requests entries with matching code.
SQL: | SELECT value FROM sales AS sale
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01778 | train |
v3 | Schema:
sales (alias: sale)(date, amount, type, salary)
tasks(amount, level, value, type)
Task: Retrieve code from sales with salary above the AVG(value) of tasks rows sharing the same id.
SQL: | SELECT code FROM sales AS sale
WHERE salary > (
SELECT AVG(value) FROM tasks AS tsk
WHERE tsk.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01779 | train |
v1 | Schema:
categories (alias: catg)(value, name, salary, status)
departments(amount, code, level, salary)
Task: Retrieve salary from categories whose id is found in departments rows where code matches the outer record.
SQL: | SELECT salary FROM categories AS catg
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01780 | train |
v2 | Schema:
branches (alias: brc)(level, date, status, value)
invoices(amount, type, id, salary)
Task: Find amount from branches where a matching record exists in invoices with the same level.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01781 | train |
v1 | Schema:
projects (alias: prj)(type, status, date, salary)
accounts(date, name, id, code)
Task: Find amount from projects where type appears in accounts entries with matching type.
SQL: | SELECT amount FROM projects AS prj
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01782 | train |
v3 | Schema:
accounts (alias: acct)(date, name, amount, value)
shipments(value, amount, status, level)
Task: Retrieve salary from accounts with amount above the SUM(value) of shipments rows sharing the same code.
SQL: | SELECT salary FROM accounts AS acct
WHERE amount > (
SELECT SUM(value) FROM shipments AS shp
WHERE shp.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01783 | train |
v3 | Schema:
managers (alias: mgr)(date, status, name, id)
products(name, amount, salary, value)
Task: Retrieve salary from managers with amount above the MAX(value) of products rows sharing the same code.
SQL: | SELECT salary FROM managers AS mgr
WHERE amount > (
SELECT MAX(value) FROM products AS prod
WHERE prod.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01784 | train |
v3 | Schema:
employees (alias: emp)(salary, name, value, type)
transactions(amount, level, id, salary)
Task: Find salary from employees where amount exceeds the maximum salary from transactions for the same level.
SQL: | SELECT salary FROM employees AS emp
WHERE amount > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01785 | train |
v2 | Schema:
schedules (alias: schd)(value, date, amount, name)
staff(value, id, type, date)
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_01786 | train |
v1 | Schema:
customers (alias: cust)(type, id, value, date)
staff(level, salary, status, value)
Task: Find id from customers where level appears in staff entries with matching code.
SQL: | SELECT id FROM customers AS cust
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01787 | train |
v3 | Schema:
projects (alias: prj)(name, status, id, date)
regions(type, id, status, salary)
Task: Find value from projects where value exceeds the total salary from regions for the same level.
SQL: | SELECT value FROM projects AS prj
WHERE value > (
SELECT SUM(salary) FROM regions AS rgn
WHERE rgn.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01788 | train |
v3 | Schema:
products (alias: prod)(salary, date, type, level)
sales(name, id, amount, status)
Task: Retrieve code from products with value above the MAX(salary) of sales rows sharing the same id.
SQL: | SELECT code FROM products AS prod
WHERE value > (
SELECT MAX(salary) FROM sales AS sale
WHERE sale.id = prod.id
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01789 | train |
v3 | Schema:
regions (alias: rgn)(date, name, code, amount)
tasks(date, status, id, value)
Task: Find amount from regions where value exceeds the maximum value from tasks for the same status.
SQL: | SELECT amount FROM regions AS rgn
WHERE value > (
SELECT MAX(value) FROM tasks AS tsk
WHERE tsk.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_01790 | train |
v1 | Schema:
schedules (alias: schd)(code, status, amount, level)
products(date, code, id, amount)
Task: Find amount from schedules where level appears in products entries with matching level.
SQL: | SELECT amount FROM schedules AS schd
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01791 | train |
v2 | Schema:
accounts (alias: acct)(value, name, level, status)
branches(date, level, type, code)
Task: Find salary from accounts where a matching record exists in branches with the same code.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01792 | train |
v2 | Schema:
sales (alias: sale)(salary, date, status, value)
categories(name, type, id, code)
Task: Find salary from sales where a matching record exists in categories with the same level.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01793 | train |
v3 | Schema:
tasks (alias: tsk)(code, level, id, amount)
orders(salary, level, date, id)
Task: Retrieve salary from tasks with amount above the MIN(value) of orders rows sharing the same status.
SQL: | SELECT salary FROM tasks AS tsk
WHERE amount > (
SELECT MIN(value) FROM orders AS ord
WHERE ord.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_01794 | train |
v1 | Schema:
transactions (alias: txn)(amount, name, level, salary)
invoices(date, amount, value, type)
Task: Select name from transactions where level exists in invoices for the same type.
SQL: | SELECT name FROM transactions AS txn
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01795 | train |
v2 | Schema:
tasks (alias: tsk)(value, code, name, id)
invoices(date, code, type, value)
Task: Find value from tasks where a matching record exists in invoices with the same id.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_01796 | train |
v2 | Schema:
products (alias: prod)(salary, id, date, type)
sales(code, status, value, type)
Task: Find name from products where a matching record exists in sales with the same type.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = prod.type
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01797 | train |
v3 | Schema:
regions (alias: rgn)(level, amount, salary, name)
customers(type, id, name, value)
Task: Find id from regions where value exceeds the average value from customers for the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE value > (
SELECT AVG(value) FROM customers AS cust
WHERE cust.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_01798 | train |
v2 | Schema:
sales (alias: sale)(name, status, code, level)
customers(value, code, level, name)
Task: Find amount from sales where a matching record exists in customers with the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01799 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.