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 |
|---|---|---|---|---|---|---|
v2 | Schema:
orders (alias: ord)(type, salary, level, value)
customers(id, level, amount, name)
Task: Find value from orders where a matching record exists in customers with the same level.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03500 | train |
v1 | Schema:
projects (alias: prj)(code, level, status, name)
departments(status, date, value, type)
Task: Retrieve id from projects whose status is found in departments rows where id matches the outer record.
SQL: | SELECT id FROM projects AS prj
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03501 | train |
v3 | Schema:
customers (alias: cust)(salary, code, type, name)
transactions(status, name, date, id)
Task: Retrieve id from customers with amount above the MIN(amount) of transactions rows sharing the same code.
SQL: | SELECT id FROM customers AS cust
WHERE amount > (
SELECT MIN(amount) FROM transactions AS txn
WHERE txn.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03502 | train |
v3 | Schema:
products (alias: prod)(level, type, name, status)
departments(value, id, date, amount)
Task: Retrieve salary from products with amount above the MAX(amount) of departments rows sharing the same type.
SQL: | SELECT salary FROM products AS prod
WHERE amount > (
SELECT MAX(amount) FROM departments AS dept
WHERE dept.type = prod.type
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "salary",
"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_03503 | train |
v2 | Schema:
managers (alias: mgr)(level, code, date, amount)
tasks(amount, level, id, status)
Task: Retrieve salary from managers that have at least one corresponding entry in tasks sharing the same level.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03504 | train |
v3 | Schema:
managers (alias: mgr)(salary, code, level, id)
shipments(id, code, salary, type)
Task: Find name from managers where amount exceeds the total amount from shipments for the same type.
SQL: | SELECT name FROM managers AS mgr
WHERE amount > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03505 | train |
v3 | Schema:
customers (alias: cust)(amount, date, status, level)
employees(date, amount, salary, value)
Task: Find id from customers where value exceeds the maximum salary from employees for the same type.
SQL: | SELECT id FROM customers AS cust
WHERE value > (
SELECT MAX(salary) FROM employees AS emp
WHERE emp.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03506 | train |
v3 | Schema:
categories (alias: catg)(id, date, value, salary)
schedules(code, value, id, salary)
Task: Find value from categories where salary exceeds the count of amount from schedules for the same level.
SQL: | SELECT value FROM categories AS catg
WHERE salary > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03507 | train |
v3 | Schema:
invoices (alias: inv)(value, name, type, amount)
projects(level, name, value, amount)
Task: Find code from invoices where amount exceeds the minimum value from projects for the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE amount > (
SELECT MIN(value) FROM projects AS prj
WHERE prj.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03508 | train |
v2 | Schema:
departments (alias: dept)(status, id, name, value)
employees(name, value, date, level)
Task: Find amount from departments where a matching record exists in employees with the same level.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03509 | train |
v1 | Schema:
projects (alias: prj)(level, amount, code, id)
shipments(value, level, status, salary)
Task: Find id from projects where id appears in shipments entries with matching level.
SQL: | SELECT id FROM projects AS prj
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03510 | train |
v3 | Schema:
employees (alias: emp)(code, salary, level, value)
accounts(salary, status, name, code)
Task: Find id from employees where salary exceeds the minimum amount from accounts for the same status.
SQL: | SELECT id FROM employees AS emp
WHERE salary > (
SELECT MIN(amount) FROM accounts AS acct
WHERE acct.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03511 | train |
v3 | Schema:
transactions (alias: txn)(type, code, level, id)
accounts(level, id, status, date)
Task: Retrieve value from transactions with value above the COUNT(amount) of accounts rows sharing the same status.
SQL: | SELECT value FROM transactions AS txn
WHERE value > (
SELECT COUNT(amount) FROM accounts AS acct
WHERE acct.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03512 | train |
v1 | Schema:
staff (alias: empl)(salary, name, type, id)
managers(name, amount, type, value)
Task: Find id from staff where level appears in managers entries with matching level.
SQL: | SELECT id FROM staff AS empl
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03513 | train |
v2 | Schema:
products (alias: prod)(level, value, status, date)
regions(amount, type, date, value)
Task: Retrieve amount from products that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = prod.id
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03514 | train |
v1 | Schema:
accounts (alias: acct)(salary, id, name, code)
departments(level, salary, value, status)
Task: Select salary from accounts where id exists in departments for the same type.
SQL: | SELECT salary FROM accounts AS acct
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03515 | train |
v1 | Schema:
managers (alias: mgr)(id, value, level, amount)
branches(id, status, type, name)
Task: Select code from managers where type exists in branches for the same code.
SQL: | SELECT code FROM managers AS mgr
WHERE type IN (
SELECT type 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": "type",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03516 | train |
v1 | Schema:
requests (alias: ordr)(status, code, level, amount)
categories(id, code, value, date)
Task: Select name from requests where status exists in categories for the same level.
SQL: | SELECT name FROM requests AS ordr
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03517 | train |
v1 | Schema:
invoices (alias: inv)(date, level, salary, code)
departments(id, status, value, name)
Task: Find id from invoices where level appears in departments entries with matching code.
SQL: | SELECT id FROM invoices AS inv
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03518 | train |
v3 | Schema:
departments (alias: dept)(level, type, date, name)
schedules(status, id, salary, type)
Task: Retrieve name from departments with value above the MAX(value) of schedules rows sharing the same id.
SQL: | SELECT name FROM departments AS dept
WHERE value > (
SELECT MAX(value) FROM schedules AS schd
WHERE schd.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03519 | train |
v3 | Schema:
branches (alias: brc)(amount, salary, type, id)
tasks(value, id, code, type)
Task: Retrieve code from branches with salary above the SUM(value) of tasks rows sharing the same code.
SQL: | SELECT code FROM branches AS brc
WHERE salary > (
SELECT SUM(value) FROM tasks AS tsk
WHERE tsk.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03520 | train |
v3 | Schema:
categories (alias: catg)(value, amount, level, status)
managers(level, status, id, code)
Task: Retrieve name from categories with value above the MAX(salary) of managers rows sharing the same id.
SQL: | SELECT name FROM categories AS catg
WHERE value > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03521 | train |
v3 | Schema:
customers (alias: cust)(name, status, salary, date)
items(amount, id, salary, name)
Task: Retrieve id from customers with amount above the COUNT(amount) of items rows sharing the same level.
SQL: | SELECT id FROM customers AS cust
WHERE amount > (
SELECT COUNT(amount) FROM items AS lne
WHERE lne.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03522 | train |
v3 | Schema:
products (alias: prod)(type, amount, name, value)
accounts(name, code, amount, date)
Task: Retrieve salary from products with amount above the COUNT(salary) of accounts rows sharing the same status.
SQL: | SELECT salary FROM products AS prod
WHERE amount > (
SELECT COUNT(salary) FROM accounts AS acct
WHERE acct.status = prod.status
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03523 | train |
v3 | Schema:
shipments (alias: shp)(name, value, id, status)
requests(id, status, amount, name)
Task: Find value from shipments where value exceeds the maximum salary from requests for the same status.
SQL: | SELECT value FROM shipments AS shp
WHERE value > (
SELECT MAX(salary) FROM requests AS ordr
WHERE ordr.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03524 | train |
v2 | Schema:
categories (alias: catg)(code, amount, date, name)
regions(id, status, code, date)
Task: Find value from categories where a matching record exists in regions with the same code.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03525 | train |
v3 | Schema:
transactions (alias: txn)(salary, type, amount, code)
orders(value, name, type, level)
Task: Retrieve value from transactions with amount above the COUNT(salary) of orders rows sharing the same code.
SQL: | SELECT value FROM transactions AS txn
WHERE amount > (
SELECT COUNT(salary) FROM orders AS ord
WHERE ord.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03526 | train |
v1 | Schema:
employees (alias: emp)(salary, level, date, name)
departments(id, amount, type, level)
Task: Select salary from employees where id exists in departments for the same level.
SQL: | SELECT salary FROM employees AS emp
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03527 | train |
v2 | Schema:
invoices (alias: inv)(level, id, date, value)
managers(value, id, type, date)
Task: Retrieve id from invoices that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03528 | train |
v1 | Schema:
transactions (alias: txn)(status, id, value, amount)
branches(salary, id, level, amount)
Task: Retrieve id from transactions whose code is found in branches rows where status matches the outer record.
SQL: | SELECT id FROM transactions AS txn
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03529 | train |
v2 | Schema:
tasks (alias: tsk)(salary, type, name, date)
customers(code, id, amount, name)
Task: Retrieve code from tasks that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "tsk",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03530 | train |
v3 | Schema:
projects (alias: prj)(id, date, value, code)
branches(name, level, date, code)
Task: Find salary from projects where amount exceeds the minimum value from branches for the same id.
SQL: | SELECT salary FROM projects AS prj
WHERE amount > (
SELECT MIN(value) FROM branches AS brc
WHERE brc.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03531 | train |
v2 | Schema:
tasks (alias: tsk)(status, salary, date, id)
projects(code, level, name, amount)
Task: Find value from tasks where a matching record exists in projects with the same id.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03532 | train |
v3 | Schema:
categories (alias: catg)(id, status, level, code)
schedules(salary, amount, type, level)
Task: Find name from categories where salary exceeds the minimum salary from schedules for the same type.
SQL: | SELECT name FROM categories AS catg
WHERE salary > (
SELECT MIN(salary) FROM schedules AS schd
WHERE schd.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03533 | train |
v3 | Schema:
transactions (alias: txn)(date, level, code, id)
departments(status, salary, value, level)
Task: Find id from transactions where amount exceeds the minimum amount from departments for the same id.
SQL: | SELECT id FROM transactions AS txn
WHERE amount > (
SELECT MIN(amount) FROM departments AS dept
WHERE dept.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03534 | train |
v1 | Schema:
departments (alias: dept)(salary, id, level, status)
staff(type, date, code, status)
Task: Find value from departments where type appears in staff entries with matching type.
SQL: | SELECT value FROM departments AS dept
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03535 | train |
v1 | Schema:
tasks (alias: tsk)(status, date, amount, name)
staff(date, level, value, amount)
Task: Retrieve id from tasks whose type is found in staff rows where code matches the outer record.
SQL: | SELECT id FROM tasks AS tsk
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "staff",
"outer_alias": "tsk",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03536 | train |
v2 | Schema:
branches (alias: brc)(date, amount, salary, code)
schedules(name, type, value, amount)
Task: Find id from branches where a matching record exists in schedules with the same level.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "schedules",
"outer_alias": "brc",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03537 | train |
v3 | Schema:
orders (alias: ord)(id, date, type, name)
categories(date, id, level, salary)
Task: Retrieve value from orders with salary above the MIN(amount) of categories rows sharing the same level.
SQL: | SELECT value FROM orders AS ord
WHERE salary > (
SELECT MIN(amount) FROM categories AS catg
WHERE catg.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03538 | train |
v2 | Schema:
requests (alias: ordr)(name, level, date, amount)
branches(date, salary, amount, value)
Task: Retrieve name from requests that have at least one corresponding entry in branches sharing the same level.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03539 | train |
v3 | Schema:
branches (alias: brc)(amount, value, type, date)
products(type, date, value, status)
Task: Retrieve salary from branches with value above the MAX(value) of products rows sharing the same type.
SQL: | SELECT salary FROM branches AS brc
WHERE value > (
SELECT MAX(value) FROM products AS prod
WHERE prod.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03540 | train |
v3 | Schema:
tasks (alias: tsk)(type, date, amount, name)
shipments(amount, code, date, value)
Task: Find code from tasks where amount exceeds the maximum amount from shipments for the same code.
SQL: | SELECT code FROM tasks AS tsk
WHERE amount > (
SELECT MAX(amount) FROM shipments AS shp
WHERE shp.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03541 | train |
v2 | Schema:
customers (alias: cust)(level, value, date, status)
categories(amount, id, type, value)
Task: Retrieve id from customers that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03542 | train |
v1 | Schema:
orders (alias: ord)(amount, value, code, type)
accounts(amount, date, salary, id)
Task: Retrieve value from orders whose status is found in accounts rows where level matches the outer record.
SQL: | SELECT value FROM orders AS ord
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03543 | train |
v3 | Schema:
categories (alias: catg)(name, level, salary, type)
customers(name, level, date, id)
Task: Retrieve name from categories with amount above the MAX(amount) of customers rows sharing the same level.
SQL: | SELECT name FROM categories AS catg
WHERE amount > (
SELECT MAX(amount) FROM customers AS cust
WHERE cust.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03544 | train |
v1 | Schema:
items (alias: lne)(amount, name, code, salary)
regions(amount, status, type, name)
Task: Find code from items where level appears in regions entries with matching code.
SQL: | SELECT code FROM items AS lne
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.code = lne.code
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03545 | train |
v3 | Schema:
employees (alias: emp)(amount, level, id, type)
products(code, salary, value, status)
Task: Retrieve salary from employees with value above the MAX(value) of products rows sharing the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE value > (
SELECT MAX(value) FROM products AS prod
WHERE prod.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03546 | train |
v2 | Schema:
shipments (alias: shp)(status, name, id, type)
customers(status, salary, id, type)
Task: Retrieve value from shipments that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03547 | train |
v1 | Schema:
branches (alias: brc)(type, code, id, name)
transactions(amount, name, id, level)
Task: Retrieve code from branches whose id is found in transactions rows where level matches the outer record.
SQL: | SELECT code FROM branches AS brc
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "transactions",
"outer_alias": "brc",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03548 | train |
v3 | Schema:
invoices (alias: inv)(amount, code, value, type)
managers(name, date, salary, amount)
Task: Find id from invoices where salary exceeds the average value from managers for the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE salary > (
SELECT AVG(value) FROM managers AS mgr
WHERE mgr.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03549 | train |
v1 | Schema:
transactions (alias: txn)(id, value, amount, type)
categories(id, salary, type, level)
Task: Retrieve salary from transactions whose level is found in categories rows where status matches the outer record.
SQL: | SELECT salary FROM transactions AS txn
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03550 | train |
v3 | Schema:
requests (alias: ordr)(date, status, value, level)
schedules(date, level, id, salary)
Task: Retrieve code from requests with amount above the AVG(amount) of schedules rows sharing the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE amount > (
SELECT AVG(amount) FROM schedules AS schd
WHERE schd.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03551 | train |
v1 | Schema:
transactions (alias: txn)(type, level, id, amount)
staff(amount, salary, code, value)
Task: Retrieve salary from transactions whose status is found in staff rows where status matches the outer record.
SQL: | SELECT salary FROM transactions AS txn
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03552 | train |
v2 | Schema:
departments (alias: dept)(id, name, date, status)
tasks(amount, code, salary, level)
Task: Find value from departments where a matching record exists in tasks with the same id.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03553 | train |
v2 | Schema:
regions (alias: rgn)(value, level, status, date)
invoices(level, salary, id, amount)
Task: Retrieve salary from regions that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03554 | train |
v3 | Schema:
branches (alias: brc)(code, type, date, id)
schedules(code, level, type, status)
Task: Find amount from branches where amount exceeds the count of salary from schedules for the same id.
SQL: | SELECT amount FROM branches AS brc
WHERE amount > (
SELECT COUNT(salary) FROM schedules AS schd
WHERE schd.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "schedules",
"outer_alias": "brc",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03555 | train |
v1 | Schema:
employees (alias: emp)(status, salary, value, type)
departments(id, type, value, code)
Task: Select id from employees where status exists in departments for the same code.
SQL: | SELECT id FROM employees AS emp
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03556 | train |
v2 | Schema:
departments (alias: dept)(id, name, salary, date)
projects(name, code, id, date)
Task: Find amount from departments where a matching record exists in projects with the same type.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03557 | train |
v2 | Schema:
staff (alias: empl)(name, salary, level, id)
branches(value, type, code, level)
Task: Retrieve name from staff that have at least one corresponding entry in branches sharing the same status.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03558 | train |
v2 | Schema:
accounts (alias: acct)(name, salary, level, value)
orders(salary, name, type, id)
Task: Retrieve code from accounts that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03559 | train |
v2 | Schema:
transactions (alias: txn)(type, name, value, id)
products(amount, level, type, salary)
Task: Find code from transactions where a matching record exists in products with the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03560 | train |
v2 | Schema:
items (alias: lne)(status, level, value, type)
customers(status, code, level, id)
Task: Find id from items where a matching record exists in customers with the same status.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = lne.status
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03561 | train |
v1 | Schema:
sales (alias: sale)(type, status, code, id)
branches(amount, type, code, level)
Task: Retrieve amount from sales whose code is found in branches rows where code matches the outer record.
SQL: | SELECT amount FROM sales AS sale
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "branches",
"outer_alias": "sale",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03562 | train |
v1 | Schema:
employees (alias: emp)(level, code, salary, status)
categories(date, id, code, value)
Task: Retrieve id from employees whose type is found in categories rows where status matches the outer record.
SQL: | SELECT id FROM employees AS emp
WHERE type IN (
SELECT type 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": "type",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03563 | train |
v3 | Schema:
employees (alias: emp)(level, code, date, salary)
managers(name, status, date, type)
Task: Retrieve amount from employees with salary above the COUNT(salary) of managers rows sharing the same id.
SQL: | SELECT amount FROM employees AS emp
WHERE salary > (
SELECT COUNT(salary) FROM managers AS mgr
WHERE mgr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03564 | train |
v3 | Schema:
regions (alias: rgn)(level, salary, status, amount)
invoices(salary, level, amount, value)
Task: Find amount from regions where value exceeds the average value from invoices for the same id.
SQL: | SELECT amount FROM regions AS rgn
WHERE value > (
SELECT AVG(value) FROM invoices AS inv
WHERE inv.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03565 | train |
v1 | Schema:
invoices (alias: inv)(date, value, status, id)
branches(value, amount, name, date)
Task: Find value from invoices where level appears in branches entries with matching status.
SQL: | SELECT value FROM invoices AS inv
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03566 | train |
v2 | Schema:
accounts (alias: acct)(name, salary, status, level)
projects(date, id, level, value)
Task: Retrieve code from accounts that have at least one corresponding entry in projects sharing the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03567 | train |
v3 | Schema:
departments (alias: dept)(name, amount, level, code)
orders(name, level, salary, code)
Task: Retrieve value from departments with value above the MIN(amount) of orders rows sharing the same status.
SQL: | SELECT value FROM departments AS dept
WHERE value > (
SELECT MIN(amount) FROM orders AS ord
WHERE ord.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03568 | train |
v3 | Schema:
departments (alias: dept)(code, level, status, type)
branches(code, id, salary, amount)
Task: Find name from departments where amount exceeds the count of salary from branches for the same type.
SQL: | SELECT name FROM departments AS dept
WHERE amount > (
SELECT COUNT(salary) FROM branches AS brc
WHERE brc.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03569 | train |
v2 | Schema:
transactions (alias: txn)(date, type, amount, id)
departments(date, salary, amount, status)
Task: Retrieve code from transactions that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03570 | train |
v2 | Schema:
shipments (alias: shp)(status, level, salary, name)
employees(type, level, value, status)
Task: Find name from shipments where a matching record exists in employees with the same level.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03571 | train |
v1 | Schema:
staff (alias: empl)(type, salary, date, name)
schedules(status, level, amount, code)
Task: Select code from staff where code exists in schedules for the same code.
SQL: | SELECT code FROM staff AS empl
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03572 | train |
v3 | Schema:
orders (alias: ord)(amount, id, level, status)
regions(status, value, amount, level)
Task: Find code from orders where amount exceeds the minimum value from regions for the same level.
SQL: | SELECT code FROM orders AS ord
WHERE amount > (
SELECT MIN(value) FROM regions AS rgn
WHERE rgn.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03573 | train |
v1 | Schema:
schedules (alias: schd)(salary, value, name, code)
categories(salary, date, amount, status)
Task: Find name from schedules where status appears in categories entries with matching type.
SQL: | SELECT name FROM schedules AS schd
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03574 | train |
v2 | Schema:
shipments (alias: shp)(status, salary, name, type)
invoices(status, salary, code, value)
Task: Retrieve amount from shipments that have at least one corresponding entry in invoices sharing the same level.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03575 | train |
v3 | Schema:
requests (alias: ordr)(salary, status, date, code)
projects(type, status, date, code)
Task: Find code from requests where salary exceeds the average amount from projects for the same level.
SQL: | SELECT code FROM requests AS ordr
WHERE salary > (
SELECT AVG(amount) FROM projects AS prj
WHERE prj.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03576 | train |
v3 | Schema:
branches (alias: brc)(name, level, amount, id)
managers(value, level, id, status)
Task: Retrieve code from branches with value above the COUNT(amount) of managers rows sharing the same type.
SQL: | SELECT code FROM branches AS brc
WHERE value > (
SELECT COUNT(amount) FROM managers AS mgr
WHERE mgr.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "managers",
"outer_alias": "brc",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03577 | train |
v1 | Schema:
tasks (alias: tsk)(name, amount, date, level)
regions(level, type, amount, date)
Task: Retrieve name from tasks whose level is found in regions rows where status matches the outer record.
SQL: | SELECT name FROM tasks AS tsk
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03578 | train |
v1 | Schema:
shipments (alias: shp)(salary, type, name, date)
departments(salary, level, value, amount)
Task: Select amount from shipments where code exists in departments for the same code.
SQL: | SELECT amount 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": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03579 | train |
v3 | Schema:
departments (alias: dept)(salary, level, value, status)
invoices(status, salary, type, code)
Task: Retrieve salary from departments with amount above the SUM(salary) of invoices rows sharing the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE amount > (
SELECT SUM(salary) FROM invoices AS inv
WHERE inv.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "invoices",
"outer_alias": "dept",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03580 | train |
v1 | Schema:
categories (alias: catg)(amount, name, salary, status)
customers(id, salary, amount, status)
Task: Find value from categories where code appears in customers entries with matching level.
SQL: | SELECT value FROM categories AS catg
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03581 | train |
v2 | Schema:
items (alias: lne)(name, status, value, salary)
accounts(type, date, amount, name)
Task: Retrieve amount from items that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = lne.level
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03582 | train |
v1 | Schema:
items (alias: lne)(value, level, name, id)
projects(type, value, amount, level)
Task: Select id from items where code exists in projects for the same status.
SQL: | SELECT id FROM items AS lne
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.status = lne.status
); | {
"outer_table": "items",
"inner_table": "projects",
"outer_alias": "lne",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03583 | train |
v2 | Schema:
transactions (alias: txn)(id, level, name, status)
requests(amount, id, salary, status)
Task: Retrieve id from transactions that have at least one corresponding entry in requests sharing the same id.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03584 | train |
v3 | Schema:
accounts (alias: acct)(status, code, salary, id)
employees(id, salary, date, amount)
Task: Retrieve value from accounts with value above the MIN(value) of employees rows sharing the same level.
SQL: | SELECT value FROM accounts AS acct
WHERE value > (
SELECT MIN(value) FROM employees AS emp
WHERE emp.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03585 | train |
v3 | Schema:
managers (alias: mgr)(type, value, id, name)
sales(id, value, code, date)
Task: Find amount from managers where value exceeds the maximum amount from sales for the same id.
SQL: | SELECT amount FROM managers AS mgr
WHERE value > (
SELECT MAX(amount) FROM sales AS sale
WHERE sale.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03586 | train |
v1 | Schema:
branches (alias: brc)(id, amount, value, code)
categories(type, id, level, amount)
Task: Retrieve salary from branches whose id is found in categories rows where status matches the outer record.
SQL: | SELECT salary FROM branches AS brc
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03587 | train |
v3 | Schema:
staff (alias: empl)(date, status, level, value)
items(name, value, amount, date)
Task: Find salary from staff where value exceeds the average salary from items for the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE value > (
SELECT AVG(salary) FROM items AS lne
WHERE lne.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03588 | train |
v3 | Schema:
branches (alias: brc)(id, type, status, value)
products(date, amount, value, id)
Task: Find value from branches where value exceeds the total value from products for the same status.
SQL: | SELECT value FROM branches AS brc
WHERE value > (
SELECT SUM(value) FROM products AS prod
WHERE prod.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03589 | train |
v3 | Schema:
tasks (alias: tsk)(status, date, amount, type)
invoices(id, value, date, status)
Task: Retrieve amount from tasks with amount above the COUNT(value) of invoices rows sharing the same code.
SQL: | SELECT amount FROM tasks AS tsk
WHERE amount > (
SELECT COUNT(value) FROM invoices AS inv
WHERE inv.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03590 | train |
v1 | Schema:
products (alias: prod)(code, name, value, type)
departments(value, amount, salary, level)
Task: Find name from products where code appears in departments entries with matching status.
SQL: | SELECT name FROM products AS prod
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.status = prod.status
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03591 | train |
v2 | Schema:
invoices (alias: inv)(date, level, amount, status)
accounts(id, amount, code, type)
Task: Retrieve salary from invoices that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03592 | train |
v2 | Schema:
schedules (alias: schd)(level, code, value, date)
products(level, id, name, code)
Task: Find amount from schedules where a matching record exists in products with the same code.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03593 | train |
v3 | Schema:
items (alias: lne)(amount, code, level, id)
products(id, date, type, level)
Task: Find name from items where value exceeds the minimum salary from products for the same id.
SQL: | SELECT name FROM items AS lne
WHERE value > (
SELECT MIN(salary) FROM products AS prod
WHERE prod.id = lne.id
); | {
"outer_table": "items",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03594 | train |
v3 | Schema:
orders (alias: ord)(date, value, id, salary)
schedules(date, name, status, value)
Task: Retrieve value from orders with value above the COUNT(amount) of schedules rows sharing the same type.
SQL: | SELECT value FROM orders AS ord
WHERE value > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03595 | train |
v1 | Schema:
sales (alias: sale)(salary, type, name, date)
schedules(name, value, amount, salary)
Task: Retrieve salary from sales whose level is found in schedules rows where type matches the outer record.
SQL: | SELECT salary FROM sales AS sale
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03596 | train |
v3 | Schema:
departments (alias: dept)(date, amount, name, code)
transactions(date, amount, type, code)
Task: Find amount from departments where salary exceeds the maximum salary from transactions for the same level.
SQL: | SELECT amount FROM departments AS dept
WHERE salary > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03597 | train |
v2 | Schema:
employees (alias: emp)(date, id, code, name)
managers(type, salary, code, name)
Task: Find amount from employees where a matching record exists in managers with the same id.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03598 | train |
v3 | Schema:
schedules (alias: schd)(salary, status, id, name)
transactions(value, code, amount, name)
Task: Find code from schedules where amount exceeds the count of salary from transactions for the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE amount > (
SELECT COUNT(salary) FROM transactions AS txn
WHERE txn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03599 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.