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:
categories (alias: catg)(name, status, value, id)
requests(status, type, amount, level)
Task: Select code from categories where level exists in requests for the same code.
SQL: | SELECT code FROM categories AS catg
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03100 | train |
v2 | Schema:
branches (alias: brc)(salary, date, value, status)
tasks(amount, id, level, name)
Task: Find code from branches where a matching record exists in tasks with the same type.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03101 | train |
v1 | Schema:
accounts (alias: acct)(salary, id, level, date)
products(code, status, amount, level)
Task: Retrieve salary from accounts whose code is found in products rows where id matches the outer record.
SQL: | SELECT salary FROM accounts AS acct
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03102 | train |
v1 | Schema:
accounts (alias: acct)(code, type, date, status)
managers(id, status, code, value)
Task: Retrieve amount from accounts whose type is found in managers rows where id matches the outer record.
SQL: | SELECT amount FROM accounts AS acct
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03103 | train |
v3 | Schema:
staff (alias: empl)(code, amount, id, date)
invoices(value, status, level, code)
Task: Find salary from staff where value exceeds the average salary from invoices for the same code.
SQL: | SELECT salary FROM staff AS empl
WHERE value > (
SELECT AVG(salary) FROM invoices AS inv
WHERE inv.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03104 | train |
v1 | Schema:
customers (alias: cust)(value, salary, id, level)
managers(type, level, status, id)
Task: Select id from customers where status exists in managers for the same status.
SQL: | SELECT id FROM customers AS cust
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03105 | train |
v3 | Schema:
invoices (alias: inv)(code, value, status, type)
orders(amount, value, type, code)
Task: Find value from invoices where value exceeds the total amount from orders for the same status.
SQL: | SELECT value FROM invoices AS inv
WHERE value > (
SELECT SUM(amount) FROM orders AS ord
WHERE ord.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03106 | train |
v3 | Schema:
managers (alias: mgr)(status, code, type, date)
customers(name, type, salary, level)
Task: Retrieve value from managers with amount above the SUM(value) of customers rows sharing the same status.
SQL: | SELECT value FROM managers AS mgr
WHERE amount > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03107 | train |
v1 | Schema:
requests (alias: ordr)(level, type, date, id)
shipments(code, status, salary, level)
Task: Find value from requests where status appears in shipments entries with matching id.
SQL: | SELECT value FROM requests AS ordr
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03108 | train |
v3 | Schema:
branches (alias: brc)(value, date, type, id)
managers(name, level, id, date)
Task: Find amount from branches where value exceeds the total amount from managers for the same type.
SQL: | SELECT amount FROM branches AS brc
WHERE value > (
SELECT SUM(amount) FROM managers AS mgr
WHERE mgr.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "managers",
"outer_alias": "brc",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03109 | train |
v3 | Schema:
departments (alias: dept)(name, date, code, amount)
projects(status, level, name, value)
Task: Retrieve amount from departments with salary above the MAX(amount) of projects rows sharing the same code.
SQL: | SELECT amount FROM departments AS dept
WHERE salary > (
SELECT MAX(amount) FROM projects AS prj
WHERE prj.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03110 | train |
v3 | Schema:
projects (alias: prj)(type, name, value, level)
transactions(date, status, name, code)
Task: Retrieve salary from projects with value above the AVG(salary) of transactions rows sharing the same code.
SQL: | SELECT salary FROM projects AS prj
WHERE value > (
SELECT AVG(salary) FROM transactions AS txn
WHERE txn.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03111 | train |
v3 | Schema:
tasks (alias: tsk)(code, status, level, date)
regions(status, amount, salary, date)
Task: Find id from tasks where amount exceeds the count of salary from regions for the same type.
SQL: | SELECT id FROM tasks AS tsk
WHERE amount > (
SELECT COUNT(salary) FROM regions AS rgn
WHERE rgn.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03112 | train |
v2 | Schema:
accounts (alias: acct)(value, date, id, amount)
categories(code, id, date, status)
Task: Find salary from accounts where a matching record exists in categories with the same id.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03113 | train |
v2 | Schema:
employees (alias: emp)(name, id, type, amount)
products(type, date, code, amount)
Task: Find id from employees where a matching record exists in products with the same type.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03114 | train |
v2 | Schema:
projects (alias: prj)(type, date, salary, name)
employees(level, name, status, value)
Task: Find id from projects where a matching record exists in employees with the same code.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03115 | train |
v1 | Schema:
staff (alias: empl)(id, name, code, salary)
customers(value, salary, amount, date)
Task: Find code from staff where code appears in customers entries with matching type.
SQL: | SELECT code FROM staff AS empl
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03116 | train |
v3 | Schema:
invoices (alias: inv)(salary, status, level, code)
accounts(level, code, id, salary)
Task: Find code from invoices where value exceeds the maximum value from accounts for the same code.
SQL: | SELECT code FROM invoices AS inv
WHERE value > (
SELECT MAX(value) FROM accounts AS acct
WHERE acct.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03117 | train |
v1 | Schema:
invoices (alias: inv)(status, name, type, code)
employees(code, id, date, type)
Task: Select amount from invoices where id exists in employees for the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03118 | train |
v1 | Schema:
orders (alias: ord)(value, date, status, id)
branches(salary, level, id, date)
Task: Retrieve amount from orders whose level is found in branches rows where code matches the outer record.
SQL: | SELECT amount FROM orders AS ord
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03119 | train |
v1 | Schema:
tasks (alias: tsk)(value, code, date, amount)
schedules(salary, date, value, name)
Task: Select code from tasks where level exists in schedules for the same type.
SQL: | SELECT code FROM tasks AS tsk
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03120 | train |
v3 | Schema:
tasks (alias: tsk)(name, salary, status, id)
categories(amount, level, status, date)
Task: Find id from tasks where salary exceeds the average amount from categories for the same code.
SQL: | SELECT id FROM tasks AS tsk
WHERE salary > (
SELECT AVG(amount) FROM categories AS catg
WHERE catg.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03121 | train |
v3 | Schema:
products (alias: prod)(salary, name, code, level)
branches(level, type, code, status)
Task: Find code from products where amount exceeds the average salary from branches for the same level.
SQL: | SELECT code FROM products AS prod
WHERE amount > (
SELECT AVG(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": "AVG",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03122 | train |
v3 | Schema:
orders (alias: ord)(date, name, code, level)
products(status, type, level, amount)
Task: Find name from orders where value exceeds the maximum amount from products for the same status.
SQL: | SELECT name FROM orders AS ord
WHERE value > (
SELECT MAX(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": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03123 | train |
v2 | Schema:
branches (alias: brc)(amount, date, name, code)
orders(salary, amount, type, id)
Task: Retrieve salary from branches that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03124 | train |
v3 | Schema:
staff (alias: empl)(name, status, salary, value)
requests(date, type, level, salary)
Task: Retrieve salary from staff with value above the AVG(amount) of requests rows sharing the same type.
SQL: | SELECT salary FROM staff AS empl
WHERE value > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03125 | train |
v2 | Schema:
managers (alias: mgr)(level, code, amount, id)
sales(level, amount, value, status)
Task: Retrieve code from managers that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03126 | train |
v1 | Schema:
products (alias: prod)(id, level, type, name)
requests(status, id, type, amount)
Task: Select code from products where id exists in requests for the same code.
SQL: | SELECT code FROM products AS prod
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.code = prod.code
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03127 | train |
v2 | Schema:
orders (alias: ord)(amount, level, value, date)
departments(status, value, salary, amount)
Task: Find salary from orders where a matching record exists in departments with the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03128 | train |
v2 | Schema:
shipments (alias: shp)(level, date, name, code)
customers(status, salary, code, type)
Task: Retrieve code from shipments that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03129 | train |
v2 | Schema:
projects (alias: prj)(level, amount, name, id)
branches(date, amount, status, value)
Task: Retrieve amount from projects that have at least one corresponding entry in branches sharing the same type.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03130 | train |
v1 | Schema:
transactions (alias: txn)(status, amount, name, code)
schedules(value, level, code, salary)
Task: Select id from transactions where id exists in schedules for the same type.
SQL: | SELECT id FROM transactions AS txn
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03131 | train |
v2 | Schema:
employees (alias: emp)(status, name, value, id)
staff(code, type, level, status)
Task: Find name from employees where a matching record exists in staff with the same level.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03132 | train |
v3 | Schema:
products (alias: prod)(value, level, type, id)
items(amount, value, id, salary)
Task: Find name from products where amount exceeds the maximum amount from items for the same type.
SQL: | SELECT name FROM products AS prod
WHERE amount > (
SELECT MAX(amount) FROM items AS lne
WHERE lne.type = prod.type
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03133 | train |
v2 | Schema:
regions (alias: rgn)(type, name, code, level)
categories(salary, amount, value, date)
Task: Retrieve amount from regions that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03134 | train |
v3 | Schema:
sales (alias: sale)(level, type, value, status)
requests(status, amount, name, salary)
Task: Retrieve salary from sales with salary above the COUNT(value) of requests rows sharing the same code.
SQL: | SELECT salary FROM sales AS sale
WHERE salary > (
SELECT COUNT(value) FROM requests AS ordr
WHERE ordr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03135 | train |
v2 | Schema:
categories (alias: catg)(id, status, name, amount)
managers(date, salary, value, id)
Task: Retrieve code from categories that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03136 | train |
v2 | Schema:
regions (alias: rgn)(level, code, type, amount)
shipments(id, level, salary, type)
Task: Find name from regions where a matching record exists in shipments with the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03137 | train |
v1 | Schema:
accounts (alias: acct)(date, amount, type, salary)
customers(name, amount, code, salary)
Task: Find salary from accounts where code appears in customers entries with matching code.
SQL: | SELECT salary FROM accounts AS acct
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03138 | train |
v3 | Schema:
shipments (alias: shp)(name, status, level, id)
employees(id, level, salary, name)
Task: Retrieve name from shipments with amount above the COUNT(salary) of employees rows sharing the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE amount > (
SELECT COUNT(salary) FROM employees AS emp
WHERE emp.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03139 | train |
v2 | Schema:
products (alias: prod)(value, status, name, salary)
branches(date, status, type, id)
Task: Find name from products where a matching record exists in branches with the same level.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = prod.level
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03140 | train |
v3 | Schema:
branches (alias: brc)(name, code, value, level)
projects(status, id, level, type)
Task: Find code from branches where salary exceeds the maximum salary from projects for the same status.
SQL: | SELECT code FROM branches AS brc
WHERE salary > (
SELECT MAX(salary) FROM projects AS prj
WHERE prj.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03141 | train |
v3 | Schema:
orders (alias: ord)(salary, value, date, id)
items(name, salary, type, amount)
Task: Retrieve amount from orders with amount above the SUM(value) of items rows sharing the same code.
SQL: | SELECT amount FROM orders AS ord
WHERE amount > (
SELECT SUM(value) FROM items AS lne
WHERE lne.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03142 | train |
v1 | Schema:
transactions (alias: txn)(id, status, date, amount)
tasks(id, type, amount, salary)
Task: Select id from transactions where status exists in tasks for the same level.
SQL: | SELECT id FROM transactions AS txn
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03143 | train |
v3 | Schema:
sales (alias: sale)(date, value, level, salary)
staff(code, salary, level, status)
Task: Retrieve name from sales with amount above the COUNT(amount) of staff rows sharing the same level.
SQL: | SELECT name FROM sales AS sale
WHERE amount > (
SELECT COUNT(amount) FROM staff AS empl
WHERE empl.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03144 | train |
v1 | Schema:
items (alias: lne)(code, name, status, value)
requests(name, value, amount, code)
Task: Find code from items where code appears in requests entries with matching id.
SQL: | SELECT code FROM items AS lne
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.id = lne.id
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03145 | train |
v1 | Schema:
transactions (alias: txn)(level, status, name, amount)
sales(salary, type, code, amount)
Task: Retrieve code from transactions whose status is found in sales rows where status matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03146 | train |
v1 | Schema:
employees (alias: emp)(type, id, amount, name)
projects(id, salary, amount, value)
Task: Select code from employees where code exists in projects for the same status.
SQL: | SELECT code FROM employees AS emp
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "projects",
"outer_alias": "emp",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03147 | train |
v3 | Schema:
requests (alias: ordr)(value, amount, code, status)
items(name, value, status, id)
Task: Find value from requests where salary exceeds the maximum value from items for the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE salary > (
SELECT MAX(value) FROM items AS lne
WHERE lne.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03148 | train |
v2 | Schema:
transactions (alias: txn)(id, level, status, type)
requests(code, name, date, id)
Task: Find salary from transactions where a matching record exists in requests with the same status.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03149 | train |
v1 | Schema:
employees (alias: emp)(salary, status, type, name)
categories(status, name, value, code)
Task: Find salary from employees where code appears in categories entries with matching status.
SQL: | SELECT salary FROM employees AS emp
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03150 | train |
v1 | Schema:
requests (alias: ordr)(date, name, amount, salary)
projects(value, id, code, name)
Task: Select code from requests where id exists in projects for the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03151 | train |
v3 | Schema:
shipments (alias: shp)(status, date, name, level)
products(salary, name, value, id)
Task: Retrieve amount from shipments with value above the SUM(amount) of products rows sharing the same level.
SQL: | SELECT amount FROM shipments AS shp
WHERE value > (
SELECT SUM(amount) FROM products AS prod
WHERE prod.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03152 | train |
v2 | Schema:
items (alias: lne)(level, name, code, salary)
regions(value, name, type, salary)
Task: Find id from items where a matching record exists in regions with the same level.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03153 | train |
v1 | Schema:
departments (alias: dept)(value, code, status, date)
regions(name, code, amount, level)
Task: Find amount from departments where id appears in regions entries with matching id.
SQL: | SELECT amount FROM departments AS dept
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03154 | train |
v3 | Schema:
categories (alias: catg)(code, id, value, level)
orders(id, value, status, type)
Task: Retrieve value from categories with amount above the SUM(salary) of orders rows sharing the same type.
SQL: | SELECT value FROM categories AS catg
WHERE amount > (
SELECT SUM(salary) FROM orders AS ord
WHERE ord.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03155 | train |
v2 | Schema:
orders (alias: ord)(type, status, code, id)
invoices(date, name, status, amount)
Task: Retrieve id from orders that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03156 | train |
v2 | Schema:
accounts (alias: acct)(date, amount, code, type)
transactions(salary, id, type, level)
Task: Find value from accounts where a matching record exists in transactions with the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03157 | train |
v3 | Schema:
staff (alias: empl)(level, code, amount, type)
branches(type, level, name, value)
Task: Retrieve name from staff with salary above the SUM(salary) of branches rows sharing the same status.
SQL: | SELECT name FROM staff AS empl
WHERE salary > (
SELECT SUM(salary) FROM branches AS brc
WHERE brc.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03158 | train |
v2 | Schema:
sales (alias: sale)(date, status, type, id)
accounts(status, id, salary, level)
Task: Find name from sales where a matching record exists in accounts with the same id.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03159 | train |
v3 | Schema:
products (alias: prod)(name, amount, salary, status)
projects(name, level, type, code)
Task: Find amount from products where amount exceeds the minimum value from projects for the same status.
SQL: | SELECT amount FROM products AS prod
WHERE amount > (
SELECT MIN(value) FROM projects AS prj
WHERE prj.status = prod.status
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "prod",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03160 | train |
v2 | Schema:
departments (alias: dept)(status, date, salary, name)
employees(name, salary, date, level)
Task: Retrieve amount from departments that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03161 | train |
v2 | Schema:
employees (alias: emp)(type, date, salary, value)
shipments(type, value, date, name)
Task: Find name from employees where a matching record exists in shipments with the same status.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03162 | train |
v1 | Schema:
accounts (alias: acct)(type, status, date, name)
tasks(status, amount, value, level)
Task: Find code from accounts where id appears in tasks entries with matching code.
SQL: | SELECT code FROM accounts AS acct
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03163 | train |
v3 | Schema:
items (alias: lne)(code, status, amount, date)
orders(date, code, salary, status)
Task: Find id from items where value exceeds the minimum amount from orders for the same id.
SQL: | SELECT id FROM items AS lne
WHERE value > (
SELECT MIN(amount) FROM orders AS ord
WHERE ord.id = lne.id
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03164 | train |
v2 | Schema:
transactions (alias: txn)(amount, type, date, code)
tasks(salary, value, date, name)
Task: Find code from transactions where a matching record exists in tasks with the same type.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03165 | train |
v2 | Schema:
schedules (alias: schd)(salary, value, amount, level)
projects(amount, name, type, id)
Task: Find value from schedules where a matching record exists in projects with the same code.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03166 | train |
v2 | Schema:
products (alias: prod)(type, date, value, code)
shipments(name, type, status, amount)
Task: Find id from products where a matching record exists in shipments with the same code.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = prod.code
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03167 | train |
v1 | Schema:
products (alias: prod)(date, code, type, amount)
invoices(id, level, value, salary)
Task: Retrieve id from products whose level is found in invoices rows where status matches the outer record.
SQL: | SELECT id FROM products AS prod
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.status = prod.status
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03168 | train |
v2 | Schema:
categories (alias: catg)(amount, salary, status, name)
products(code, name, id, date)
Task: Find id from categories where a matching record exists in products with the same status.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03169 | train |
v3 | Schema:
regions (alias: rgn)(level, type, id, date)
shipments(amount, value, level, salary)
Task: Retrieve code from regions with amount above the SUM(value) of shipments rows sharing the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE amount > (
SELECT SUM(value) FROM shipments AS shp
WHERE shp.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03170 | train |
v2 | Schema:
customers (alias: cust)(code, amount, type, date)
departments(date, id, amount, name)
Task: Retrieve code from customers that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03171 | train |
v2 | Schema:
accounts (alias: acct)(amount, salary, type, value)
customers(status, name, amount, type)
Task: Find id from accounts where a matching record exists in customers with the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03172 | train |
v1 | Schema:
products (alias: prod)(level, date, name, salary)
staff(status, name, code, salary)
Task: Select name from products where code exists in staff for the same level.
SQL: | SELECT name FROM products AS prod
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.level = prod.level
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03173 | train |
v2 | Schema:
managers (alias: mgr)(level, status, name, type)
sales(salary, amount, level, status)
Task: Retrieve code from managers that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03174 | train |
v3 | Schema:
invoices (alias: inv)(amount, value, id, type)
products(id, value, level, salary)
Task: Find code from invoices where salary exceeds the total amount from products for the same status.
SQL: | SELECT code FROM invoices AS inv
WHERE salary > (
SELECT SUM(amount) FROM products AS prod
WHERE prod.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03175 | train |
v2 | Schema:
invoices (alias: inv)(name, code, salary, level)
tasks(code, name, value, type)
Task: Retrieve amount from invoices that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03176 | train |
v3 | Schema:
employees (alias: emp)(amount, id, level, salary)
categories(code, name, date, salary)
Task: Find id from employees where amount exceeds the count of salary from categories for the same status.
SQL: | SELECT id FROM employees AS emp
WHERE amount > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03177 | train |
v3 | Schema:
schedules (alias: schd)(status, id, value, level)
products(name, id, value, level)
Task: Retrieve amount from schedules with value above the MIN(value) of products rows sharing the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE value > (
SELECT MIN(value) FROM products AS prod
WHERE prod.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03178 | train |
v2 | Schema:
shipments (alias: shp)(name, id, value, level)
schedules(name, amount, level, id)
Task: Find salary from shipments where a matching record exists in schedules with the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03179 | train |
v3 | Schema:
invoices (alias: inv)(id, code, level, type)
tasks(name, status, date, id)
Task: Retrieve name from invoices with salary above the MIN(value) of tasks rows sharing the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE salary > (
SELECT MIN(value) FROM tasks AS tsk
WHERE tsk.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03180 | train |
v3 | Schema:
schedules (alias: schd)(name, type, code, status)
invoices(name, status, value, salary)
Task: Retrieve id from schedules with value above the MAX(amount) of invoices rows sharing the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE value > (
SELECT MAX(amount) FROM invoices AS inv
WHERE inv.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03181 | train |
v2 | Schema:
items (alias: lne)(date, code, salary, level)
branches(id, type, level, value)
Task: Retrieve salary from items that have at least one corresponding entry in branches sharing the same level.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = lne.level
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03182 | train |
v3 | Schema:
orders (alias: ord)(name, value, status, salary)
products(name, salary, code, level)
Task: Retrieve name from orders with salary above the AVG(salary) of products rows sharing the same type.
SQL: | SELECT name FROM orders AS ord
WHERE salary > (
SELECT AVG(salary) FROM products AS prod
WHERE prod.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03183 | train |
v3 | Schema:
orders (alias: ord)(date, level, salary, code)
requests(id, date, type, status)
Task: Find value from orders where value exceeds the count of amount from requests for the same code.
SQL: | SELECT value FROM orders AS ord
WHERE value > (
SELECT COUNT(amount) FROM requests AS ordr
WHERE ordr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03184 | train |
v1 | Schema:
staff (alias: empl)(value, amount, salary, code)
accounts(name, value, level, salary)
Task: Select id from staff where level exists in accounts for the same status.
SQL: | SELECT id FROM staff AS empl
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03185 | train |
v2 | Schema:
staff (alias: empl)(id, date, value, level)
schedules(id, amount, type, status)
Task: Find name from staff where a matching record exists in schedules with the same status.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03186 | train |
v1 | Schema:
employees (alias: emp)(level, amount, name, value)
items(value, salary, type, amount)
Task: Select code from employees where status exists in items for the same status.
SQL: | SELECT code FROM employees AS emp
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03187 | train |
v3 | Schema:
accounts (alias: acct)(level, name, date, value)
departments(amount, type, date, id)
Task: Find id from accounts where salary exceeds the minimum amount from departments for the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE salary > (
SELECT MIN(amount) FROM departments AS dept
WHERE dept.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03188 | train |
v1 | Schema:
managers (alias: mgr)(value, level, amount, id)
staff(date, value, status, type)
Task: Select code from managers where status exists in staff for the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03189 | train |
v1 | Schema:
categories (alias: catg)(status, id, date, amount)
sales(type, code, name, id)
Task: Retrieve amount from categories whose type is found in sales rows where type matches the outer record.
SQL: | SELECT amount FROM categories AS catg
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03190 | train |
v2 | Schema:
customers (alias: cust)(status, date, id, type)
projects(status, value, level, name)
Task: Retrieve salary from customers that have at least one corresponding entry in projects sharing the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03191 | train |
v3 | Schema:
regions (alias: rgn)(value, salary, date, amount)
schedules(name, date, status, id)
Task: Find id from regions where value exceeds the total amount from schedules for the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE value > (
SELECT SUM(amount) FROM schedules AS schd
WHERE schd.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03192 | train |
v1 | Schema:
invoices (alias: inv)(type, name, amount, status)
transactions(value, salary, name, level)
Task: Retrieve name from invoices whose level is found in transactions rows where code matches the outer record.
SQL: | SELECT name FROM invoices AS inv
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03193 | train |
v1 | Schema:
requests (alias: ordr)(name, amount, value, level)
tasks(level, status, date, name)
Task: Find name from requests where level appears in tasks entries with matching type.
SQL: | SELECT name FROM requests AS ordr
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03194 | train |
v3 | Schema:
products (alias: prod)(date, type, salary, name)
staff(code, status, id, type)
Task: Retrieve code from products with salary above the COUNT(value) of staff rows sharing the same type.
SQL: | SELECT code FROM products AS prod
WHERE salary > (
SELECT COUNT(value) FROM staff AS empl
WHERE empl.type = prod.type
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03195 | train |
v2 | Schema:
branches (alias: brc)(id, level, code, value)
employees(salary, name, date, id)
Task: Retrieve salary from branches that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03196 | train |
v3 | Schema:
categories (alias: catg)(level, status, date, value)
projects(value, date, id, name)
Task: Retrieve code from categories with amount above the AVG(amount) of projects rows sharing the same code.
SQL: | SELECT code FROM categories AS catg
WHERE amount > (
SELECT AVG(amount) FROM projects AS prj
WHERE prj.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03197 | train |
v1 | Schema:
staff (alias: empl)(id, level, amount, type)
transactions(amount, salary, status, value)
Task: Retrieve value from staff whose status is found in transactions rows where type matches the outer record.
SQL: | SELECT value FROM staff AS empl
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03198 | train |
v3 | Schema:
tasks (alias: tsk)(id, level, value, code)
sales(id, date, salary, code)
Task: Retrieve salary from tasks with salary above the COUNT(value) of sales rows sharing the same code.
SQL: | SELECT salary FROM tasks AS tsk
WHERE salary > (
SELECT COUNT(value) FROM sales AS sale
WHERE sale.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03199 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.