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:
departments (alias: dept)(date, name, status, value)
items(date, name, value, salary)
Task: Select value from departments where status exists in items for the same code.
SQL: | SELECT value FROM departments AS dept
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05400 | train |
v2 | Schema:
employees (alias: emp)(value, id, code, amount)
staff(code, value, salary, type)
Task: Find id from employees where a matching record exists in staff with the same id.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05401 | train |
v1 | Schema:
managers (alias: mgr)(code, value, name, salary)
sales(date, salary, status, level)
Task: Select salary from managers where type exists in sales for the same code.
SQL: | SELECT salary FROM managers AS mgr
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05402 | train |
v2 | Schema:
staff (alias: empl)(name, type, code, amount)
schedules(amount, type, date, value)
Task: Retrieve salary from staff that have at least one corresponding entry in schedules sharing the same status.
SQL: | SELECT salary 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": "salary",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05403 | train |
v1 | Schema:
items (alias: lne)(status, amount, date, code)
schedules(status, name, id, level)
Task: Retrieve amount from items whose status is found in schedules rows where status matches the outer record.
SQL: | SELECT amount FROM items AS lne
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.status = lne.status
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05404 | train |
v3 | Schema:
accounts (alias: acct)(status, value, level, amount)
departments(amount, level, id, code)
Task: Find id from accounts where amount exceeds the average amount from departments for the same code.
SQL: | SELECT id FROM accounts AS acct
WHERE amount > (
SELECT AVG(amount) FROM departments AS dept
WHERE dept.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05405 | train |
v3 | Schema:
products (alias: prod)(status, type, salary, code)
departments(type, code, salary, date)
Task: Find value from products where value exceeds the maximum amount from departments for the same id.
SQL: | SELECT value FROM products AS prod
WHERE value > (
SELECT MAX(amount) FROM departments AS dept
WHERE dept.id = prod.id
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05406 | train |
v3 | Schema:
requests (alias: ordr)(status, level, salary, value)
staff(amount, date, id, name)
Task: Find name from requests where value exceeds the count of salary from staff for the same id.
SQL: | SELECT name FROM requests AS ordr
WHERE value > (
SELECT COUNT(salary) FROM staff AS empl
WHERE empl.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05407 | train |
v3 | Schema:
orders (alias: ord)(name, salary, level, value)
accounts(amount, name, date, level)
Task: Find salary from orders where value exceeds the maximum amount from accounts for the same type.
SQL: | SELECT salary FROM orders AS ord
WHERE value > (
SELECT MAX(amount) FROM accounts AS acct
WHERE acct.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05408 | train |
v1 | Schema:
products (alias: prod)(name, salary, id, type)
employees(amount, status, id, level)
Task: Select id from products where status exists in employees for the same level.
SQL: | SELECT id FROM products AS prod
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.level = prod.level
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05409 | train |
v3 | Schema:
staff (alias: empl)(id, salary, type, status)
invoices(id, salary, status, code)
Task: Retrieve id from staff with value above the COUNT(value) of invoices rows sharing the same id.
SQL: | SELECT id FROM staff AS empl
WHERE value > (
SELECT COUNT(value) FROM invoices AS inv
WHERE inv.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05410 | train |
v2 | Schema:
schedules (alias: schd)(date, level, type, amount)
employees(level, id, code, name)
Task: Retrieve code from schedules that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05411 | train |
v2 | Schema:
sales (alias: sale)(date, type, id, name)
projects(status, type, value, code)
Task: Find name from sales where a matching record exists in projects with the same id.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05412 | train |
v3 | Schema:
items (alias: lne)(id, code, amount, type)
sales(level, status, name, amount)
Task: Find salary from items where salary exceeds the count of amount from sales for the same status.
SQL: | SELECT salary FROM items AS lne
WHERE salary > (
SELECT COUNT(amount) FROM sales AS sale
WHERE sale.status = lne.status
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05413 | train |
v3 | Schema:
customers (alias: cust)(level, status, code, date)
regions(status, code, id, level)
Task: Find value from customers where value exceeds the minimum value from regions for the same code.
SQL: | SELECT value FROM customers AS cust
WHERE value > (
SELECT MIN(value) FROM regions AS rgn
WHERE rgn.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05414 | train |
v3 | Schema:
staff (alias: empl)(amount, date, status, code)
accounts(level, status, value, amount)
Task: Retrieve code from staff with value above the COUNT(amount) of accounts rows sharing the same status.
SQL: | SELECT code FROM staff AS empl
WHERE value > (
SELECT COUNT(amount) FROM accounts AS acct
WHERE acct.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05415 | train |
v1 | Schema:
accounts (alias: acct)(id, salary, status, type)
schedules(status, name, salary, amount)
Task: Find value from accounts where code appears in schedules entries with matching id.
SQL: | SELECT value FROM accounts AS acct
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05416 | train |
v1 | Schema:
orders (alias: ord)(amount, salary, name, code)
branches(salary, amount, code, type)
Task: Retrieve id from orders whose status is found in branches rows where status matches the outer record.
SQL: | SELECT id FROM orders AS ord
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05417 | train |
v1 | Schema:
accounts (alias: acct)(code, status, level, amount)
tasks(name, level, code, date)
Task: Select amount from accounts where code exists in tasks for the same code.
SQL: | SELECT amount FROM accounts AS acct
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05418 | train |
v2 | Schema:
products (alias: prod)(name, status, value, salary)
sales(status, salary, id, code)
Task: Find id from products where a matching record exists in sales with the same code.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = prod.code
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05419 | train |
v2 | Schema:
invoices (alias: inv)(code, amount, status, name)
tasks(value, name, id, salary)
Task: Retrieve code from invoices that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT code 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": "code",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05420 | train |
v1 | Schema:
shipments (alias: shp)(level, status, amount, code)
departments(date, id, amount, code)
Task: Find salary from shipments where code appears in departments entries with matching code.
SQL: | SELECT salary FROM shipments AS shp
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05421 | train |
v2 | Schema:
branches (alias: brc)(date, status, value, name)
staff(id, level, code, amount)
Task: Retrieve id from branches that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05422 | train |
v2 | Schema:
categories (alias: catg)(status, level, salary, name)
products(id, level, salary, status)
Task: Find value from categories where a matching record exists in products with the same id.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05423 | train |
v2 | Schema:
categories (alias: catg)(level, salary, id, type)
employees(type, code, amount, name)
Task: Find code from categories where a matching record exists in employees with the same type.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05424 | train |
v1 | Schema:
staff (alias: empl)(type, amount, value, date)
customers(code, id, date, salary)
Task: Select code from staff where type exists in customers for the same code.
SQL: | SELECT code FROM staff AS empl
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05425 | train |
v3 | Schema:
schedules (alias: schd)(code, id, name, status)
transactions(name, date, amount, status)
Task: Retrieve amount from schedules with value above the AVG(salary) of transactions rows sharing the same id.
SQL: | SELECT amount FROM schedules AS schd
WHERE value > (
SELECT AVG(salary) FROM transactions AS txn
WHERE txn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05426 | train |
v1 | Schema:
accounts (alias: acct)(salary, type, date, amount)
orders(amount, name, code, id)
Task: Retrieve id from accounts whose status is found in orders rows where id matches the outer record.
SQL: | SELECT id FROM accounts AS acct
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05427 | train |
v3 | Schema:
regions (alias: rgn)(type, date, salary, id)
accounts(status, value, date, salary)
Task: Find amount from regions where value exceeds the count of value from accounts for the same status.
SQL: | SELECT amount FROM regions AS rgn
WHERE value > (
SELECT COUNT(value) FROM accounts AS acct
WHERE acct.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05428 | train |
v1 | Schema:
projects (alias: prj)(date, amount, level, type)
shipments(type, amount, salary, date)
Task: Find value from projects where type appears in shipments entries with matching status.
SQL: | SELECT value FROM projects AS prj
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05429 | train |
v3 | Schema:
shipments (alias: shp)(code, status, id, amount)
sales(type, amount, id, name)
Task: Find amount from shipments where salary exceeds the total salary from sales for the same level.
SQL: | SELECT amount FROM shipments AS shp
WHERE salary > (
SELECT SUM(salary) FROM sales AS sale
WHERE sale.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05430 | train |
v1 | Schema:
requests (alias: ordr)(code, name, status, type)
schedules(code, status, value, type)
Task: Select id from requests where id exists in schedules for the same code.
SQL: | SELECT id FROM requests AS ordr
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05431 | train |
v3 | Schema:
tasks (alias: tsk)(code, amount, date, name)
transactions(amount, code, id, name)
Task: Find code from tasks where salary exceeds the total value from transactions for the same id.
SQL: | SELECT code FROM tasks AS tsk
WHERE salary > (
SELECT SUM(value) FROM transactions AS txn
WHERE txn.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05432 | train |
v1 | Schema:
employees (alias: emp)(status, name, level, salary)
requests(code, salary, name, date)
Task: Select id from employees where type exists in requests for the same status.
SQL: | SELECT id FROM employees AS emp
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05433 | train |
v2 | Schema:
sales (alias: sale)(salary, id, name, value)
departments(amount, date, code, value)
Task: Retrieve id from sales that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05434 | train |
v1 | Schema:
schedules (alias: schd)(amount, value, level, type)
employees(status, level, date, salary)
Task: Find salary from schedules where code appears in employees entries with matching code.
SQL: | SELECT salary FROM schedules AS schd
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05435 | train |
v2 | Schema:
invoices (alias: inv)(type, date, level, name)
requests(salary, type, date, id)
Task: Find value from invoices where a matching record exists in requests with the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05436 | train |
v3 | Schema:
projects (alias: prj)(name, amount, salary, date)
branches(level, name, status, salary)
Task: Find code from projects where value exceeds the average amount from branches for the same status.
SQL: | SELECT code FROM projects AS prj
WHERE value > (
SELECT AVG(amount) FROM branches AS brc
WHERE brc.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05437 | train |
v1 | Schema:
accounts (alias: acct)(value, status, salary, code)
orders(date, salary, name, level)
Task: Find code from accounts where level appears in orders entries with matching level.
SQL: | SELECT code FROM accounts AS acct
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05438 | train |
v2 | Schema:
invoices (alias: inv)(name, status, date, value)
sales(date, id, status, level)
Task: Find salary from invoices where a matching record exists in sales with the same type.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05439 | train |
v3 | Schema:
invoices (alias: inv)(value, level, salary, amount)
branches(value, status, salary, id)
Task: Find salary from invoices where value exceeds the count of value from branches for the same type.
SQL: | SELECT salary FROM invoices AS inv
WHERE value > (
SELECT COUNT(value) FROM branches AS brc
WHERE brc.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05440 | train |
v1 | Schema:
categories (alias: catg)(date, amount, type, id)
shipments(level, code, salary, date)
Task: Retrieve code from categories whose status is found in shipments rows where type matches the outer record.
SQL: | SELECT code FROM categories AS catg
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05441 | train |
v2 | Schema:
transactions (alias: txn)(code, salary, name, type)
sales(code, amount, name, salary)
Task: Retrieve name from transactions that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05442 | train |
v2 | Schema:
requests (alias: ordr)(name, type, amount, status)
branches(level, date, code, name)
Task: Find id from requests where a matching record exists in branches with the same status.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05443 | train |
v3 | Schema:
tasks (alias: tsk)(salary, amount, level, date)
employees(type, code, id, level)
Task: Find salary from tasks where value exceeds the maximum amount from employees for the same type.
SQL: | SELECT salary FROM tasks AS tsk
WHERE value > (
SELECT MAX(amount) FROM employees AS emp
WHERE emp.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "tsk",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05444 | train |
v3 | Schema:
departments (alias: dept)(date, type, code, salary)
projects(amount, status, code, level)
Task: Retrieve amount from departments with amount above the MIN(amount) of projects rows sharing the same id.
SQL: | SELECT amount FROM departments AS dept
WHERE amount > (
SELECT MIN(amount) FROM projects AS prj
WHERE prj.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05445 | train |
v3 | Schema:
invoices (alias: inv)(type, amount, status, id)
transactions(date, salary, status, level)
Task: Retrieve salary from invoices with amount above the SUM(salary) of transactions rows sharing the same id.
SQL: | SELECT salary FROM invoices AS inv
WHERE amount > (
SELECT SUM(salary) FROM transactions AS txn
WHERE txn.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05446 | train |
v3 | Schema:
items (alias: lne)(id, code, amount, name)
staff(status, type, code, date)
Task: Retrieve amount from items with salary above the AVG(salary) of staff rows sharing the same code.
SQL: | SELECT amount FROM items AS lne
WHERE salary > (
SELECT AVG(salary) FROM staff AS empl
WHERE empl.code = lne.code
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05447 | train |
v2 | Schema:
categories (alias: catg)(type, value, level, date)
requests(code, id, level, name)
Task: Find id from categories where a matching record exists in requests with the same level.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05448 | train |
v3 | Schema:
orders (alias: ord)(level, date, code, value)
transactions(id, date, type, level)
Task: Find salary from orders where amount exceeds the count of value from transactions for the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE amount > (
SELECT COUNT(value) FROM transactions AS txn
WHERE txn.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05449 | train |
v1 | Schema:
items (alias: lne)(code, status, amount, level)
regions(date, status, level, name)
Task: Retrieve code from items whose id is found in regions rows where level matches the outer record.
SQL: | SELECT code FROM items AS lne
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05450 | train |
v2 | Schema:
schedules (alias: schd)(name, amount, code, level)
items(status, amount, code, value)
Task: Find salary from schedules where a matching record exists in items with the same id.
SQL: | SELECT salary 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": "salary",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05451 | train |
v2 | Schema:
categories (alias: catg)(code, id, level, status)
employees(status, level, date, salary)
Task: Find id from categories where a matching record exists in employees with the same type.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05452 | train |
v3 | Schema:
managers (alias: mgr)(date, status, code, type)
branches(name, code, date, salary)
Task: Find code from managers where amount exceeds the minimum amount from branches for the same code.
SQL: | SELECT code FROM managers AS mgr
WHERE amount > (
SELECT MIN(amount) FROM branches AS brc
WHERE brc.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05453 | train |
v2 | Schema:
regions (alias: rgn)(type, date, code, status)
employees(level, name, date, id)
Task: Retrieve amount from regions that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05454 | train |
v1 | Schema:
branches (alias: brc)(amount, code, id, type)
employees(amount, salary, level, code)
Task: Select amount from branches where id exists in employees for the same level.
SQL: | SELECT amount FROM branches AS brc
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05455 | train |
v3 | Schema:
customers (alias: cust)(type, code, level, status)
invoices(name, level, id, salary)
Task: Retrieve amount from customers with salary above the SUM(value) of invoices rows sharing the same level.
SQL: | SELECT amount FROM customers AS cust
WHERE salary > (
SELECT SUM(value) FROM invoices AS inv
WHERE inv.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05456 | train |
v2 | Schema:
sales (alias: sale)(id, amount, type, salary)
tasks(value, level, date, name)
Task: Find value from sales where a matching record exists in tasks with the same type.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05457 | train |
v3 | Schema:
requests (alias: ordr)(type, level, date, amount)
products(code, date, type, value)
Task: Find code from requests where salary exceeds the average value from products for the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE salary > (
SELECT AVG(value) FROM products AS prod
WHERE prod.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05458 | train |
v3 | Schema:
shipments (alias: shp)(code, status, type, salary)
invoices(value, name, id, salary)
Task: Retrieve amount from shipments with value above the MIN(value) of invoices rows sharing the same level.
SQL: | SELECT amount FROM shipments AS shp
WHERE value > (
SELECT MIN(value) FROM invoices AS inv
WHERE inv.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05459 | train |
v3 | Schema:
accounts (alias: acct)(id, value, name, status)
shipments(id, code, name, level)
Task: Retrieve code from accounts with salary above the COUNT(amount) of shipments rows sharing the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE salary > (
SELECT COUNT(amount) FROM shipments AS shp
WHERE shp.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05460 | train |
v1 | Schema:
items (alias: lne)(salary, status, name, value)
tasks(amount, status, date, value)
Task: Select id from items where id exists in tasks for the same id.
SQL: | SELECT id FROM items AS lne
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.id = lne.id
); | {
"outer_table": "items",
"inner_table": "tasks",
"outer_alias": "lne",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05461 | train |
v3 | Schema:
customers (alias: cust)(type, value, id, level)
orders(date, id, type, level)
Task: Find amount from customers where amount exceeds the minimum amount from orders for the same type.
SQL: | SELECT amount FROM customers AS cust
WHERE amount > (
SELECT MIN(amount) FROM orders AS ord
WHERE ord.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05462 | train |
v1 | Schema:
regions (alias: rgn)(id, amount, date, salary)
tasks(salary, name, id, type)
Task: Retrieve id from regions whose type is found in tasks rows where type matches the outer record.
SQL: | SELECT id FROM regions AS rgn
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05463 | train |
v3 | Schema:
regions (alias: rgn)(type, level, amount, id)
branches(id, salary, name, status)
Task: Find name from regions where value exceeds the minimum salary from branches for the same code.
SQL: | SELECT name FROM regions AS rgn
WHERE value > (
SELECT MIN(salary) FROM branches AS brc
WHERE brc.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05464 | train |
v1 | Schema:
transactions (alias: txn)(status, salary, amount, date)
employees(name, id, value, code)
Task: Retrieve name from transactions whose type is found in employees rows where status matches the outer record.
SQL: | SELECT name FROM transactions AS txn
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05465 | train |
v1 | Schema:
products (alias: prod)(level, value, code, type)
tasks(amount, date, value, level)
Task: Retrieve code from products whose status is found in tasks rows where level matches the outer record.
SQL: | SELECT code FROM products AS prod
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.level = prod.level
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05466 | train |
v1 | Schema:
categories (alias: catg)(amount, status, code, name)
regions(amount, name, salary, value)
Task: Select value from categories where status exists in regions for the same code.
SQL: | SELECT value FROM categories AS catg
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05467 | train |
v1 | Schema:
projects (alias: prj)(amount, id, code, date)
categories(status, date, code, name)
Task: Retrieve salary from projects whose status is found in categories rows where type matches the outer record.
SQL: | SELECT salary FROM projects AS prj
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05468 | train |
v3 | Schema:
staff (alias: empl)(salary, type, level, id)
invoices(level, code, salary, status)
Task: Retrieve value from staff with value above the COUNT(value) of invoices rows sharing the same id.
SQL: | SELECT value FROM staff AS empl
WHERE value > (
SELECT COUNT(value) FROM invoices AS inv
WHERE inv.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05469 | train |
v2 | Schema:
accounts (alias: acct)(level, type, id, salary)
orders(id, code, date, salary)
Task: Find amount from accounts where a matching record exists in orders with the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05470 | train |
v1 | Schema:
requests (alias: ordr)(amount, code, salary, status)
shipments(status, code, type, amount)
Task: Find id from requests where level appears in shipments entries with matching status.
SQL: | SELECT id FROM requests AS ordr
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05471 | train |
v3 | Schema:
employees (alias: emp)(salary, level, value, id)
schedules(status, value, level, name)
Task: Find id from employees where amount exceeds the average salary from schedules for the same level.
SQL: | SELECT id FROM employees AS emp
WHERE amount > (
SELECT AVG(salary) FROM schedules AS schd
WHERE schd.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05472 | train |
v2 | Schema:
projects (alias: prj)(date, salary, type, status)
schedules(amount, level, code, name)
Task: Retrieve code from projects that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "schedules",
"outer_alias": "prj",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05473 | train |
v3 | Schema:
invoices (alias: inv)(type, code, id, amount)
accounts(name, amount, id, type)
Task: Retrieve name from invoices with value above the SUM(amount) of accounts rows sharing the same id.
SQL: | SELECT name FROM invoices AS inv
WHERE value > (
SELECT SUM(amount) FROM accounts AS acct
WHERE acct.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05474 | train |
v3 | Schema:
transactions (alias: txn)(level, amount, type, id)
items(amount, code, level, date)
Task: Find value from transactions where salary exceeds the count of value from items for the same id.
SQL: | SELECT value FROM transactions AS txn
WHERE salary > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05475 | train |
v3 | Schema:
requests (alias: ordr)(status, date, level, code)
transactions(date, type, id, level)
Task: Retrieve id from requests with salary above the MIN(value) of transactions rows sharing the same status.
SQL: | SELECT id FROM requests AS ordr
WHERE salary > (
SELECT MIN(value) FROM transactions AS txn
WHERE txn.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05476 | train |
v1 | Schema:
tasks (alias: tsk)(type, level, id, value)
sales(status, level, salary, date)
Task: Select salary from tasks where id exists in sales for the same id.
SQL: | SELECT salary FROM tasks AS tsk
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05477 | train |
v2 | Schema:
schedules (alias: schd)(amount, status, type, value)
employees(level, name, value, salary)
Task: Find id from schedules where a matching record exists in employees with the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05478 | train |
v2 | Schema:
regions (alias: rgn)(date, code, status, id)
customers(id, salary, status, date)
Task: Retrieve salary from regions that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05479 | train |
v2 | Schema:
staff (alias: empl)(level, value, date, amount)
schedules(value, level, date, id)
Task: Retrieve id from staff that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05480 | train |
v3 | Schema:
branches (alias: brc)(type, id, value, name)
customers(date, type, code, salary)
Task: Retrieve code from branches with value above the MAX(value) of customers rows sharing the same status.
SQL: | SELECT code FROM branches AS brc
WHERE value > (
SELECT MAX(value) FROM customers AS cust
WHERE cust.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05481 | train |
v2 | Schema:
invoices (alias: inv)(amount, type, code, id)
items(date, type, name, id)
Task: Find value from invoices where a matching record exists in items with the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05482 | train |
v1 | Schema:
staff (alias: empl)(code, id, amount, status)
accounts(status, id, name, type)
Task: Find name from staff where type appears in accounts entries with matching id.
SQL: | SELECT name FROM staff AS empl
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05483 | train |
v1 | Schema:
items (alias: lne)(type, amount, date, value)
staff(date, salary, amount, name)
Task: Retrieve salary from items whose level is found in staff rows where type matches the outer record.
SQL: | SELECT salary FROM items AS lne
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.type = lne.type
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05484 | train |
v2 | Schema:
employees (alias: emp)(salary, name, id, status)
products(status, date, amount, type)
Task: Find amount from employees where a matching record exists in products with the same type.
SQL: | SELECT amount 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": "amount",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05485 | train |
v1 | Schema:
tasks (alias: tsk)(salary, status, code, date)
projects(amount, level, id, value)
Task: Retrieve id from tasks whose type is found in projects rows where type matches the outer record.
SQL: | SELECT id FROM tasks AS tsk
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05486 | train |
v1 | Schema:
shipments (alias: shp)(name, amount, id, status)
categories(level, name, code, amount)
Task: Retrieve value from shipments whose id is found in categories rows where level matches the outer record.
SQL: | SELECT value FROM shipments AS shp
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05487 | train |
v1 | Schema:
categories (alias: catg)(level, status, salary, type)
transactions(value, level, amount, code)
Task: Find salary from categories where code appears in transactions entries with matching code.
SQL: | SELECT salary FROM categories AS catg
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05488 | train |
v3 | Schema:
categories (alias: catg)(code, date, salary, level)
branches(value, code, amount, level)
Task: Find amount from categories where salary exceeds the count of salary from branches for the same id.
SQL: | SELECT amount FROM categories AS catg
WHERE salary > (
SELECT COUNT(salary) FROM branches AS brc
WHERE brc.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "brc",
"proj_col": "amount",
"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_05489 | train |
v3 | Schema:
orders (alias: ord)(type, code, amount, status)
branches(amount, level, id, status)
Task: Retrieve id from orders with value above the MIN(value) of branches rows sharing the same type.
SQL: | SELECT id FROM orders AS ord
WHERE value > (
SELECT MIN(value) FROM branches AS brc
WHERE brc.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05490 | train |
v3 | Schema:
items (alias: lne)(code, id, salary, level)
invoices(date, id, amount, status)
Task: Find code from items where amount exceeds the maximum amount from invoices for the same level.
SQL: | SELECT code FROM items AS lne
WHERE amount > (
SELECT MAX(amount) FROM invoices AS inv
WHERE inv.level = lne.level
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05491 | train |
v1 | Schema:
tasks (alias: tsk)(value, level, date, amount)
departments(value, code, salary, name)
Task: Find amount from tasks where level appears in departments entries with matching type.
SQL: | SELECT amount FROM tasks AS tsk
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "tsk",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05492 | train |
v1 | Schema:
branches (alias: brc)(salary, id, type, value)
projects(type, status, salary, name)
Task: Find id from branches where type appears in projects entries with matching code.
SQL: | SELECT id FROM branches AS brc
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05493 | train |
v1 | Schema:
transactions (alias: txn)(value, amount, id, salary)
employees(salary, value, status, type)
Task: Find value from transactions where code appears in employees entries with matching code.
SQL: | SELECT value FROM transactions AS txn
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05494 | train |
v2 | Schema:
orders (alias: ord)(amount, level, date, value)
staff(level, type, date, status)
Task: Find code from orders where a matching record exists in staff with the same code.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05495 | train |
v2 | Schema:
tasks (alias: tsk)(date, code, id, status)
managers(salary, code, date, level)
Task: Find value from tasks where a matching record exists in managers with the same level.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05496 | train |
v3 | Schema:
schedules (alias: schd)(amount, date, code, type)
accounts(level, salary, name, value)
Task: Retrieve id from schedules with value above the AVG(amount) of accounts rows sharing the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE value > (
SELECT AVG(amount) FROM accounts AS acct
WHERE acct.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05497 | train |
v3 | Schema:
projects (alias: prj)(id, level, salary, date)
employees(amount, status, name, salary)
Task: Retrieve name from projects with salary above the SUM(value) of employees rows sharing the same id.
SQL: | SELECT name FROM projects AS prj
WHERE salary > (
SELECT SUM(value) FROM employees AS emp
WHERE emp.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05498 | train |
v2 | Schema:
requests (alias: ordr)(salary, name, value, amount)
sales(id, name, date, code)
Task: Find value from requests where a matching record exists in sales with the same id.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05499 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.