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 |
|---|---|---|---|---|---|---|
v3 | Schema:
items (alias: lne)(level, salary, date, name)
transactions(code, status, type, salary)
Task: Retrieve amount from items with salary above the MAX(value) of transactions rows sharing the same type.
SQL: | SELECT amount FROM items AS lne
WHERE salary > (
SELECT MAX(value) FROM transactions AS txn
WHERE txn.type = lne.type
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14700 | train |
v3 | Schema:
customers (alias: cust)(id, amount, type, value)
products(amount, value, level, status)
Task: Find code from customers where salary exceeds the total value from products for the same status.
SQL: | SELECT code FROM customers AS cust
WHERE salary > (
SELECT SUM(value) FROM products AS prod
WHERE prod.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14701 | train |
v2 | Schema:
customers (alias: cust)(value, type, level, salary)
sales(amount, value, name, id)
Task: Retrieve salary from customers that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14702 | train |
v3 | Schema:
tasks (alias: tsk)(level, type, amount, status)
managers(id, type, status, code)
Task: Retrieve value from tasks with salary above the MIN(salary) of managers rows sharing the same level.
SQL: | SELECT value FROM tasks AS tsk
WHERE salary > (
SELECT MIN(salary) FROM managers AS mgr
WHERE mgr.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14703 | train |
v2 | Schema:
sales (alias: sale)(status, level, amount, date)
employees(id, name, salary, status)
Task: Retrieve salary from sales that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14704 | train |
v3 | Schema:
shipments (alias: shp)(name, code, date, type)
regions(salary, code, level, amount)
Task: Find value from shipments where value exceeds the count of value from regions for the same type.
SQL: | SELECT value FROM shipments AS shp
WHERE value > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14705 | train |
v2 | Schema:
accounts (alias: acct)(id, type, value, date)
transactions(name, type, status, value)
Task: Find id from accounts where a matching record exists in transactions with the same code.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14706 | train |
v3 | Schema:
employees (alias: emp)(amount, date, salary, type)
departments(code, amount, name, date)
Task: Find code from employees where amount exceeds the total amount from departments for the same type.
SQL: | SELECT code FROM employees AS emp
WHERE amount > (
SELECT SUM(amount) FROM departments AS dept
WHERE dept.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14707 | train |
v3 | Schema:
orders (alias: ord)(status, level, code, id)
items(date, type, code, level)
Task: Find id from orders where value exceeds the average salary from items for the same status.
SQL: | SELECT id FROM orders AS ord
WHERE value > (
SELECT AVG(salary) FROM items AS lne
WHERE lne.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14708 | train |
v2 | Schema:
products (alias: prod)(level, type, salary, value)
tasks(name, salary, level, value)
Task: Retrieve name from products that have at least one corresponding entry in tasks sharing the same status.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = prod.status
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14709 | train |
v1 | Schema:
orders (alias: ord)(type, level, status, salary)
schedules(id, level, salary, amount)
Task: Find salary from orders where status appears in schedules entries with matching type.
SQL: | SELECT salary FROM orders AS ord
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14710 | train |
v2 | Schema:
schedules (alias: schd)(salary, level, type, code)
employees(code, salary, status, amount)
Task: Retrieve value from schedules that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14711 | train |
v2 | Schema:
accounts (alias: acct)(code, amount, status, name)
regions(level, type, code, date)
Task: Retrieve name from accounts that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14712 | train |
v3 | Schema:
regions (alias: rgn)(id, amount, value, level)
sales(type, date, amount, level)
Task: Retrieve name from regions with salary above the SUM(amount) of sales rows sharing the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE salary > (
SELECT SUM(amount) FROM sales AS sale
WHERE sale.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14713 | train |
v3 | Schema:
requests (alias: ordr)(code, value, amount, salary)
shipments(type, amount, name, date)
Task: Retrieve code from requests with amount above the COUNT(amount) of shipments rows sharing the same status.
SQL: | SELECT code FROM requests AS ordr
WHERE amount > (
SELECT COUNT(amount) FROM shipments AS shp
WHERE shp.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14714 | train |
v2 | Schema:
categories (alias: catg)(code, value, status, date)
requests(salary, value, code, type)
Task: Find salary from categories where a matching record exists in requests with the same level.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14715 | train |
v3 | Schema:
projects (alias: prj)(name, type, value, date)
invoices(value, code, amount, salary)
Task: Retrieve value from projects with value above the COUNT(amount) of invoices rows sharing the same type.
SQL: | SELECT value FROM projects AS prj
WHERE value > (
SELECT COUNT(amount) FROM invoices AS inv
WHERE inv.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14716 | train |
v1 | Schema:
schedules (alias: schd)(date, id, type, status)
tasks(name, value, amount, status)
Task: Select id from schedules where code exists in tasks for the same type.
SQL: | SELECT id FROM schedules AS schd
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14717 | train |
v2 | Schema:
projects (alias: prj)(id, status, salary, type)
categories(salary, type, status, code)
Task: Retrieve amount from projects that have at least one corresponding entry in categories sharing the same level.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14718 | train |
v1 | Schema:
accounts (alias: acct)(date, status, amount, level)
schedules(value, type, code, salary)
Task: Retrieve amount from accounts whose type is found in schedules rows where code matches the outer record.
SQL: | SELECT amount FROM accounts AS acct
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14719 | train |
v2 | Schema:
projects (alias: prj)(salary, date, amount, status)
staff(value, amount, status, level)
Task: Retrieve id from projects that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "staff",
"outer_alias": "prj",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14720 | train |
v2 | Schema:
accounts (alias: acct)(date, status, id, amount)
tasks(level, id, code, date)
Task: Retrieve code from accounts that have at least one corresponding entry in tasks sharing the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14721 | train |
v3 | Schema:
transactions (alias: txn)(salary, code, amount, id)
orders(value, type, status, amount)
Task: Retrieve salary from transactions with salary above the SUM(salary) of orders rows sharing the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE salary > (
SELECT SUM(salary) FROM orders AS ord
WHERE ord.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14722 | train |
v3 | Schema:
tasks (alias: tsk)(type, name, amount, status)
orders(date, type, value, name)
Task: Retrieve name from tasks with amount above the AVG(salary) of orders rows sharing the same type.
SQL: | SELECT name FROM tasks AS tsk
WHERE amount > (
SELECT AVG(salary) FROM orders AS ord
WHERE ord.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14723 | train |
v1 | Schema:
employees (alias: emp)(level, value, type, amount)
orders(type, amount, date, name)
Task: Select salary from employees where code exists in orders for the same id.
SQL: | SELECT salary FROM employees AS emp
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14724 | train |
v3 | Schema:
employees (alias: emp)(level, id, salary, value)
shipments(amount, type, date, salary)
Task: Retrieve id from employees with value above the AVG(salary) of shipments rows sharing the same level.
SQL: | SELECT id FROM employees AS emp
WHERE value > (
SELECT AVG(salary) FROM shipments AS shp
WHERE shp.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14725 | train |
v2 | Schema:
tasks (alias: tsk)(id, level, type, date)
regions(type, code, value, status)
Task: Retrieve id from tasks that have at least one corresponding entry in regions sharing the same code.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14726 | train |
v1 | Schema:
staff (alias: empl)(type, date, status, amount)
requests(level, id, amount, name)
Task: Select value from staff where level exists in requests for the same level.
SQL: | SELECT value FROM staff AS empl
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14727 | train |
v2 | Schema:
sales (alias: sale)(salary, value, type, level)
branches(status, type, code, salary)
Task: Retrieve salary from sales that have at least one corresponding entry in branches sharing the same code.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "branches",
"outer_alias": "sale",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14728 | train |
v1 | Schema:
projects (alias: prj)(id, value, amount, level)
categories(id, code, salary, date)
Task: Find code from projects where code appears in categories entries with matching status.
SQL: | SELECT code FROM projects AS prj
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14729 | train |
v3 | Schema:
shipments (alias: shp)(code, date, level, type)
employees(type, status, level, salary)
Task: Retrieve code from shipments with amount above the AVG(salary) of employees rows sharing the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE amount > (
SELECT AVG(salary) FROM employees AS emp
WHERE emp.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14730 | train |
v2 | Schema:
requests (alias: ordr)(code, name, type, value)
items(amount, date, id, code)
Task: Retrieve code from requests that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14731 | train |
v2 | Schema:
customers (alias: cust)(salary, status, date, name)
requests(code, salary, date, value)
Task: Find salary from customers where a matching record exists in requests with the same id.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14732 | train |
v3 | Schema:
tasks (alias: tsk)(type, id, level, date)
employees(amount, salary, code, type)
Task: Find value from tasks where salary exceeds the total amount from employees for the same id.
SQL: | SELECT value FROM tasks AS tsk
WHERE salary > (
SELECT SUM(amount) FROM employees AS emp
WHERE emp.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "tsk",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14733 | train |
v2 | Schema:
branches (alias: brc)(id, name, date, status)
products(id, date, type, name)
Task: Retrieve id from branches that have at least one corresponding entry in products sharing the same status.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14734 | train |
v1 | Schema:
branches (alias: brc)(code, type, date, id)
categories(salary, code, id, amount)
Task: Find code from branches where code appears in categories entries with matching type.
SQL: | SELECT code FROM branches AS brc
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14735 | train |
v3 | Schema:
products (alias: prod)(name, amount, code, level)
managers(name, status, amount, salary)
Task: Retrieve code from products with value above the AVG(salary) of managers rows sharing the same type.
SQL: | SELECT code FROM products AS prod
WHERE value > (
SELECT AVG(salary) FROM managers AS mgr
WHERE mgr.type = prod.type
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14736 | train |
v1 | Schema:
accounts (alias: acct)(date, type, name, code)
categories(level, type, date, code)
Task: Select amount from accounts where id exists in categories for the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14737 | train |
v1 | Schema:
orders (alias: ord)(level, type, salary, value)
customers(salary, status, value, date)
Task: Find amount from orders where code appears in customers entries with matching level.
SQL: | SELECT amount FROM orders AS ord
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14738 | train |
v2 | Schema:
regions (alias: rgn)(amount, date, level, type)
sales(code, type, amount, status)
Task: Retrieve name from regions that have at least one corresponding entry in sales sharing the same status.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14739 | train |
v1 | Schema:
branches (alias: brc)(type, salary, code, id)
projects(name, date, value, code)
Task: Select salary from branches where level exists in projects for the same level.
SQL: | SELECT salary FROM branches AS brc
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14740 | train |
v2 | Schema:
departments (alias: dept)(value, date, code, type)
projects(amount, date, type, value)
Task: Retrieve amount from departments that have at least one corresponding entry in projects sharing the same type.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14741 | train |
v2 | Schema:
invoices (alias: inv)(code, date, id, status)
products(level, type, value, status)
Task: Find code from invoices where a matching record exists in products with the same id.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14742 | train |
v1 | Schema:
requests (alias: ordr)(amount, date, id, status)
transactions(level, salary, name, type)
Task: Find code from requests where level appears in transactions entries with matching level.
SQL: | SELECT code FROM requests AS ordr
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14743 | train |
v3 | Schema:
branches (alias: brc)(status, name, value, level)
regions(level, code, salary, date)
Task: Retrieve id from branches with amount above the AVG(amount) of regions rows sharing the same type.
SQL: | SELECT id FROM branches AS brc
WHERE amount > (
SELECT AVG(amount) FROM regions AS rgn
WHERE rgn.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14744 | train |
v3 | Schema:
branches (alias: brc)(name, type, date, code)
schedules(value, status, salary, level)
Task: Retrieve id from branches with amount above the AVG(amount) of schedules rows sharing the same id.
SQL: | SELECT id FROM branches AS brc
WHERE amount > (
SELECT AVG(amount) FROM schedules AS schd
WHERE schd.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "schedules",
"outer_alias": "brc",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14745 | train |
v2 | Schema:
categories (alias: catg)(type, id, status, amount)
managers(salary, amount, code, level)
Task: Retrieve name from categories that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14746 | train |
v3 | Schema:
accounts (alias: acct)(id, type, value, amount)
categories(value, amount, level, id)
Task: Find code from accounts where amount exceeds the count of amount from categories for the same id.
SQL: | SELECT code FROM accounts AS acct
WHERE amount > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14747 | train |
v3 | Schema:
products (alias: prod)(name, status, date, value)
items(date, value, amount, id)
Task: Find name from products where amount exceeds the maximum salary from items for the same type.
SQL: | SELECT name FROM products AS prod
WHERE amount > (
SELECT MAX(salary) FROM items AS lne
WHERE lne.type = prod.type
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14748 | train |
v3 | Schema:
projects (alias: prj)(code, name, id, value)
invoices(value, code, salary, date)
Task: Find code from projects where amount exceeds the maximum salary from invoices for the same type.
SQL: | SELECT code FROM projects AS prj
WHERE amount > (
SELECT MAX(salary) FROM invoices AS inv
WHERE inv.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14749 | train |
v2 | Schema:
branches (alias: brc)(value, amount, salary, name)
projects(status, level, name, amount)
Task: Find id from branches where a matching record exists in projects with the same level.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14750 | train |
v3 | Schema:
managers (alias: mgr)(code, type, date, name)
products(value, type, salary, status)
Task: Find amount from managers where salary exceeds the count of amount from products for the same code.
SQL: | SELECT amount FROM managers AS mgr
WHERE salary > (
SELECT COUNT(amount) FROM products AS prod
WHERE prod.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14751 | train |
v2 | Schema:
sales (alias: sale)(amount, status, level, code)
orders(name, level, id, amount)
Task: Retrieve amount from sales that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14752 | train |
v2 | Schema:
regions (alias: rgn)(name, code, date, level)
orders(amount, salary, level, id)
Task: Find salary from regions where a matching record exists in orders with the same status.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14753 | train |
v3 | Schema:
categories (alias: catg)(value, name, salary, level)
orders(code, salary, type, status)
Task: Retrieve salary from categories with value above the MAX(amount) of orders rows sharing the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE value > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14754 | train |
v3 | Schema:
regions (alias: rgn)(name, salary, level, value)
transactions(code, id, amount, date)
Task: Find name from regions where value exceeds the maximum salary from transactions for the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE value > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14755 | train |
v3 | Schema:
staff (alias: empl)(value, date, level, name)
invoices(date, status, level, code)
Task: Retrieve id from staff with salary above the MAX(value) of invoices rows sharing the same id.
SQL: | SELECT id FROM staff AS empl
WHERE salary > (
SELECT MAX(value) FROM invoices AS inv
WHERE inv.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14756 | train |
v3 | Schema:
accounts (alias: acct)(code, name, id, level)
categories(value, salary, status, level)
Task: Find code from accounts where salary exceeds the average value from categories for the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE salary > (
SELECT AVG(value) FROM categories AS catg
WHERE catg.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14757 | train |
v2 | Schema:
branches (alias: brc)(type, code, amount, name)
sales(level, type, id, name)
Task: Find code from branches where a matching record exists in sales with the same level.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14758 | train |
v3 | Schema:
projects (alias: prj)(status, type, level, value)
employees(type, salary, code, value)
Task: Retrieve code from projects with value above the MAX(amount) of employees rows sharing the same status.
SQL: | SELECT code FROM projects AS prj
WHERE value > (
SELECT MAX(amount) FROM employees AS emp
WHERE emp.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14759 | train |
v2 | Schema:
requests (alias: ordr)(type, code, name, level)
sales(value, type, level, date)
Task: Retrieve value from requests that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14760 | train |
v1 | Schema:
requests (alias: ordr)(name, date, id, code)
accounts(id, status, code, level)
Task: Retrieve value from requests whose id is found in accounts rows where type matches the outer record.
SQL: | SELECT value FROM requests AS ordr
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14761 | train |
v2 | Schema:
products (alias: prod)(status, name, code, id)
tasks(name, level, type, date)
Task: Retrieve salary from products that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = prod.type
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14762 | train |
v1 | Schema:
branches (alias: brc)(date, level, id, value)
sales(salary, level, date, amount)
Task: Retrieve id from branches whose code is found in sales rows where status matches the outer record.
SQL: | SELECT id FROM branches AS brc
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14763 | train |
v2 | Schema:
shipments (alias: shp)(id, salary, type, level)
transactions(amount, salary, level, status)
Task: Retrieve name from shipments that have at least one corresponding entry in transactions sharing the same type.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14764 | train |
v1 | Schema:
invoices (alias: inv)(id, type, status, name)
customers(salary, type, id, status)
Task: Select salary from invoices where level exists in customers for the same type.
SQL: | SELECT salary FROM invoices AS inv
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14765 | train |
v3 | Schema:
requests (alias: ordr)(salary, name, code, status)
products(type, value, date, status)
Task: Find id from requests where amount exceeds the count of amount from products for the same code.
SQL: | SELECT id FROM requests AS ordr
WHERE amount > (
SELECT COUNT(amount) FROM products AS prod
WHERE prod.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14766 | train |
v2 | Schema:
departments (alias: dept)(value, code, name, amount)
categories(salary, id, date, name)
Task: Retrieve amount from departments that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14767 | train |
v1 | Schema:
departments (alias: dept)(status, name, id, type)
regions(status, name, amount, code)
Task: Find salary from departments where id appears in regions entries with matching code.
SQL: | SELECT salary FROM departments AS dept
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14768 | train |
v1 | Schema:
staff (alias: empl)(amount, level, date, id)
regions(level, value, status, code)
Task: Select amount from staff where type exists in regions for the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14769 | train |
v3 | Schema:
invoices (alias: inv)(id, salary, value, name)
tasks(type, level, id, status)
Task: Retrieve value from invoices with value above the COUNT(value) of tasks rows sharing the same status.
SQL: | SELECT value FROM invoices AS inv
WHERE value > (
SELECT COUNT(value) FROM tasks AS tsk
WHERE tsk.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14770 | train |
v1 | Schema:
accounts (alias: acct)(salary, type, status, amount)
shipments(value, code, id, amount)
Task: Find value from accounts where status appears in shipments entries with matching code.
SQL: | SELECT value FROM accounts AS acct
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14771 | train |
v1 | Schema:
accounts (alias: acct)(status, level, code, amount)
schedules(code, status, value, name)
Task: Select value from accounts where level exists in schedules for the same level.
SQL: | SELECT value FROM accounts AS acct
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14772 | train |
v1 | Schema:
transactions (alias: txn)(name, amount, id, date)
sales(salary, type, id, date)
Task: Retrieve amount from transactions whose status is found in sales rows where level matches the outer record.
SQL: | SELECT amount FROM transactions AS txn
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14773 | train |
v1 | Schema:
staff (alias: empl)(date, amount, status, code)
transactions(amount, salary, code, id)
Task: Find name from staff where code appears in transactions entries with matching type.
SQL: | SELECT name FROM staff AS empl
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14774 | train |
v2 | Schema:
regions (alias: rgn)(name, type, status, value)
staff(value, code, status, id)
Task: Retrieve amount from regions that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14775 | train |
v1 | Schema:
projects (alias: prj)(code, salary, level, name)
staff(id, amount, type, name)
Task: Select name from projects where code exists in staff for the same id.
SQL: | SELECT name FROM projects AS prj
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "staff",
"outer_alias": "prj",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14776 | train |
v1 | Schema:
staff (alias: empl)(date, code, type, salary)
departments(id, amount, value, date)
Task: Find salary from staff where type appears in departments entries with matching status.
SQL: | SELECT salary FROM staff AS empl
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14777 | train |
v3 | Schema:
branches (alias: brc)(salary, code, amount, name)
customers(type, amount, id, salary)
Task: Find id from branches where salary exceeds the minimum salary from customers for the same status.
SQL: | SELECT id FROM branches AS brc
WHERE salary > (
SELECT MIN(salary) FROM customers AS cust
WHERE cust.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14778 | train |
v2 | Schema:
shipments (alias: shp)(value, name, salary, id)
sales(status, salary, id, type)
Task: Find salary from shipments where a matching record exists in sales with the same id.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14779 | train |
v2 | Schema:
employees (alias: emp)(id, name, salary, type)
schedules(status, code, id, salary)
Task: Find code from employees where a matching record exists in schedules with the same level.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14780 | train |
v2 | Schema:
requests (alias: ordr)(level, code, type, status)
items(id, type, date, amount)
Task: Find amount from requests where a matching record exists in items with the same status.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14781 | train |
v1 | Schema:
customers (alias: cust)(status, id, salary, value)
transactions(status, value, amount, date)
Task: Select code from customers where code exists in transactions for the same code.
SQL: | SELECT code FROM customers AS cust
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14782 | train |
v1 | Schema:
items (alias: lne)(level, status, type, date)
transactions(code, value, name, type)
Task: Select id from items where id exists in transactions for the same level.
SQL: | SELECT id FROM items AS lne
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14783 | train |
v2 | Schema:
customers (alias: cust)(level, status, name, id)
branches(code, salary, status, type)
Task: Find code from customers where a matching record exists in branches with the same level.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "branches",
"outer_alias": "cust",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14784 | train |
v2 | Schema:
tasks (alias: tsk)(level, date, id, type)
customers(name, salary, date, status)
Task: Retrieve salary from tasks that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "tsk",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14785 | train |
v1 | Schema:
managers (alias: mgr)(type, code, date, value)
employees(id, level, date, status)
Task: Find salary from managers where type appears in employees entries with matching code.
SQL: | SELECT salary FROM managers AS mgr
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14786 | train |
v2 | Schema:
departments (alias: dept)(status, amount, salary, code)
customers(value, level, id, type)
Task: Retrieve amount from departments that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14787 | train |
v2 | Schema:
branches (alias: brc)(name, level, code, type)
regions(code, name, type, salary)
Task: Retrieve code from branches that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14788 | train |
v3 | Schema:
sales (alias: sale)(level, value, amount, code)
items(level, value, name, salary)
Task: Find salary from sales where amount exceeds the average amount from items for the same level.
SQL: | SELECT salary FROM sales AS sale
WHERE amount > (
SELECT AVG(amount) FROM items AS lne
WHERE lne.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14789 | train |
v3 | Schema:
items (alias: lne)(type, name, status, value)
departments(amount, status, id, value)
Task: Retrieve code from items with value above the SUM(value) of departments rows sharing the same level.
SQL: | SELECT code FROM items AS lne
WHERE value > (
SELECT SUM(value) FROM departments AS dept
WHERE dept.level = lne.level
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14790 | train |
v1 | Schema:
shipments (alias: shp)(type, level, date, name)
sales(date, code, salary, level)
Task: Retrieve id from shipments whose code is found in sales rows where status matches the outer record.
SQL: | SELECT id FROM shipments AS shp
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14791 | train |
v2 | Schema:
categories (alias: catg)(date, salary, type, name)
projects(type, level, status, id)
Task: Retrieve name from categories that have at least one corresponding entry in projects sharing the same id.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14792 | train |
v1 | Schema:
departments (alias: dept)(date, level, id, value)
products(salary, value, type, level)
Task: Find value from departments where id appears in products entries with matching id.
SQL: | SELECT value FROM departments AS dept
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14793 | train |
v3 | Schema:
invoices (alias: inv)(date, level, status, name)
tasks(salary, amount, id, date)
Task: Retrieve id from invoices with amount above the COUNT(salary) of tasks rows sharing the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE amount > (
SELECT COUNT(salary) FROM tasks AS tsk
WHERE tsk.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14794 | train |
v3 | Schema:
transactions (alias: txn)(id, amount, level, code)
shipments(amount, name, code, salary)
Task: Find name from transactions where amount exceeds the minimum salary from shipments for the same level.
SQL: | SELECT name FROM transactions AS txn
WHERE amount > (
SELECT MIN(salary) FROM shipments AS shp
WHERE shp.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14795 | train |
v3 | Schema:
shipments (alias: shp)(level, value, salary, type)
categories(status, code, date, level)
Task: Find code from shipments where salary exceeds the total value from categories for the same id.
SQL: | SELECT code FROM shipments AS shp
WHERE salary > (
SELECT SUM(value) FROM categories AS catg
WHERE catg.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14796 | train |
v1 | Schema:
invoices (alias: inv)(date, value, level, id)
projects(value, status, id, date)
Task: Select name from invoices where id exists in projects for the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14797 | train |
v2 | Schema:
regions (alias: rgn)(date, level, id, value)
sales(amount, date, level, type)
Task: Retrieve name from regions that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14798 | train |
v1 | Schema:
requests (alias: ordr)(name, status, id, level)
staff(amount, id, level, name)
Task: Find name from requests where level appears in staff entries with matching code.
SQL: | SELECT name FROM requests AS ordr
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14799 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.