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, value, code, amount)
customers(value, level, name, status)
Task: Find code from projects where a matching record exists in customers with the same level.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "prj",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03700 | train |
v3 | Schema:
accounts (alias: acct)(date, id, salary, code)
requests(level, value, code, id)
Task: Retrieve name from accounts with salary above the AVG(value) of requests rows sharing the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE salary > (
SELECT AVG(value) FROM requests AS ordr
WHERE ordr.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03701 | train |
v3 | Schema:
regions (alias: rgn)(amount, id, value, level)
requests(date, level, salary, name)
Task: Find id from regions where value exceeds the total value from requests for the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE value > (
SELECT SUM(value) FROM requests AS ordr
WHERE ordr.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03702 | train |
v2 | Schema:
branches (alias: brc)(name, salary, id, level)
categories(level, type, salary, name)
Task: Find amount from branches where a matching record exists in categories with the same code.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03703 | train |
v2 | Schema:
branches (alias: brc)(name, status, level, value)
orders(code, type, status, amount)
Task: Find code from branches where a matching record exists in orders with the same type.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03704 | train |
v2 | Schema:
requests (alias: ordr)(id, status, type, salary)
sales(value, type, date, status)
Task: Retrieve name from requests that have at least one corresponding entry in sales sharing the same status.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03705 | train |
v3 | Schema:
products (alias: prod)(name, level, value, id)
shipments(type, value, code, id)
Task: Find amount from products where amount exceeds the total salary from shipments for the same type.
SQL: | SELECT amount FROM products AS prod
WHERE amount > (
SELECT SUM(salary) FROM shipments AS shp
WHERE shp.type = prod.type
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03706 | train |
v2 | Schema:
tasks (alias: tsk)(date, amount, id, name)
transactions(status, level, code, salary)
Task: Find salary from tasks where a matching record exists in transactions with the same level.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03707 | train |
v1 | Schema:
departments (alias: dept)(type, salary, amount, value)
employees(level, status, id, value)
Task: Find name from departments where level appears in employees entries with matching status.
SQL: | SELECT name FROM departments AS dept
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03708 | train |
v3 | Schema:
schedules (alias: schd)(code, id, status, date)
employees(value, amount, status, id)
Task: Retrieve id from schedules with value above the MAX(salary) of employees rows sharing the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE value > (
SELECT MAX(salary) FROM employees AS emp
WHERE emp.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03709 | train |
v3 | Schema:
products (alias: prod)(level, status, amount, code)
tasks(salary, id, status, amount)
Task: Retrieve code from products with amount above the SUM(amount) of tasks rows sharing the same code.
SQL: | SELECT code FROM products AS prod
WHERE amount > (
SELECT SUM(amount) FROM tasks AS tsk
WHERE tsk.code = prod.code
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03710 | train |
v2 | Schema:
items (alias: lne)(status, value, type, id)
products(id, type, status, amount)
Task: Retrieve amount from items that have at least one corresponding entry in products sharing the same type.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = lne.type
); | {
"outer_table": "items",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03711 | train |
v1 | Schema:
categories (alias: catg)(code, type, status, value)
staff(code, type, id, level)
Task: Retrieve code from categories whose status is found in staff rows where level matches the outer record.
SQL: | SELECT code FROM categories AS catg
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03712 | train |
v1 | Schema:
items (alias: lne)(salary, status, amount, type)
orders(level, status, value, code)
Task: Find id from items where level appears in orders entries with matching id.
SQL: | SELECT id FROM items AS lne
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.id = lne.id
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03713 | train |
v1 | Schema:
categories (alias: catg)(salary, id, level, value)
products(value, date, level, salary)
Task: Retrieve name from categories whose status is found in products rows where type matches the outer record.
SQL: | SELECT name FROM categories AS catg
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03714 | train |
v3 | Schema:
transactions (alias: txn)(value, date, code, type)
regions(value, salary, type, amount)
Task: Retrieve salary from transactions with amount above the COUNT(value) of regions rows sharing the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE amount > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03715 | train |
v1 | Schema:
invoices (alias: inv)(status, value, salary, id)
staff(value, level, name, date)
Task: Retrieve salary from invoices whose id is found in staff rows where status matches the outer record.
SQL: | SELECT salary FROM invoices AS inv
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03716 | train |
v3 | Schema:
invoices (alias: inv)(name, date, status, code)
products(date, salary, level, status)
Task: Find value from invoices where amount exceeds the count of value from products for the same status.
SQL: | SELECT value FROM invoices AS inv
WHERE amount > (
SELECT COUNT(value) FROM products AS prod
WHERE prod.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03717 | train |
v2 | Schema:
tasks (alias: tsk)(amount, status, id, type)
requests(status, value, id, type)
Task: Find code from tasks where a matching record exists in requests with the same status.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03718 | train |
v2 | Schema:
transactions (alias: txn)(type, status, date, salary)
items(name, amount, code, date)
Task: Find name from transactions where a matching record exists in items with the same status.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03719 | train |
v3 | Schema:
tasks (alias: tsk)(level, name, type, id)
transactions(code, date, value, id)
Task: Find amount from tasks where amount exceeds the maximum value from transactions for the same code.
SQL: | SELECT amount FROM tasks AS tsk
WHERE amount > (
SELECT MAX(value) FROM transactions AS txn
WHERE txn.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03720 | train |
v1 | Schema:
employees (alias: emp)(value, id, amount, name)
shipments(id, value, type, date)
Task: Find name from employees where status appears in shipments entries with matching level.
SQL: | SELECT name FROM employees AS emp
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03721 | train |
v3 | Schema:
orders (alias: ord)(id, status, level, salary)
transactions(type, amount, value, status)
Task: Find value from orders where amount exceeds the maximum salary from transactions for the same id.
SQL: | SELECT value FROM orders AS ord
WHERE amount > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03722 | train |
v1 | Schema:
departments (alias: dept)(value, level, amount, code)
products(id, amount, date, value)
Task: Find id from departments where type appears in products entries with matching level.
SQL: | SELECT id FROM departments AS dept
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03723 | train |
v3 | Schema:
projects (alias: prj)(code, id, status, name)
regions(amount, value, type, salary)
Task: Find id from projects where value exceeds the minimum value from regions for the same type.
SQL: | SELECT id FROM projects AS prj
WHERE value > (
SELECT MIN(value) FROM regions AS rgn
WHERE rgn.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03724 | train |
v2 | Schema:
employees (alias: emp)(name, level, type, value)
branches(status, level, name, date)
Task: Find id from employees where a matching record exists in branches with the same level.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03725 | train |
v2 | Schema:
invoices (alias: inv)(value, status, salary, type)
departments(status, name, salary, type)
Task: Retrieve name from invoices that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03726 | train |
v2 | Schema:
orders (alias: ord)(level, value, name, id)
sales(level, code, id, salary)
Task: Find code from orders where a matching record exists in sales with the same code.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03727 | train |
v1 | Schema:
managers (alias: mgr)(salary, code, amount, date)
requests(level, status, name, type)
Task: Find value from managers where status appears in requests entries with matching level.
SQL: | SELECT value FROM managers AS mgr
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03728 | train |
v1 | Schema:
requests (alias: ordr)(type, status, amount, value)
regions(date, code, value, level)
Task: Retrieve name from requests whose code is found in regions rows where status matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03729 | train |
v1 | Schema:
staff (alias: empl)(amount, status, type, name)
transactions(value, amount, code, salary)
Task: Select value from staff where level exists in transactions for the same type.
SQL: | SELECT value FROM staff AS empl
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03730 | train |
v1 | Schema:
invoices (alias: inv)(type, level, code, date)
customers(status, name, level, amount)
Task: Select code from invoices where status exists in customers for the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03731 | train |
v3 | Schema:
managers (alias: mgr)(amount, code, date, salary)
customers(id, date, amount, code)
Task: Retrieve amount from managers with value above the COUNT(amount) of customers rows sharing the same code.
SQL: | SELECT amount FROM managers AS mgr
WHERE value > (
SELECT COUNT(amount) FROM customers AS cust
WHERE cust.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03732 | train |
v3 | Schema:
requests (alias: ordr)(code, id, amount, name)
staff(date, salary, level, type)
Task: Find value from requests where value exceeds the total amount from staff for the same id.
SQL: | SELECT value FROM requests AS ordr
WHERE value > (
SELECT SUM(amount) FROM staff AS empl
WHERE empl.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03733 | train |
v3 | Schema:
sales (alias: sale)(level, name, salary, date)
departments(status, type, level, value)
Task: Retrieve salary from sales with value above the SUM(amount) of departments rows sharing the same code.
SQL: | SELECT salary FROM sales AS sale
WHERE value > (
SELECT SUM(amount) FROM departments AS dept
WHERE dept.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03734 | train |
v3 | Schema:
tasks (alias: tsk)(level, amount, code, name)
orders(status, code, date, id)
Task: Find code from tasks where salary exceeds the minimum value from orders for the same type.
SQL: | SELECT code FROM tasks AS tsk
WHERE salary > (
SELECT MIN(value) FROM orders AS ord
WHERE ord.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03735 | train |
v3 | Schema:
products (alias: prod)(date, name, code, status)
orders(date, code, amount, salary)
Task: Find code from products where salary exceeds the total salary from orders for the same id.
SQL: | SELECT code FROM products AS prod
WHERE salary > (
SELECT SUM(salary) FROM orders AS ord
WHERE ord.id = prod.id
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03736 | train |
v3 | Schema:
orders (alias: ord)(code, salary, level, amount)
projects(value, code, salary, status)
Task: Find salary from orders where salary exceeds the average salary from projects for the same code.
SQL: | SELECT salary FROM orders AS ord
WHERE salary > (
SELECT AVG(salary) FROM projects AS prj
WHERE prj.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03737 | train |
v3 | Schema:
regions (alias: rgn)(date, status, amount, level)
requests(status, amount, value, id)
Task: Retrieve salary from regions with amount above the MIN(amount) of requests rows sharing the same id.
SQL: | SELECT salary FROM regions AS rgn
WHERE amount > (
SELECT MIN(amount) FROM requests AS ordr
WHERE ordr.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03738 | train |
v3 | Schema:
managers (alias: mgr)(salary, value, code, name)
requests(code, date, type, status)
Task: Retrieve code from managers with value above the AVG(value) of requests rows sharing the same type.
SQL: | SELECT code FROM managers AS mgr
WHERE value > (
SELECT AVG(value) FROM requests AS ordr
WHERE ordr.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03739 | train |
v3 | Schema:
categories (alias: catg)(date, value, code, amount)
invoices(date, amount, code, status)
Task: Retrieve value from categories with value above the MAX(value) of invoices rows sharing the same id.
SQL: | SELECT value FROM categories AS catg
WHERE value > (
SELECT MAX(value) FROM invoices AS inv
WHERE inv.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03740 | train |
v1 | Schema:
products (alias: prod)(type, name, salary, status)
schedules(name, id, salary, type)
Task: Find value from products where id appears in schedules entries with matching level.
SQL: | SELECT value FROM products AS prod
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.level = prod.level
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03741 | train |
v1 | Schema:
branches (alias: brc)(id, date, type, code)
shipments(salary, value, level, id)
Task: Select salary from branches where status exists in shipments for the same level.
SQL: | SELECT salary FROM branches AS brc
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03742 | train |
v1 | Schema:
shipments (alias: shp)(date, value, id, code)
staff(amount, code, value, salary)
Task: Find name from shipments where id appears in staff entries with matching level.
SQL: | SELECT name FROM shipments AS shp
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03743 | train |
v2 | Schema:
managers (alias: mgr)(id, code, status, amount)
customers(type, level, id, date)
Task: Find amount from managers where a matching record exists in customers with the same level.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03744 | train |
v3 | Schema:
managers (alias: mgr)(name, level, salary, type)
departments(id, code, salary, date)
Task: Retrieve amount from managers with amount above the MIN(amount) of departments rows sharing the same code.
SQL: | SELECT amount FROM managers AS mgr
WHERE amount > (
SELECT MIN(amount) FROM departments AS dept
WHERE dept.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03745 | train |
v2 | Schema:
transactions (alias: txn)(amount, type, level, code)
shipments(id, code, status, name)
Task: Retrieve amount from transactions that have at least one corresponding entry in shipments sharing the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03746 | train |
v3 | Schema:
staff (alias: empl)(status, date, salary, code)
employees(id, name, status, type)
Task: Retrieve salary from staff with amount above the MIN(salary) of employees rows sharing the same code.
SQL: | SELECT salary FROM staff AS empl
WHERE amount > (
SELECT MIN(salary) FROM employees AS emp
WHERE emp.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03747 | train |
v1 | Schema:
customers (alias: cust)(type, code, id, amount)
departments(salary, level, date, value)
Task: Find amount from customers where level appears in departments entries with matching type.
SQL: | SELECT amount FROM customers AS cust
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03748 | train |
v2 | Schema:
items (alias: lne)(status, code, amount, name)
accounts(salary, amount, status, date)
Task: Retrieve amount from items that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = lne.status
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03749 | train |
v1 | Schema:
regions (alias: rgn)(date, level, type, salary)
employees(status, date, value, level)
Task: Find value from regions where status appears in employees entries with matching id.
SQL: | SELECT value FROM regions AS rgn
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03750 | train |
v2 | Schema:
sales (alias: sale)(date, amount, id, name)
regions(type, id, level, salary)
Task: Find amount from sales where a matching record exists in regions with the same code.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03751 | train |
v3 | Schema:
regions (alias: rgn)(type, salary, date, id)
employees(salary, date, amount, value)
Task: Find code from regions where amount exceeds the minimum salary from employees for the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE amount > (
SELECT MIN(salary) FROM employees AS emp
WHERE emp.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03752 | train |
v3 | Schema:
transactions (alias: txn)(name, value, code, type)
requests(date, level, name, type)
Task: Find value from transactions where amount exceeds the average salary from requests for the same id.
SQL: | SELECT value FROM transactions AS txn
WHERE amount > (
SELECT AVG(salary) FROM requests AS ordr
WHERE ordr.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03753 | train |
v2 | Schema:
transactions (alias: txn)(name, code, amount, status)
items(type, id, name, salary)
Task: Find value from transactions where a matching record exists in items with the same type.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03754 | train |
v2 | Schema:
shipments (alias: shp)(status, code, amount, id)
departments(date, value, type, name)
Task: Find code from shipments where a matching record exists in departments with the same type.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03755 | train |
v1 | Schema:
invoices (alias: inv)(id, level, date, name)
employees(status, type, name, id)
Task: Retrieve salary from invoices whose status is found in employees rows where id matches the outer record.
SQL: | SELECT salary FROM invoices AS inv
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03756 | train |
v1 | Schema:
projects (alias: prj)(name, id, date, value)
accounts(name, id, amount, status)
Task: Select salary from projects where code exists in accounts for the same level.
SQL: | SELECT salary FROM projects AS prj
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03757 | train |
v1 | Schema:
categories (alias: catg)(name, salary, id, value)
customers(type, amount, status, level)
Task: Find code from categories where status appears in customers entries with matching code.
SQL: | SELECT code FROM categories AS catg
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03758 | train |
v1 | Schema:
employees (alias: emp)(type, amount, name, code)
requests(salary, type, amount, code)
Task: Retrieve id from employees whose code is found in requests rows where level matches the outer record.
SQL: | SELECT id FROM employees AS emp
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03759 | train |
v3 | Schema:
staff (alias: empl)(amount, level, name, id)
transactions(level, code, type, amount)
Task: Retrieve id from staff with salary above the COUNT(amount) of transactions rows sharing the same status.
SQL: | SELECT id FROM staff AS empl
WHERE salary > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03760 | train |
v3 | Schema:
staff (alias: empl)(code, date, amount, value)
schedules(code, salary, status, name)
Task: Retrieve id from staff with salary above the SUM(salary) of schedules rows sharing the same id.
SQL: | SELECT id FROM staff AS empl
WHERE salary > (
SELECT SUM(salary) FROM schedules AS schd
WHERE schd.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03761 | train |
v2 | Schema:
items (alias: lne)(value, code, name, status)
transactions(id, code, name, value)
Task: Find salary from items where a matching record exists in transactions with the same level.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03762 | train |
v1 | Schema:
projects (alias: prj)(value, level, amount, type)
branches(type, date, amount, name)
Task: Select salary from projects where status exists in branches for the same level.
SQL: | SELECT salary FROM projects AS prj
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03763 | train |
v1 | Schema:
accounts (alias: acct)(salary, level, status, code)
customers(amount, salary, type, level)
Task: Select name from accounts where status exists in customers for the same status.
SQL: | SELECT name FROM accounts AS acct
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03764 | train |
v2 | Schema:
items (alias: lne)(date, type, amount, id)
categories(date, type, salary, value)
Task: Retrieve value from items that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = lne.type
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03765 | train |
v2 | Schema:
projects (alias: prj)(type, date, id, status)
invoices(name, value, id, salary)
Task: Find id from projects where a matching record exists in invoices with the same level.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03766 | train |
v2 | Schema:
branches (alias: brc)(status, type, code, id)
requests(amount, value, level, name)
Task: Retrieve amount from branches that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03767 | train |
v1 | Schema:
regions (alias: rgn)(name, type, code, date)
products(level, amount, date, salary)
Task: Find amount from regions where level appears in products entries with matching id.
SQL: | SELECT amount FROM regions AS rgn
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03768 | train |
v2 | Schema:
branches (alias: brc)(amount, level, salary, type)
products(status, salary, amount, code)
Task: Find amount from branches where a matching record exists in products with the same level.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03769 | train |
v1 | Schema:
staff (alias: empl)(salary, id, date, amount)
branches(id, date, level, value)
Task: Retrieve salary from staff whose type is found in branches rows where code matches the outer record.
SQL: | SELECT salary FROM staff AS empl
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03770 | train |
v3 | Schema:
sales (alias: sale)(amount, status, name, id)
products(amount, date, value, level)
Task: Retrieve salary from sales with salary above the MIN(amount) of products rows sharing the same status.
SQL: | SELECT salary FROM sales AS sale
WHERE salary > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03771 | train |
v3 | Schema:
customers (alias: cust)(name, salary, date, status)
regions(type, value, status, id)
Task: Retrieve salary from customers with value above the MAX(amount) of regions rows sharing the same type.
SQL: | SELECT salary FROM customers AS cust
WHERE value > (
SELECT MAX(amount) FROM regions AS rgn
WHERE rgn.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03772 | train |
v3 | Schema:
employees (alias: emp)(salary, id, date, status)
requests(type, name, date, level)
Task: Retrieve amount from employees with salary above the AVG(value) of requests rows sharing the same id.
SQL: | SELECT amount FROM employees AS emp
WHERE salary > (
SELECT AVG(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": "AVG",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03773 | train |
v3 | Schema:
invoices (alias: inv)(code, name, amount, status)
orders(type, date, value, amount)
Task: Retrieve value from invoices with value above the MAX(amount) of orders rows sharing the same id.
SQL: | SELECT value FROM invoices AS inv
WHERE value > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03774 | train |
v3 | Schema:
requests (alias: ordr)(status, code, id, level)
staff(code, name, level, type)
Task: Retrieve value from requests with amount above the COUNT(amount) of staff rows sharing the same id.
SQL: | SELECT value FROM requests AS ordr
WHERE amount > (
SELECT COUNT(amount) FROM staff AS empl
WHERE empl.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03775 | train |
v2 | Schema:
branches (alias: brc)(code, id, amount, salary)
accounts(code, date, id, name)
Task: Find id from branches where a matching record exists in accounts with the same status.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "accounts",
"outer_alias": "brc",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03776 | train |
v3 | Schema:
categories (alias: catg)(salary, id, type, code)
items(type, amount, id, level)
Task: Find amount from categories where value exceeds the average amount from items for the same code.
SQL: | SELECT amount FROM categories AS catg
WHERE value > (
SELECT AVG(amount) FROM items AS lne
WHERE lne.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03777 | train |
v1 | Schema:
tasks (alias: tsk)(amount, code, name, salary)
products(level, amount, code, salary)
Task: Select salary from tasks where id exists in products for the same level.
SQL: | SELECT salary FROM tasks AS tsk
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03778 | train |
v1 | Schema:
branches (alias: brc)(value, name, level, status)
staff(code, amount, name, level)
Task: Retrieve value from branches whose type is found in staff rows where id matches the outer record.
SQL: | SELECT value FROM branches AS brc
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03779 | train |
v2 | Schema:
departments (alias: dept)(salary, value, id, date)
schedules(status, value, name, amount)
Task: Find salary from departments where a matching record exists in schedules with the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03780 | train |
v3 | Schema:
staff (alias: empl)(level, date, name, type)
projects(level, amount, id, status)
Task: Find id from staff where amount exceeds the minimum salary from projects for the same status.
SQL: | SELECT id FROM staff AS empl
WHERE amount > (
SELECT MIN(salary) FROM projects AS prj
WHERE prj.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03781 | train |
v3 | Schema:
projects (alias: prj)(status, name, date, salary)
tasks(date, name, salary, id)
Task: Retrieve value from projects with amount above the MAX(amount) of tasks rows sharing the same level.
SQL: | SELECT value FROM projects AS prj
WHERE amount > (
SELECT MAX(amount) FROM tasks AS tsk
WHERE tsk.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "prj",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03782 | train |
v2 | Schema:
orders (alias: ord)(id, date, amount, type)
departments(salary, type, level, amount)
Task: Find salary from orders where a matching record exists in departments with the same code.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03783 | train |
v3 | Schema:
transactions (alias: txn)(level, status, id, code)
categories(name, level, status, value)
Task: Find value from transactions where salary exceeds the average value from categories for the same status.
SQL: | SELECT value FROM transactions AS txn
WHERE salary > (
SELECT AVG(value) FROM categories AS catg
WHERE catg.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03784 | train |
v3 | Schema:
managers (alias: mgr)(value, id, salary, level)
schedules(status, level, name, date)
Task: Find id from managers where value exceeds the count of value from schedules for the same id.
SQL: | SELECT id FROM managers AS mgr
WHERE value > (
SELECT COUNT(value) FROM schedules AS schd
WHERE schd.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03785 | train |
v2 | Schema:
categories (alias: catg)(type, name, level, date)
projects(value, code, type, amount)
Task: Find amount from categories where a matching record exists in projects with the same level.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03786 | train |
v2 | Schema:
invoices (alias: inv)(level, date, name, status)
branches(id, name, code, date)
Task: Find value from invoices where a matching record exists in branches with the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03787 | train |
v2 | Schema:
managers (alias: mgr)(name, amount, date, value)
tasks(status, code, id, level)
Task: Find name from managers where a matching record exists in tasks with the same type.
SQL: | SELECT name 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": "name",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03788 | train |
v1 | Schema:
orders (alias: ord)(value, name, amount, code)
staff(code, type, id, date)
Task: Find name from orders where type appears in staff entries with matching code.
SQL: | SELECT name FROM orders AS ord
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03789 | train |
v2 | Schema:
orders (alias: ord)(name, status, salary, amount)
branches(salary, type, amount, level)
Task: Find amount from orders where a matching record exists in branches with the same code.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03790 | train |
v3 | Schema:
projects (alias: prj)(amount, date, code, status)
categories(value, name, date, type)
Task: Retrieve name from projects with value above the MIN(amount) of categories rows sharing the same id.
SQL: | SELECT name FROM projects AS prj
WHERE value > (
SELECT MIN(amount) FROM categories AS catg
WHERE catg.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03791 | train |
v3 | Schema:
invoices (alias: inv)(date, salary, type, amount)
staff(amount, id, status, salary)
Task: Find salary from invoices where amount exceeds the total salary from staff for the same type.
SQL: | SELECT salary FROM invoices AS inv
WHERE amount > (
SELECT SUM(salary) FROM staff AS empl
WHERE empl.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03792 | train |
v3 | Schema:
employees (alias: emp)(status, name, code, type)
schedules(amount, code, value, type)
Task: Find value from employees where salary exceeds the average amount from schedules for the same level.
SQL: | SELECT value FROM employees AS emp
WHERE salary > (
SELECT AVG(amount) FROM schedules AS schd
WHERE schd.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03793 | train |
v3 | Schema:
managers (alias: mgr)(amount, salary, date, status)
schedules(status, code, salary, date)
Task: Find amount from managers where amount exceeds the count of salary from schedules for the same code.
SQL: | SELECT amount FROM managers AS mgr
WHERE amount > (
SELECT COUNT(salary) FROM schedules AS schd
WHERE schd.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03794 | train |
v2 | Schema:
items (alias: lne)(level, type, value, code)
categories(value, type, status, id)
Task: Retrieve amount from items that have at least one corresponding entry in categories sharing the same level.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = lne.level
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03795 | train |
v3 | Schema:
requests (alias: ordr)(code, type, date, value)
items(date, type, value, status)
Task: Retrieve code from requests with amount above the MAX(value) of items rows sharing the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE amount > (
SELECT MAX(value) FROM items AS lne
WHERE lne.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03796 | train |
v2 | Schema:
branches (alias: brc)(id, salary, type, status)
requests(name, status, date, code)
Task: Retrieve amount from branches that have at least one corresponding entry in requests sharing the same id.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03797 | train |
v1 | Schema:
staff (alias: empl)(code, name, amount, id)
managers(status, level, salary, date)
Task: Retrieve name from staff whose id is found in managers rows where type matches the outer record.
SQL: | SELECT name FROM staff AS empl
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03798 | train |
v2 | Schema:
products (alias: prod)(name, value, amount, level)
shipments(code, name, status, id)
Task: Retrieve salary from products that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = prod.code
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03799 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.