variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v1 | Schema:
sales (alias: sale)(name, code, salary, value)
items(type, date, name, code)
Task: Find code from sales where status appears in items entries with matching level.
SQL: | SELECT code FROM sales AS sale
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08100 | train |
v1 | Schema:
employees (alias: emp)(id, value, type, name)
projects(type, name, amount, code)
Task: Retrieve salary from employees whose type is found in projects rows where type matches the outer record.
SQL: | SELECT salary FROM employees AS emp
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "projects",
"outer_alias": "emp",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08101 | train |
v3 | Schema:
categories (alias: catg)(type, value, code, amount)
projects(type, status, amount, id)
Task: Retrieve name from categories with salary above the AVG(amount) of projects rows sharing the same type.
SQL: | SELECT name FROM categories AS catg
WHERE salary > (
SELECT AVG(amount) FROM projects AS prj
WHERE prj.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08102 | train |
v3 | Schema:
categories (alias: catg)(code, date, id, level)
requests(code, salary, amount, value)
Task: Find name from categories where amount exceeds the average amount from requests for the same type.
SQL: | SELECT name FROM categories AS catg
WHERE amount > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08103 | train |
v3 | Schema:
shipments (alias: shp)(date, level, type, status)
invoices(code, salary, status, level)
Task: Retrieve code from shipments with salary above the AVG(value) of invoices rows sharing the same type.
SQL: | SELECT code FROM shipments AS shp
WHERE salary > (
SELECT AVG(value) FROM invoices AS inv
WHERE inv.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08104 | train |
v2 | Schema:
projects (alias: prj)(date, type, level, code)
items(salary, value, status, amount)
Task: Find id from projects where a matching record exists in items with the same type.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08105 | train |
v2 | Schema:
projects (alias: prj)(code, id, status, level)
sales(name, amount, date, id)
Task: Retrieve value from projects that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08106 | train |
v2 | Schema:
orders (alias: ord)(type, name, date, code)
invoices(salary, name, amount, type)
Task: Retrieve amount from orders that have at least one corresponding entry in invoices sharing the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08107 | train |
v1 | Schema:
accounts (alias: acct)(status, date, name, salary)
transactions(id, name, amount, code)
Task: Select code from accounts where level exists in transactions for the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08108 | train |
v3 | Schema:
shipments (alias: shp)(salary, level, amount, status)
accounts(type, status, value, salary)
Task: Retrieve salary from shipments with salary above the SUM(value) of accounts rows sharing the same status.
SQL: | SELECT salary FROM shipments AS shp
WHERE salary > (
SELECT SUM(value) FROM accounts AS acct
WHERE acct.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08109 | train |
v2 | Schema:
requests (alias: ordr)(code, type, salary, name)
staff(status, name, type, salary)
Task: Retrieve name from requests that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08110 | train |
v3 | Schema:
regions (alias: rgn)(name, id, type, amount)
accounts(code, salary, id, amount)
Task: Find code from regions where value exceeds the maximum value from accounts for the same level.
SQL: | SELECT code FROM regions AS rgn
WHERE value > (
SELECT MAX(value) FROM accounts AS acct
WHERE acct.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08111 | train |
v1 | Schema:
invoices (alias: inv)(type, name, value, date)
products(name, level, type, code)
Task: Select salary from invoices where id exists in products for the same id.
SQL: | SELECT salary FROM invoices AS inv
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08112 | train |
v2 | Schema:
categories (alias: catg)(salary, amount, date, name)
sales(type, id, date, salary)
Task: Retrieve name from categories that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08113 | train |
v3 | Schema:
employees (alias: emp)(name, level, date, code)
customers(level, value, code, date)
Task: Retrieve value from employees with salary above the MIN(salary) of customers rows sharing the same id.
SQL: | SELECT value FROM employees AS emp
WHERE salary > (
SELECT MIN(salary) FROM customers AS cust
WHERE cust.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08114 | train |
v1 | Schema:
employees (alias: emp)(value, type, code, id)
shipments(value, level, id, date)
Task: Retrieve amount from employees whose status is found in shipments rows where status matches the outer record.
SQL: | SELECT amount FROM employees AS emp
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08115 | train |
v2 | Schema:
shipments (alias: shp)(code, date, status, amount)
invoices(salary, status, id, type)
Task: Retrieve amount from shipments that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08116 | train |
v1 | Schema:
departments (alias: dept)(id, code, value, status)
regions(status, code, type, salary)
Task: Find id from departments where id appears in regions entries with matching code.
SQL: | SELECT id 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": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08117 | train |
v1 | Schema:
staff (alias: empl)(level, amount, code, name)
transactions(value, salary, type, name)
Task: Retrieve name from staff whose code is found in transactions rows where status matches the outer record.
SQL: | SELECT name FROM staff AS empl
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08118 | train |
v3 | Schema:
categories (alias: catg)(code, value, name, date)
sales(amount, code, name, type)
Task: Retrieve id from categories with salary above the COUNT(amount) of sales rows sharing the same status.
SQL: | SELECT id FROM categories AS catg
WHERE salary > (
SELECT COUNT(amount) FROM sales AS sale
WHERE sale.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08119 | train |
v1 | Schema:
sales (alias: sale)(type, code, salary, name)
requests(value, salary, name, date)
Task: Select code from sales where level exists in requests for the same level.
SQL: | SELECT code FROM sales AS sale
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08120 | train |
v2 | Schema:
invoices (alias: inv)(id, date, value, code)
branches(name, amount, type, status)
Task: Retrieve code from invoices that have at least one corresponding entry in branches sharing the same id.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08121 | train |
v2 | Schema:
regions (alias: rgn)(salary, level, value, name)
products(id, salary, date, status)
Task: Find amount from regions where a matching record exists in products with the same id.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08122 | train |
v2 | Schema:
regions (alias: rgn)(name, status, level, code)
schedules(amount, level, date, value)
Task: Retrieve amount from regions that have at least one corresponding entry in schedules sharing the same status.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08123 | train |
v3 | Schema:
orders (alias: ord)(amount, status, level, salary)
employees(date, code, id, status)
Task: Retrieve name from orders with salary above the COUNT(value) of employees rows sharing the same type.
SQL: | SELECT name FROM orders AS ord
WHERE salary > (
SELECT COUNT(value) FROM employees AS emp
WHERE emp.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08124 | train |
v3 | Schema:
tasks (alias: tsk)(value, code, salary, status)
branches(name, amount, status, date)
Task: Find amount from tasks where salary exceeds the count of salary from branches for the same id.
SQL: | SELECT amount FROM tasks AS tsk
WHERE salary > (
SELECT COUNT(salary) FROM branches AS brc
WHERE brc.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08125 | train |
v2 | Schema:
employees (alias: emp)(name, date, value, amount)
invoices(date, amount, name, value)
Task: Retrieve code from employees that have at least one corresponding entry in invoices sharing the same id.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08126 | train |
v1 | Schema:
tasks (alias: tsk)(type, level, date, code)
items(code, name, value, salary)
Task: Find salary from tasks where level appears in items entries with matching code.
SQL: | SELECT salary FROM tasks AS tsk
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "items",
"outer_alias": "tsk",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08127 | train |
v3 | Schema:
transactions (alias: txn)(amount, id, value, type)
regions(date, value, name, level)
Task: Find value from transactions where amount exceeds the count of amount from regions for the same level.
SQL: | SELECT value FROM transactions AS txn
WHERE amount > (
SELECT COUNT(amount) FROM regions AS rgn
WHERE rgn.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08128 | train |
v3 | Schema:
regions (alias: rgn)(level, date, value, status)
categories(id, level, code, type)
Task: Find name from regions where amount exceeds the maximum value from categories for the same code.
SQL: | SELECT name FROM regions AS rgn
WHERE amount > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08129 | train |
v3 | Schema:
managers (alias: mgr)(id, code, type, status)
accounts(amount, salary, status, level)
Task: Find salary from managers where salary exceeds the minimum amount from accounts for the same id.
SQL: | SELECT salary FROM managers AS mgr
WHERE salary > (
SELECT MIN(amount) FROM accounts AS acct
WHERE acct.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08130 | train |
v2 | Schema:
sales (alias: sale)(id, salary, amount, name)
customers(amount, level, date, type)
Task: Retrieve name from sales that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08131 | train |
v1 | Schema:
employees (alias: emp)(date, status, type, salary)
departments(amount, type, value, name)
Task: Retrieve value from employees whose type is found in departments rows where type matches the outer record.
SQL: | SELECT value FROM employees AS emp
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08132 | train |
v2 | Schema:
requests (alias: ordr)(level, name, status, code)
branches(amount, type, name, code)
Task: Retrieve id from requests that have at least one corresponding entry in branches sharing the same level.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08133 | train |
v1 | Schema:
shipments (alias: shp)(value, status, level, type)
transactions(name, code, type, amount)
Task: Find amount from shipments where level appears in transactions entries with matching status.
SQL: | SELECT amount FROM shipments AS shp
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08134 | train |
v3 | Schema:
tasks (alias: tsk)(name, date, value, status)
customers(name, code, type, id)
Task: Find salary from tasks where salary exceeds the count of amount from customers for the same id.
SQL: | SELECT salary FROM tasks AS tsk
WHERE salary > (
SELECT COUNT(amount) FROM customers AS cust
WHERE cust.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "tsk",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08135 | train |
v2 | Schema:
departments (alias: dept)(code, date, level, id)
staff(salary, status, type, name)
Task: Retrieve code from departments that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08136 | train |
v2 | Schema:
categories (alias: catg)(id, code, status, name)
sales(status, type, name, code)
Task: Find id from categories where a matching record exists in sales with the same code.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08137 | train |
v1 | Schema:
invoices (alias: inv)(code, type, level, salary)
categories(salary, level, name, date)
Task: Select id from invoices where id exists in categories for the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08138 | train |
v2 | Schema:
schedules (alias: schd)(level, name, type, salary)
accounts(name, id, date, value)
Task: Find name from schedules where a matching record exists in accounts with the same id.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08139 | train |
v3 | Schema:
tasks (alias: tsk)(id, type, name, level)
transactions(salary, type, level, status)
Task: Find code from tasks where value exceeds the average salary from transactions for the same level.
SQL: | SELECT code FROM tasks AS tsk
WHERE value > (
SELECT AVG(salary) FROM transactions AS txn
WHERE txn.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08140 | train |
v1 | Schema:
accounts (alias: acct)(type, level, status, id)
orders(name, salary, date, id)
Task: Select amount from accounts where status exists in orders for the same level.
SQL: | SELECT amount FROM accounts AS acct
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08141 | train |
v3 | Schema:
shipments (alias: shp)(code, name, amount, value)
schedules(code, salary, amount, status)
Task: Find salary from shipments where salary exceeds the maximum amount from schedules for the same status.
SQL: | SELECT salary FROM shipments AS shp
WHERE salary > (
SELECT MAX(amount) FROM schedules AS schd
WHERE schd.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08142 | train |
v3 | Schema:
staff (alias: empl)(id, type, level, date)
items(value, status, level, amount)
Task: Find name from staff where amount exceeds the minimum salary from items for the same id.
SQL: | SELECT name FROM staff AS empl
WHERE amount > (
SELECT MIN(salary) FROM items AS lne
WHERE lne.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08143 | train |
v2 | Schema:
customers (alias: cust)(level, code, value, amount)
projects(code, amount, type, level)
Task: Find amount from customers where a matching record exists in projects with the same id.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08144 | train |
v1 | Schema:
staff (alias: empl)(status, name, type, salary)
invoices(date, code, type, salary)
Task: Select name from staff where status exists in invoices for the same type.
SQL: | SELECT name FROM staff AS empl
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08145 | train |
v2 | Schema:
products (alias: prod)(value, date, name, id)
sales(salary, date, status, type)
Task: Find code from products where a matching record exists in sales with the same level.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = prod.level
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08146 | train |
v1 | Schema:
tasks (alias: tsk)(type, status, date, salary)
branches(salary, name, level, id)
Task: Find value from tasks where level appears in branches entries with matching id.
SQL: | SELECT value FROM tasks AS tsk
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08147 | train |
v3 | Schema:
customers (alias: cust)(name, amount, id, value)
transactions(salary, status, level, id)
Task: Retrieve code from customers with amount above the COUNT(amount) of transactions rows sharing the same type.
SQL: | SELECT code FROM customers AS cust
WHERE amount > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08148 | train |
v3 | Schema:
sales (alias: sale)(salary, amount, id, value)
shipments(amount, name, value, date)
Task: Find salary from sales where amount exceeds the total amount from shipments for the same level.
SQL: | SELECT salary FROM sales AS sale
WHERE amount > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08149 | train |
v2 | Schema:
orders (alias: ord)(status, date, code, level)
items(id, salary, amount, date)
Task: Find name from orders where a matching record exists in items with the same type.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08150 | train |
v3 | Schema:
orders (alias: ord)(amount, name, level, status)
products(code, type, name, value)
Task: Retrieve id from orders with amount above the COUNT(salary) of products rows sharing the same status.
SQL: | SELECT id FROM orders AS ord
WHERE amount > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08151 | train |
v3 | Schema:
staff (alias: empl)(level, id, type, value)
transactions(name, level, status, date)
Task: Retrieve value from staff with amount above the SUM(amount) of transactions rows sharing the same level.
SQL: | SELECT value FROM staff AS empl
WHERE amount > (
SELECT SUM(amount) FROM transactions AS txn
WHERE txn.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08152 | train |
v3 | Schema:
staff (alias: empl)(date, type, name, code)
transactions(level, type, name, code)
Task: Find code from staff where amount exceeds the count of value from transactions for the same status.
SQL: | SELECT code FROM staff AS empl
WHERE amount > (
SELECT COUNT(value) FROM transactions AS txn
WHERE txn.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08153 | train |
v1 | Schema:
tasks (alias: tsk)(level, status, value, amount)
projects(code, amount, type, value)
Task: Select value from tasks where type exists in projects for the same type.
SQL: | SELECT value FROM tasks AS tsk
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08154 | train |
v3 | Schema:
schedules (alias: schd)(type, value, id, level)
shipments(level, salary, date, id)
Task: Retrieve name from schedules with amount above the COUNT(value) of shipments rows sharing the same id.
SQL: | SELECT name FROM schedules AS schd
WHERE amount > (
SELECT COUNT(value) FROM shipments AS shp
WHERE shp.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08155 | train |
v3 | Schema:
categories (alias: catg)(level, status, code, date)
products(salary, date, value, name)
Task: Find name from categories where salary exceeds the minimum amount from products for the same status.
SQL: | SELECT name FROM categories AS catg
WHERE salary > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08156 | train |
v3 | Schema:
customers (alias: cust)(salary, name, status, amount)
managers(code, id, type, level)
Task: Retrieve amount from customers with value above the MAX(value) of managers rows sharing the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE value > (
SELECT MAX(value) FROM managers AS mgr
WHERE mgr.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08157 | train |
v1 | Schema:
tasks (alias: tsk)(id, code, level, amount)
projects(amount, id, salary, name)
Task: Retrieve salary from tasks whose id is found in projects rows where type matches the outer record.
SQL: | SELECT salary FROM tasks AS tsk
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08158 | train |
v2 | Schema:
orders (alias: ord)(name, code, level, type)
transactions(salary, date, type, id)
Task: Retrieve id from orders that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08159 | train |
v3 | Schema:
customers (alias: cust)(id, salary, level, name)
branches(value, code, type, level)
Task: Find id from customers where amount exceeds the total value from branches for the same code.
SQL: | SELECT id FROM customers AS cust
WHERE amount > (
SELECT SUM(value) FROM branches AS brc
WHERE brc.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "branches",
"outer_alias": "cust",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08160 | train |
v3 | Schema:
orders (alias: ord)(level, value, salary, date)
staff(name, date, status, level)
Task: Retrieve id from orders with value above the AVG(amount) of staff rows sharing the same code.
SQL: | SELECT id FROM orders AS ord
WHERE value > (
SELECT AVG(amount) FROM staff AS empl
WHERE empl.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08161 | train |
v2 | Schema:
sales (alias: sale)(type, status, salary, code)
departments(salary, value, status, id)
Task: Retrieve amount from sales that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08162 | train |
v1 | Schema:
employees (alias: emp)(level, date, code, id)
shipments(date, level, status, salary)
Task: Select code from employees where type exists in shipments for the same id.
SQL: | SELECT code FROM employees AS emp
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08163 | train |
v1 | Schema:
shipments (alias: shp)(name, date, status, id)
employees(date, code, name, id)
Task: Find value from shipments where status appears in employees entries with matching status.
SQL: | SELECT value FROM shipments AS shp
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08164 | train |
v3 | Schema:
customers (alias: cust)(value, status, type, id)
products(name, value, type, level)
Task: Retrieve code from customers with value above the AVG(salary) of products rows sharing the same status.
SQL: | SELECT code FROM customers AS cust
WHERE value > (
SELECT AVG(salary) 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": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08165 | train |
v3 | Schema:
branches (alias: brc)(value, amount, type, code)
regions(date, amount, name, type)
Task: Retrieve amount from branches with value above the COUNT(value) of regions rows sharing the same type.
SQL: | SELECT amount FROM branches AS brc
WHERE value > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08166 | train |
v2 | Schema:
shipments (alias: shp)(salary, code, amount, date)
staff(id, type, salary, amount)
Task: Retrieve name from shipments that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08167 | train |
v3 | Schema:
requests (alias: ordr)(date, id, amount, salary)
customers(status, value, type, name)
Task: Retrieve id from requests with amount above the MIN(value) of customers rows sharing the same type.
SQL: | SELECT id FROM requests AS ordr
WHERE amount > (
SELECT MIN(value) FROM customers AS cust
WHERE cust.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08168 | train |
v3 | Schema:
customers (alias: cust)(value, level, salary, name)
transactions(date, code, id, value)
Task: Retrieve name from customers with amount above the SUM(amount) of transactions rows sharing the same status.
SQL: | SELECT name FROM customers AS cust
WHERE amount > (
SELECT SUM(amount) FROM transactions AS txn
WHERE txn.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08169 | train |
v2 | Schema:
regions (alias: rgn)(status, type, name, code)
projects(id, date, name, level)
Task: Find amount from regions where a matching record exists in projects with the same type.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08170 | train |
v1 | Schema:
staff (alias: empl)(status, name, value, date)
projects(salary, id, name, value)
Task: Find salary from staff where code appears in projects entries with matching type.
SQL: | SELECT salary FROM staff AS empl
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08171 | train |
v1 | Schema:
customers (alias: cust)(status, amount, type, level)
employees(name, type, amount, salary)
Task: Retrieve amount from customers whose status is found in employees rows where level matches the outer record.
SQL: | SELECT amount FROM customers AS cust
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08172 | train |
v3 | Schema:
accounts (alias: acct)(code, salary, value, status)
regions(name, type, date, salary)
Task: Retrieve salary from accounts with value above the COUNT(value) of regions rows sharing the same status.
SQL: | SELECT salary FROM accounts AS acct
WHERE value > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08173 | train |
v1 | Schema:
requests (alias: ordr)(salary, status, date, level)
products(name, salary, date, code)
Task: Find amount from requests where id appears in products entries with matching code.
SQL: | SELECT amount FROM requests AS ordr
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08174 | train |
v3 | Schema:
employees (alias: emp)(name, status, id, code)
transactions(status, amount, date, value)
Task: Find salary from employees where value exceeds the count of amount from transactions for the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE value > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08175 | train |
v1 | Schema:
invoices (alias: inv)(status, id, name, date)
items(date, name, value, status)
Task: Retrieve code from invoices whose level is found in items rows where level matches the outer record.
SQL: | SELECT code FROM invoices AS inv
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08176 | train |
v1 | Schema:
categories (alias: catg)(value, id, name, salary)
customers(amount, value, date, code)
Task: Select name from categories where type exists in customers for the same code.
SQL: | SELECT name FROM categories AS catg
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08177 | train |
v3 | Schema:
branches (alias: brc)(name, amount, value, date)
employees(value, salary, level, name)
Task: Retrieve name from branches with value above the MAX(value) of employees rows sharing the same status.
SQL: | SELECT name FROM branches AS brc
WHERE value > (
SELECT MAX(value) FROM employees AS emp
WHERE emp.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08178 | train |
v1 | Schema:
regions (alias: rgn)(level, date, value, name)
branches(date, status, type, salary)
Task: Find value from regions where level appears in branches entries with matching status.
SQL: | SELECT value FROM regions AS rgn
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08179 | train |
v2 | Schema:
categories (alias: catg)(level, status, salary, amount)
customers(status, amount, name, date)
Task: Find amount from categories where a matching record exists in customers with the same type.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08180 | train |
v2 | Schema:
products (alias: prod)(date, level, type, value)
regions(date, status, code, id)
Task: Find amount from products where a matching record exists in regions with the same level.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = prod.level
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08181 | train |
v2 | Schema:
shipments (alias: shp)(level, salary, type, name)
invoices(date, amount, salary, status)
Task: Find code from shipments where a matching record exists in invoices with the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08182 | train |
v1 | Schema:
managers (alias: mgr)(name, date, code, status)
departments(amount, id, name, status)
Task: Find value from managers where status appears in departments entries with matching code.
SQL: | SELECT value FROM managers AS mgr
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08183 | train |
v3 | Schema:
schedules (alias: schd)(date, status, code, salary)
projects(id, name, date, status)
Task: Find value from schedules where amount exceeds the maximum salary from projects for the same code.
SQL: | SELECT value FROM schedules AS schd
WHERE amount > (
SELECT MAX(salary) FROM projects AS prj
WHERE prj.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08184 | train |
v3 | Schema:
projects (alias: prj)(value, level, id, salary)
accounts(salary, name, id, date)
Task: Find salary from projects where amount exceeds the maximum amount from accounts for the same level.
SQL: | SELECT salary FROM projects AS prj
WHERE amount > (
SELECT MAX(amount) 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": "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_08185 | train |
v3 | Schema:
customers (alias: cust)(type, salary, date, name)
invoices(value, amount, code, type)
Task: Find value from customers where amount exceeds the total salary from invoices for the same code.
SQL: | SELECT value FROM customers AS cust
WHERE amount > (
SELECT SUM(salary) FROM invoices AS inv
WHERE inv.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08186 | train |
v3 | Schema:
employees (alias: emp)(level, amount, date, id)
invoices(type, level, amount, status)
Task: Find code from employees where value exceeds the minimum value from invoices for the same type.
SQL: | SELECT code FROM employees AS emp
WHERE value > (
SELECT MIN(value) FROM invoices AS inv
WHERE inv.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08187 | train |
v2 | Schema:
staff (alias: empl)(salary, value, amount, level)
customers(value, amount, id, date)
Task: Find salary from staff where a matching record exists in customers with the same code.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08188 | train |
v3 | Schema:
products (alias: prod)(name, date, value, code)
branches(name, type, level, value)
Task: Find amount from products where salary exceeds the minimum amount from branches for the same id.
SQL: | SELECT amount FROM products AS prod
WHERE salary > (
SELECT MIN(amount) FROM branches AS brc
WHERE brc.id = prod.id
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08189 | train |
v3 | Schema:
schedules (alias: schd)(id, name, value, level)
orders(type, value, amount, code)
Task: Find amount from schedules where salary exceeds the total amount from orders for the same level.
SQL: | SELECT amount FROM schedules AS schd
WHERE salary > (
SELECT SUM(amount) FROM orders AS ord
WHERE ord.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08190 | train |
v1 | Schema:
branches (alias: brc)(id, code, name, date)
projects(salary, id, level, type)
Task: Retrieve name from branches whose level is found in projects rows where code matches the outer record.
SQL: | SELECT name FROM branches AS brc
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08191 | train |
v2 | Schema:
employees (alias: emp)(salary, amount, status, code)
categories(code, id, level, amount)
Task: Retrieve salary from employees that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08192 | train |
v3 | Schema:
managers (alias: mgr)(value, code, salary, name)
schedules(value, code, type, amount)
Task: Find value from managers where value exceeds the count of amount from schedules for the same code.
SQL: | SELECT value FROM managers AS mgr
WHERE value > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "value",
"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_08193 | train |
v2 | Schema:
branches (alias: brc)(level, type, value, name)
tasks(value, code, salary, name)
Task: Find amount from branches where a matching record exists in tasks with the same status.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08194 | train |
v1 | Schema:
requests (alias: ordr)(id, level, code, amount)
items(status, salary, code, id)
Task: Select value from requests where status exists in items for the same id.
SQL: | SELECT value FROM requests AS ordr
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08195 | train |
v2 | Schema:
invoices (alias: inv)(level, salary, status, value)
accounts(amount, salary, id, name)
Task: Retrieve name from invoices that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08196 | train |
v3 | Schema:
invoices (alias: inv)(type, salary, amount, code)
schedules(salary, code, type, level)
Task: Retrieve salary from invoices with salary above the AVG(value) of schedules rows sharing the same level.
SQL: | SELECT salary FROM invoices AS inv
WHERE salary > (
SELECT AVG(value) FROM schedules AS schd
WHERE schd.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08197 | train |
v1 | Schema:
transactions (alias: txn)(status, salary, value, amount)
products(code, status, id, value)
Task: Select code from transactions where level exists in products for the same id.
SQL: | SELECT code FROM transactions AS txn
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08198 | train |
v1 | Schema:
regions (alias: rgn)(amount, value, id, level)
customers(date, code, value, salary)
Task: Retrieve name from regions whose id is found in customers rows where level matches the outer record.
SQL: | SELECT name FROM regions AS rgn
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08199 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.