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:
transactions (alias: txn)(amount, code, name, type)
staff(id, status, code, type)
Task: Find amount from transactions where salary exceeds the total salary from staff for the same code.
SQL: | SELECT amount FROM transactions AS txn
WHERE salary > (
SELECT SUM(salary) FROM staff AS empl
WHERE empl.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "amount",
"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_13200 | train |
v1 | Schema:
orders (alias: ord)(date, value, level, type)
projects(level, id, code, value)
Task: Retrieve id from orders whose status is found in projects rows where level matches the outer record.
SQL: | SELECT id FROM orders AS ord
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13201 | train |
v3 | Schema:
customers (alias: cust)(id, salary, level, name)
shipments(status, level, date, type)
Task: Find code from customers where value exceeds the average value from shipments for the same level.
SQL: | SELECT code FROM customers AS cust
WHERE value > (
SELECT AVG(value) FROM shipments AS shp
WHERE shp.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13202 | train |
v1 | Schema:
categories (alias: catg)(salary, code, type, amount)
projects(id, name, code, amount)
Task: Select salary from categories where level exists in projects for the same status.
SQL: | SELECT salary FROM categories AS catg
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13203 | train |
v2 | Schema:
categories (alias: catg)(id, amount, code, value)
departments(name, date, id, type)
Task: Retrieve salary from categories that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13204 | train |
v1 | Schema:
departments (alias: dept)(name, date, code, salary)
tasks(value, type, name, status)
Task: Find value from departments where code appears in tasks entries with matching id.
SQL: | SELECT value FROM departments AS dept
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13205 | train |
v1 | Schema:
managers (alias: mgr)(name, salary, amount, id)
sales(name, status, code, salary)
Task: Select amount from managers where code exists in sales for the same status.
SQL: | SELECT amount FROM managers AS mgr
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13206 | train |
v1 | Schema:
schedules (alias: schd)(amount, name, level, date)
invoices(level, value, amount, name)
Task: Retrieve name from schedules whose code is found in invoices rows where code matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13207 | train |
v2 | Schema:
sales (alias: sale)(date, level, id, name)
staff(date, level, salary, value)
Task: Retrieve code from sales that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13208 | train |
v1 | Schema:
employees (alias: emp)(amount, code, salary, name)
requests(amount, type, id, value)
Task: Retrieve code from employees whose level is found in requests rows where level matches the outer record.
SQL: | SELECT code FROM employees AS emp
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13209 | train |
v3 | Schema:
projects (alias: prj)(id, amount, level, code)
employees(code, status, value, level)
Task: Find salary from projects where salary exceeds the count of salary from employees for the same status.
SQL: | SELECT salary FROM projects AS prj
WHERE salary > (
SELECT COUNT(salary) FROM employees AS emp
WHERE emp.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13210 | train |
v3 | Schema:
managers (alias: mgr)(amount, type, id, level)
transactions(code, type, level, amount)
Task: Find name from managers where salary exceeds the minimum amount from transactions for the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE salary > (
SELECT MIN(amount) FROM transactions AS txn
WHERE txn.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "name",
"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_13211 | train |
v3 | Schema:
categories (alias: catg)(value, name, date, status)
transactions(level, id, amount, code)
Task: Find salary from categories where salary exceeds the minimum salary from transactions for the same level.
SQL: | SELECT salary FROM categories AS catg
WHERE salary > (
SELECT MIN(salary) FROM transactions AS txn
WHERE txn.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13212 | train |
v3 | Schema:
categories (alias: catg)(level, type, name, value)
shipments(level, date, salary, amount)
Task: Retrieve value from categories with salary above the COUNT(salary) of shipments rows sharing the same id.
SQL: | SELECT value FROM categories AS catg
WHERE salary > (
SELECT COUNT(salary) FROM shipments AS shp
WHERE shp.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13213 | train |
v2 | Schema:
items (alias: lne)(date, value, level, salary)
departments(code, amount, status, value)
Task: Find id from items where a matching record exists in departments with the same id.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = lne.id
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13214 | train |
v2 | Schema:
departments (alias: dept)(name, value, salary, type)
tasks(id, amount, value, level)
Task: Retrieve code from departments that have at least one corresponding entry in tasks sharing the same status.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13215 | train |
v1 | Schema:
items (alias: lne)(salary, amount, status, name)
requests(level, value, amount, id)
Task: Retrieve id from items whose code is found in requests rows where code matches the outer record.
SQL: | SELECT id FROM items AS lne
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13216 | train |
v1 | Schema:
employees (alias: emp)(amount, level, date, type)
staff(date, salary, id, status)
Task: Find salary from employees where status appears in staff entries with matching code.
SQL: | SELECT salary FROM employees AS emp
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13217 | train |
v1 | Schema:
products (alias: prod)(value, amount, id, date)
managers(salary, status, amount, level)
Task: Find salary from products where type appears in managers entries with matching status.
SQL: | SELECT salary FROM products AS prod
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.status = prod.status
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13218 | train |
v2 | Schema:
shipments (alias: shp)(salary, status, level, code)
branches(type, name, value, status)
Task: Retrieve amount from shipments that have at least one corresponding entry in branches sharing the same level.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13219 | train |
v3 | Schema:
regions (alias: rgn)(name, amount, code, level)
items(id, value, salary, name)
Task: Find code from regions where value exceeds the total amount from items for the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE value > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13220 | train |
v2 | Schema:
accounts (alias: acct)(name, amount, salary, type)
requests(status, salary, name, amount)
Task: Retrieve salary from accounts that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13221 | train |
v2 | Schema:
schedules (alias: schd)(id, code, date, name)
items(level, salary, status, id)
Task: Find value from schedules where a matching record exists in items with the same id.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13222 | train |
v1 | Schema:
employees (alias: emp)(salary, name, type, value)
requests(code, date, amount, status)
Task: Retrieve name from employees whose code is found in requests rows where status matches the outer record.
SQL: | SELECT name FROM employees AS emp
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13223 | train |
v1 | Schema:
sales (alias: sale)(amount, type, date, name)
shipments(id, value, date, type)
Task: Retrieve salary from sales whose type is found in shipments rows where id matches the outer record.
SQL: | SELECT salary FROM sales AS sale
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13224 | train |
v1 | Schema:
accounts (alias: acct)(amount, id, salary, value)
managers(status, name, type, id)
Task: Select amount from accounts where status exists in managers for the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13225 | train |
v3 | Schema:
orders (alias: ord)(date, status, salary, id)
departments(date, status, id, type)
Task: Find code from orders where amount exceeds the minimum amount from departments for the same level.
SQL: | SELECT code FROM orders AS ord
WHERE amount > (
SELECT MIN(amount) FROM departments AS dept
WHERE dept.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13226 | train |
v3 | Schema:
products (alias: prod)(value, code, name, salary)
branches(status, amount, code, name)
Task: Retrieve code from products with amount above the COUNT(salary) of branches rows sharing the same level.
SQL: | SELECT code FROM products AS prod
WHERE amount > (
SELECT COUNT(salary) FROM branches AS brc
WHERE brc.level = prod.level
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13227 | train |
v1 | Schema:
transactions (alias: txn)(name, id, salary, level)
regions(date, value, salary, id)
Task: Retrieve name from transactions whose id is found in regions rows where id matches the outer record.
SQL: | SELECT name FROM transactions AS txn
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13228 | train |
v3 | Schema:
categories (alias: catg)(status, value, date, amount)
invoices(salary, id, date, name)
Task: Retrieve salary from categories with value above the AVG(value) of invoices rows sharing the same status.
SQL: | SELECT salary FROM categories AS catg
WHERE value > (
SELECT AVG(value) FROM invoices AS inv
WHERE inv.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13229 | train |
v3 | Schema:
accounts (alias: acct)(value, level, salary, code)
staff(code, status, type, level)
Task: Retrieve amount from accounts with salary above the MIN(salary) of staff rows sharing the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE salary > (
SELECT MIN(salary) FROM staff AS empl
WHERE empl.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13230 | train |
v1 | Schema:
employees (alias: emp)(name, salary, amount, type)
schedules(date, id, level, code)
Task: Retrieve name from employees whose status is found in schedules rows where status matches the outer record.
SQL: | SELECT name FROM employees AS emp
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13231 | train |
v2 | Schema:
schedules (alias: schd)(name, salary, value, level)
transactions(amount, name, level, type)
Task: Find id from schedules where a matching record exists in transactions with the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13232 | train |
v1 | Schema:
products (alias: prod)(code, value, date, salary)
transactions(id, level, salary, status)
Task: Select id from products where code exists in transactions for the same status.
SQL: | SELECT id FROM products AS prod
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.status = prod.status
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13233 | train |
v2 | Schema:
schedules (alias: schd)(date, level, value, code)
departments(salary, code, date, level)
Task: Find salary from schedules where a matching record exists in departments with the same level.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13234 | train |
v3 | Schema:
items (alias: lne)(amount, code, salary, id)
sales(name, id, status, value)
Task: Retrieve name from items with amount above the COUNT(value) of sales rows sharing the same code.
SQL: | SELECT name FROM items AS lne
WHERE amount > (
SELECT COUNT(value) FROM sales AS sale
WHERE sale.code = lne.code
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13235 | train |
v1 | Schema:
departments (alias: dept)(date, level, status, id)
regions(id, date, amount, code)
Task: Find salary from departments where type appears in regions entries with matching type.
SQL: | SELECT salary FROM departments AS dept
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13236 | train |
v1 | Schema:
customers (alias: cust)(salary, type, status, value)
accounts(date, name, salary, id)
Task: Retrieve amount from customers whose status is found in accounts rows where status matches the outer record.
SQL: | SELECT amount FROM customers AS cust
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13237 | train |
v1 | Schema:
products (alias: prod)(code, type, salary, date)
managers(name, date, code, value)
Task: Find salary from products where id appears in managers entries with matching status.
SQL: | SELECT salary FROM products AS prod
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.status = prod.status
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13238 | train |
v2 | Schema:
departments (alias: dept)(date, status, id, code)
branches(id, salary, date, amount)
Task: Find name from departments where a matching record exists in branches with the same code.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13239 | train |
v2 | Schema:
invoices (alias: inv)(level, status, amount, value)
items(code, value, status, name)
Task: Find amount from invoices where a matching record exists in items with the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13240 | train |
v3 | Schema:
items (alias: lne)(name, type, status, date)
shipments(type, level, code, name)
Task: Retrieve value from items with amount above the AVG(salary) of shipments rows sharing the same code.
SQL: | SELECT value FROM items AS lne
WHERE amount > (
SELECT AVG(salary) FROM shipments AS shp
WHERE shp.code = lne.code
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13241 | train |
v3 | Schema:
managers (alias: mgr)(name, date, id, type)
regions(status, code, value, salary)
Task: Find salary from managers where amount exceeds the minimum amount from regions for the same level.
SQL: | SELECT salary FROM managers AS mgr
WHERE amount > (
SELECT MIN(amount) FROM regions AS rgn
WHERE rgn.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13242 | train |
v1 | Schema:
sales (alias: sale)(code, amount, date, value)
schedules(salary, value, level, name)
Task: Find code from sales where level appears in schedules entries with matching code.
SQL: | SELECT code FROM sales AS sale
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13243 | train |
v2 | Schema:
projects (alias: prj)(id, value, level, date)
orders(code, value, type, amount)
Task: Retrieve name from projects that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "orders",
"outer_alias": "prj",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13244 | train |
v3 | Schema:
products (alias: prod)(id, code, salary, level)
branches(type, value, salary, status)
Task: Retrieve code from products with salary above the COUNT(value) of branches rows sharing the same status.
SQL: | SELECT code FROM products AS prod
WHERE salary > (
SELECT COUNT(value) FROM branches AS brc
WHERE brc.status = prod.status
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13245 | train |
v1 | Schema:
products (alias: prod)(salary, id, value, code)
invoices(value, salary, id, level)
Task: Find salary from products where type appears in invoices entries with matching level.
SQL: | SELECT salary FROM products AS prod
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.level = prod.level
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13246 | train |
v2 | Schema:
staff (alias: empl)(date, name, level, code)
products(status, value, amount, salary)
Task: Retrieve name from staff that have at least one corresponding entry in products sharing the same code.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13247 | train |
v3 | Schema:
tasks (alias: tsk)(id, salary, value, code)
transactions(value, date, status, name)
Task: Retrieve value from tasks with value above the MAX(amount) of transactions rows sharing the same status.
SQL: | SELECT value FROM tasks AS tsk
WHERE value > (
SELECT MAX(amount) FROM transactions AS txn
WHERE txn.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13248 | train |
v3 | Schema:
tasks (alias: tsk)(code, name, level, amount)
customers(amount, level, status, salary)
Task: Retrieve name from tasks with value above the SUM(value) of customers rows sharing the same type.
SQL: | SELECT name FROM tasks AS tsk
WHERE value > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "tsk",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13249 | train |
v3 | Schema:
accounts (alias: acct)(value, date, name, salary)
orders(amount, id, salary, name)
Task: Retrieve salary from accounts with value above the AVG(salary) of orders rows sharing the same level.
SQL: | SELECT salary FROM accounts AS acct
WHERE value > (
SELECT AVG(salary) FROM orders AS ord
WHERE ord.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13250 | train |
v3 | Schema:
requests (alias: ordr)(code, amount, type, status)
customers(salary, value, name, level)
Task: Retrieve value from requests with value above the COUNT(amount) of customers rows sharing the same status.
SQL: | SELECT value FROM requests AS ordr
WHERE value > (
SELECT COUNT(amount) FROM customers AS cust
WHERE cust.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13251 | train |
v2 | Schema:
sales (alias: sale)(code, id, amount, level)
customers(status, amount, salary, code)
Task: Find code from sales where a matching record exists in customers with the same type.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13252 | train |
v3 | Schema:
tasks (alias: tsk)(date, value, salary, amount)
invoices(salary, code, type, status)
Task: Find value from tasks where value exceeds the maximum value from invoices for the same status.
SQL: | SELECT value FROM tasks AS tsk
WHERE value > (
SELECT MAX(value) FROM invoices AS inv
WHERE inv.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13253 | train |
v3 | Schema:
staff (alias: empl)(date, status, salary, value)
orders(date, id, status, type)
Task: Retrieve code from staff with salary above the MAX(salary) of orders rows sharing the same status.
SQL: | SELECT code FROM staff AS empl
WHERE salary > (
SELECT MAX(salary) FROM orders AS ord
WHERE ord.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13254 | train |
v1 | Schema:
shipments (alias: shp)(date, amount, id, status)
branches(type, id, date, name)
Task: Retrieve salary from shipments whose id is found in branches rows where status matches the outer record.
SQL: | SELECT salary FROM shipments AS shp
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13255 | train |
v3 | Schema:
departments (alias: dept)(type, level, name, id)
accounts(status, date, name, code)
Task: Find id from departments where salary exceeds the total value from accounts for the same type.
SQL: | SELECT id FROM departments AS dept
WHERE salary > (
SELECT SUM(value) FROM accounts AS acct
WHERE acct.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13256 | train |
v1 | Schema:
tasks (alias: tsk)(amount, status, id, code)
departments(type, date, status, level)
Task: Retrieve name from tasks whose id is found in departments rows where id matches the outer record.
SQL: | SELECT name FROM tasks AS tsk
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "tsk",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13257 | train |
v2 | Schema:
categories (alias: catg)(status, date, level, code)
managers(status, amount, type, date)
Task: Find value from categories where a matching record exists in managers with the same type.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13258 | train |
v1 | Schema:
managers (alias: mgr)(id, type, date, salary)
sales(code, amount, status, name)
Task: Select salary from managers where level exists in sales for the same status.
SQL: | SELECT salary FROM managers AS mgr
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13259 | train |
v2 | Schema:
projects (alias: prj)(level, status, date, value)
departments(id, salary, level, amount)
Task: Find name from projects where a matching record exists in departments with the same status.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13260 | train |
v2 | Schema:
categories (alias: catg)(salary, type, value, name)
items(status, level, type, id)
Task: Retrieve name from categories that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13261 | train |
v2 | Schema:
schedules (alias: schd)(status, type, value, date)
regions(name, salary, code, value)
Task: Retrieve code from schedules that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13262 | train |
v2 | Schema:
shipments (alias: shp)(value, amount, name, status)
managers(id, name, value, type)
Task: Retrieve amount from shipments that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13263 | train |
v1 | Schema:
staff (alias: empl)(id, amount, salary, type)
accounts(value, date, type, id)
Task: Select value from staff where level exists in accounts for the same type.
SQL: | SELECT value FROM staff AS empl
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13264 | train |
v2 | Schema:
orders (alias: ord)(code, id, name, type)
managers(amount, id, code, type)
Task: Find amount from orders where a matching record exists in managers with the same code.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13265 | train |
v1 | Schema:
sales (alias: sale)(date, id, amount, type)
categories(amount, name, status, value)
Task: Find amount from sales where code appears in categories entries with matching level.
SQL: | SELECT amount FROM sales AS sale
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13266 | train |
v3 | Schema:
departments (alias: dept)(date, amount, code, type)
managers(id, type, code, level)
Task: Find value from departments where salary exceeds the maximum amount from managers for the same id.
SQL: | SELECT value FROM departments AS dept
WHERE salary > (
SELECT MAX(amount) FROM managers AS mgr
WHERE mgr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13267 | train |
v1 | Schema:
accounts (alias: acct)(salary, level, status, id)
managers(amount, name, level, date)
Task: Select amount from accounts where status exists in managers for the same level.
SQL: | SELECT amount FROM accounts AS acct
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13268 | train |
v2 | Schema:
products (alias: prod)(type, name, date, level)
customers(type, level, code, name)
Task: Find code from products where a matching record exists in customers with the same id.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = prod.id
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13269 | train |
v2 | Schema:
requests (alias: ordr)(id, level, code, date)
regions(salary, level, amount, name)
Task: Find code from requests where a matching record exists in regions with the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13270 | train |
v1 | Schema:
branches (alias: brc)(status, id, type, salary)
shipments(status, type, level, name)
Task: Retrieve amount from branches whose status is found in shipments rows where code matches the outer record.
SQL: | SELECT amount FROM branches AS brc
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13271 | train |
v2 | Schema:
employees (alias: emp)(level, date, type, status)
shipments(date, amount, level, status)
Task: Find name from employees where a matching record exists in shipments with the same type.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13272 | train |
v2 | Schema:
employees (alias: emp)(date, id, amount, value)
sales(value, name, level, code)
Task: Retrieve amount from employees that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13273 | train |
v3 | Schema:
transactions (alias: txn)(amount, salary, code, status)
branches(code, status, id, type)
Task: Find id from transactions where salary exceeds the total value from branches for the same level.
SQL: | SELECT id FROM transactions AS txn
WHERE salary > (
SELECT SUM(value) FROM branches AS brc
WHERE brc.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13274 | train |
v3 | Schema:
shipments (alias: shp)(value, salary, id, amount)
requests(date, code, name, id)
Task: Find value from shipments where salary exceeds the total salary from requests for the same id.
SQL: | SELECT value FROM shipments AS shp
WHERE salary > (
SELECT SUM(salary) FROM requests AS ordr
WHERE ordr.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13275 | train |
v1 | Schema:
transactions (alias: txn)(name, date, status, code)
items(status, code, type, value)
Task: Select id from transactions where type exists in items for the same level.
SQL: | SELECT id FROM transactions AS txn
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13276 | train |
v3 | Schema:
schedules (alias: schd)(id, value, status, date)
requests(status, id, level, code)
Task: Find code from schedules where salary exceeds the average salary from requests for the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE salary > (
SELECT AVG(salary) FROM requests AS ordr
WHERE ordr.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13277 | train |
v3 | Schema:
tasks (alias: tsk)(date, id, salary, type)
schedules(status, value, date, id)
Task: Retrieve code from tasks with amount above the AVG(salary) of schedules rows sharing the same status.
SQL: | SELECT code FROM tasks AS tsk
WHERE amount > (
SELECT AVG(salary) FROM schedules AS schd
WHERE schd.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13278 | train |
v1 | Schema:
shipments (alias: shp)(name, type, level, value)
orders(level, status, salary, name)
Task: Select salary from shipments where code exists in orders for the same code.
SQL: | SELECT salary FROM shipments AS shp
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13279 | train |
v3 | Schema:
orders (alias: ord)(name, value, date, type)
products(date, status, type, code)
Task: Find name from orders where amount exceeds the count of amount from products for the same status.
SQL: | SELECT name FROM orders AS ord
WHERE amount > (
SELECT COUNT(amount) FROM products AS prod
WHERE prod.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13280 | train |
v2 | Schema:
regions (alias: rgn)(id, salary, status, value)
departments(value, date, status, amount)
Task: Retrieve code from regions that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13281 | train |
v1 | Schema:
orders (alias: ord)(amount, status, salary, level)
invoices(date, id, amount, salary)
Task: Find value from orders where type appears in invoices entries with matching level.
SQL: | SELECT value FROM orders AS ord
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13282 | train |
v3 | Schema:
managers (alias: mgr)(code, status, type, amount)
departments(code, amount, salary, status)
Task: Retrieve id from managers with value above the SUM(value) of departments rows sharing the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE value > (
SELECT SUM(value) FROM departments AS dept
WHERE dept.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13283 | train |
v1 | Schema:
products (alias: prod)(amount, salary, id, level)
tasks(type, value, level, name)
Task: Find salary from products where type appears in tasks entries with matching id.
SQL: | SELECT salary FROM products AS prod
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.id = prod.id
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13284 | train |
v2 | Schema:
customers (alias: cust)(code, name, amount, status)
shipments(id, value, code, name)
Task: Find id from customers where a matching record exists in shipments with the same id.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13285 | train |
v1 | Schema:
requests (alias: ordr)(name, type, code, level)
managers(name, level, date, value)
Task: Select id from requests where type exists in managers for the same status.
SQL: | SELECT id FROM requests AS ordr
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13286 | train |
v2 | Schema:
invoices (alias: inv)(name, level, id, status)
customers(salary, level, value, status)
Task: Find amount from invoices where a matching record exists in customers with the same status.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13287 | train |
v2 | Schema:
transactions (alias: txn)(salary, type, status, name)
shipments(status, level, code, amount)
Task: Find code from transactions where a matching record exists in shipments with the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13288 | train |
v2 | Schema:
tasks (alias: tsk)(status, id, value, code)
projects(code, type, id, status)
Task: Retrieve id from tasks that have at least one corresponding entry in projects sharing the same id.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13289 | train |
v2 | Schema:
orders (alias: ord)(name, salary, id, value)
products(type, salary, name, id)
Task: Find salary from orders where a matching record exists in products with the same id.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13290 | train |
v1 | Schema:
shipments (alias: shp)(name, code, status, salary)
orders(code, id, value, level)
Task: Find id from shipments where status appears in orders entries with matching level.
SQL: | SELECT id FROM shipments AS shp
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13291 | train |
v1 | Schema:
categories (alias: catg)(amount, value, date, id)
departments(salary, name, type, code)
Task: Find id from categories where code appears in departments entries with matching status.
SQL: | SELECT id FROM categories AS catg
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13292 | train |
v3 | Schema:
categories (alias: catg)(amount, value, name, status)
items(type, id, value, salary)
Task: Find amount from categories where value exceeds the minimum amount from items for the same code.
SQL: | SELECT amount FROM categories AS catg
WHERE value > (
SELECT MIN(amount) FROM items AS lne
WHERE lne.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13293 | train |
v3 | Schema:
accounts (alias: acct)(salary, date, type, code)
managers(name, code, amount, salary)
Task: Retrieve value from accounts with salary above the AVG(salary) of managers rows sharing the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE salary > (
SELECT AVG(salary) FROM managers AS mgr
WHERE mgr.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13294 | train |
v3 | Schema:
customers (alias: cust)(code, salary, amount, id)
tasks(salary, name, level, value)
Task: Retrieve salary from customers with salary above the MIN(amount) of tasks rows sharing the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE salary > (
SELECT MIN(amount) FROM tasks AS tsk
WHERE tsk.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "tasks",
"outer_alias": "cust",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13295 | train |
v1 | Schema:
items (alias: lne)(id, level, status, salary)
employees(amount, status, level, type)
Task: Select id from items where type exists in employees for the same level.
SQL: | SELECT id FROM items AS lne
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.level = lne.level
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13296 | train |
v2 | Schema:
employees (alias: emp)(type, salary, name, code)
categories(amount, salary, value, name)
Task: Retrieve id from employees that have at least one corresponding entry in categories sharing the same level.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13297 | train |
v1 | Schema:
staff (alias: empl)(name, date, type, level)
departments(name, level, code, date)
Task: Retrieve salary from staff whose status is found in departments rows where code matches the outer record.
SQL: | SELECT salary FROM staff AS empl
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13298 | train |
v2 | Schema:
sales (alias: sale)(value, salary, id, amount)
managers(type, code, salary, status)
Task: Retrieve value from sales that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13299 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.