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:
regions (alias: rgn)(amount, level, date, type)
schedules(type, amount, level, status)
Task: Retrieve value from regions whose code is found in schedules rows where status matches the outer record.
SQL: | SELECT value FROM regions AS rgn
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_06600 | train |
v3 | Schema:
products (alias: prod)(type, value, amount, id)
transactions(level, value, id, code)
Task: Retrieve id from products with value above the MAX(salary) of transactions rows sharing the same status.
SQL: | SELECT id FROM products AS prod
WHERE value > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.status = prod.status
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06601 | train |
v1 | Schema:
customers (alias: cust)(id, amount, name, level)
orders(value, id, code, type)
Task: Find name from customers where type appears in orders entries with matching level.
SQL: | SELECT name FROM customers AS cust
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06602 | train |
v1 | Schema:
departments (alias: dept)(date, name, level, code)
items(salary, type, level, date)
Task: Select code from departments where id exists in items for the same status.
SQL: | SELECT code FROM departments AS dept
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06603 | train |
v3 | Schema:
customers (alias: cust)(date, salary, level, type)
managers(amount, type, level, value)
Task: Retrieve value from customers with salary above the AVG(value) of managers rows sharing the same status.
SQL: | SELECT value FROM customers AS cust
WHERE salary > (
SELECT AVG(value) FROM managers AS mgr
WHERE mgr.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06604 | train |
v3 | Schema:
staff (alias: empl)(id, value, amount, type)
managers(level, amount, value, name)
Task: Find value from staff where value exceeds the maximum amount from managers for the same id.
SQL: | SELECT value FROM staff AS empl
WHERE value > (
SELECT MAX(amount) FROM managers AS mgr
WHERE mgr.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06605 | train |
v3 | Schema:
customers (alias: cust)(type, date, amount, value)
regions(level, id, amount, date)
Task: Find code from customers where amount exceeds the minimum salary from regions for the same type.
SQL: | SELECT code FROM customers AS cust
WHERE amount > (
SELECT MIN(salary) FROM regions AS rgn
WHERE rgn.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06606 | train |
v3 | Schema:
items (alias: lne)(status, name, salary, value)
branches(id, status, value, code)
Task: Find code from items where salary exceeds the count of salary from branches for the same id.
SQL: | SELECT code FROM items AS lne
WHERE salary > (
SELECT COUNT(salary) FROM branches AS brc
WHERE brc.id = lne.id
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_06607 | train |
v1 | Schema:
categories (alias: catg)(level, amount, code, value)
tasks(level, name, type, date)
Task: Find name from categories where type appears in tasks entries with matching code.
SQL: | SELECT name FROM categories AS catg
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06608 | train |
v1 | Schema:
projects (alias: prj)(date, salary, amount, type)
orders(code, salary, status, value)
Task: Find salary from projects where level appears in orders entries with matching code.
SQL: | SELECT salary FROM projects AS prj
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "orders",
"outer_alias": "prj",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_06609 | train |
v3 | Schema:
orders (alias: ord)(name, status, value, salary)
customers(date, id, status, name)
Task: Find amount from orders where salary exceeds the maximum value from customers for the same type.
SQL: | SELECT amount FROM orders AS ord
WHERE salary > (
SELECT MAX(value) FROM customers AS cust
WHERE cust.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06610 | train |
v1 | Schema:
categories (alias: catg)(amount, code, name, date)
regions(name, code, type, level)
Task: Retrieve name from categories whose level is found in regions rows where status matches the outer record.
SQL: | SELECT name FROM categories AS catg
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06611 | train |
v1 | Schema:
managers (alias: mgr)(code, name, value, amount)
orders(code, salary, value, name)
Task: Find amount from managers where id appears in orders entries with matching level.
SQL: | SELECT amount FROM managers AS mgr
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06612 | train |
v1 | Schema:
staff (alias: empl)(value, id, name, status)
categories(value, code, name, id)
Task: Find id from staff where type appears in categories entries with matching type.
SQL: | SELECT id FROM staff AS empl
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06613 | train |
v3 | Schema:
departments (alias: dept)(id, amount, salary, code)
shipments(type, amount, level, salary)
Task: Retrieve id from departments with salary above the MAX(salary) of shipments rows sharing the same type.
SQL: | SELECT id FROM departments AS dept
WHERE salary > (
SELECT MAX(salary) FROM shipments AS shp
WHERE shp.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06614 | train |
v3 | Schema:
accounts (alias: acct)(value, code, date, amount)
managers(value, type, code, name)
Task: Retrieve code from accounts with amount above the AVG(amount) of managers rows sharing the same id.
SQL: | SELECT code FROM accounts AS acct
WHERE amount > (
SELECT AVG(amount) FROM managers AS mgr
WHERE mgr.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06615 | train |
v2 | Schema:
regions (alias: rgn)(id, name, salary, date)
items(date, salary, value, type)
Task: Retrieve code from regions that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_06616 | train |
v3 | Schema:
accounts (alias: acct)(date, code, level, name)
invoices(status, id, level, value)
Task: Find salary from accounts where amount exceeds the average value from invoices for the same level.
SQL: | SELECT salary FROM accounts AS acct
WHERE amount > (
SELECT AVG(value) FROM invoices AS inv
WHERE inv.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06617 | train |
v2 | Schema:
orders (alias: ord)(salary, status, level, type)
managers(status, code, type, level)
Task: Find code from orders where a matching record exists in managers with the same type.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06618 | train |
v1 | Schema:
orders (alias: ord)(id, type, status, name)
regions(salary, amount, status, value)
Task: Retrieve salary from orders whose code is found in regions rows where status matches the outer record.
SQL: | SELECT salary FROM orders AS ord
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06619 | train |
v1 | Schema:
orders (alias: ord)(status, name, salary, value)
transactions(status, id, date, amount)
Task: Select value from orders where status exists in transactions for the same id.
SQL: | SELECT value FROM orders AS ord
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06620 | train |
v1 | Schema:
sales (alias: sale)(level, code, salary, name)
requests(level, code, amount, date)
Task: Retrieve code from sales whose id is found in requests rows where code matches the outer record.
SQL: | SELECT code FROM sales AS sale
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06621 | train |
v2 | Schema:
departments (alias: dept)(salary, amount, date, id)
customers(code, name, status, amount)
Task: Retrieve salary from departments that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06622 | train |
v1 | Schema:
tasks (alias: tsk)(value, level, status, date)
departments(name, id, salary, code)
Task: Retrieve name from tasks whose code is found in departments rows where id matches the outer record.
SQL: | SELECT name FROM tasks AS tsk
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "tsk",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_06623 | train |
v2 | Schema:
tasks (alias: tsk)(id, type, status, salary)
requests(amount, type, value, salary)
Task: Find value from tasks where a matching record exists in requests with the same status.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_06624 | train |
v2 | Schema:
transactions (alias: txn)(code, id, value, date)
customers(name, id, date, amount)
Task: Retrieve id from transactions that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06625 | train |
v1 | Schema:
projects (alias: prj)(type, id, level, status)
transactions(salary, status, date, type)
Task: Select name from projects where level exists in transactions for the same type.
SQL: | SELECT name FROM projects AS prj
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_06626 | train |
v3 | Schema:
transactions (alias: txn)(salary, date, name, amount)
requests(level, date, value, type)
Task: Retrieve value from transactions with amount above the MIN(salary) of requests rows sharing the same status.
SQL: | SELECT value FROM transactions AS txn
WHERE amount > (
SELECT MIN(salary) FROM requests AS ordr
WHERE ordr.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06627 | train |
v2 | Schema:
staff (alias: empl)(date, type, code, id)
requests(type, code, date, amount)
Task: Retrieve value from staff that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06628 | train |
v3 | Schema:
employees (alias: emp)(amount, type, name, status)
shipments(code, amount, date, level)
Task: Find value from employees where amount exceeds the count of amount from shipments for the same code.
SQL: | SELECT value FROM employees AS emp
WHERE amount > (
SELECT COUNT(amount) FROM shipments AS shp
WHERE shp.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06629 | train |
v3 | Schema:
staff (alias: empl)(name, code, date, type)
projects(salary, id, amount, date)
Task: Retrieve value from staff with value above the MIN(amount) of projects rows sharing the same type.
SQL: | SELECT value FROM staff AS empl
WHERE value > (
SELECT MIN(amount) FROM projects AS prj
WHERE prj.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06630 | train |
v1 | Schema:
shipments (alias: shp)(amount, name, date, type)
categories(name, type, value, id)
Task: Find value from shipments where type appears in categories entries with matching code.
SQL: | SELECT value FROM shipments AS shp
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_06631 | train |
v1 | Schema:
schedules (alias: schd)(amount, salary, level, name)
shipments(level, salary, type, amount)
Task: Retrieve salary from schedules whose code is found in shipments rows where level matches the outer record.
SQL: | SELECT salary FROM schedules AS schd
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06632 | train |
v3 | Schema:
products (alias: prod)(salary, value, id, status)
staff(type, salary, status, name)
Task: Find value from products where value exceeds the count of amount from staff for the same status.
SQL: | SELECT value FROM products AS prod
WHERE value > (
SELECT COUNT(amount) FROM staff AS empl
WHERE empl.status = prod.status
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06633 | train |
v2 | Schema:
items (alias: lne)(code, value, salary, date)
staff(level, code, status, name)
Task: Retrieve code from items that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = lne.id
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_06634 | train |
v2 | Schema:
orders (alias: ord)(level, salary, type, value)
tasks(status, name, id, value)
Task: Find value from orders where a matching record exists in tasks with the same code.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06635 | train |
v1 | Schema:
requests (alias: ordr)(amount, name, date, level)
customers(value, amount, id, salary)
Task: Retrieve salary from requests whose status is found in customers rows where id matches the outer record.
SQL: | SELECT salary FROM requests AS ordr
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_06636 | train |
v1 | Schema:
regions (alias: rgn)(salary, status, code, amount)
orders(code, value, salary, date)
Task: Retrieve amount from regions whose status is found in orders rows where type matches the outer record.
SQL: | SELECT amount FROM regions AS rgn
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_06637 | train |
v1 | Schema:
branches (alias: brc)(type, status, salary, id)
schedules(id, date, code, name)
Task: Retrieve value from branches whose level is found in schedules rows where id matches the outer record.
SQL: | SELECT value FROM branches AS brc
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "schedules",
"outer_alias": "brc",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06638 | train |
v2 | Schema:
staff (alias: empl)(id, name, amount, value)
projects(salary, type, level, value)
Task: Find id from staff where a matching record exists in projects with the same level.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06639 | train |
v2 | Schema:
staff (alias: empl)(type, name, amount, date)
customers(level, id, date, amount)
Task: Retrieve id from staff that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06640 | train |
v2 | Schema:
sales (alias: sale)(salary, date, name, code)
departments(id, name, status, value)
Task: Find salary from sales where a matching record exists in departments with the same id.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06641 | train |
v3 | Schema:
schedules (alias: schd)(salary, value, name, status)
accounts(value, level, status, amount)
Task: Retrieve value from schedules with salary above the COUNT(value) of accounts rows sharing the same code.
SQL: | SELECT value FROM schedules AS schd
WHERE salary > (
SELECT COUNT(value) FROM accounts AS acct
WHERE acct.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06642 | train |
v2 | Schema:
items (alias: lne)(level, date, status, salary)
sales(value, salary, type, date)
Task: Retrieve id from items that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = lne.level
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_06643 | train |
v2 | Schema:
departments (alias: dept)(code, amount, salary, date)
tasks(level, id, value, salary)
Task: Find id from departments where a matching record exists in tasks with the same status.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06644 | train |
v2 | Schema:
tasks (alias: tsk)(name, level, status, salary)
sales(date, id, type, salary)
Task: Retrieve value from tasks that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_06645 | train |
v2 | Schema:
requests (alias: ordr)(type, amount, code, status)
items(value, date, amount, code)
Task: Retrieve value from requests that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_06646 | train |
v1 | Schema:
categories (alias: catg)(status, level, id, name)
shipments(salary, date, amount, code)
Task: Retrieve id from categories whose status is found in shipments rows where type matches the outer record.
SQL: | SELECT id 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": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06647 | train |
v2 | Schema:
sales (alias: sale)(id, salary, date, code)
categories(id, code, date, level)
Task: Retrieve name from sales that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06648 | train |
v1 | Schema:
transactions (alias: txn)(type, amount, code, status)
regions(value, type, salary, code)
Task: Select id from transactions where id exists in regions for the same id.
SQL: | SELECT id FROM transactions AS txn
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06649 | train |
v2 | Schema:
managers (alias: mgr)(amount, level, code, status)
orders(name, id, salary, value)
Task: Find amount from managers where a matching record exists in orders with the same status.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06650 | train |
v2 | Schema:
shipments (alias: shp)(level, value, status, type)
accounts(level, salary, code, id)
Task: Find id from shipments where a matching record exists in accounts with the same status.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_06651 | train |
v2 | Schema:
customers (alias: cust)(id, type, level, value)
tasks(amount, name, type, value)
Task: Retrieve name from customers that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "tasks",
"outer_alias": "cust",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06652 | train |
v1 | Schema:
items (alias: lne)(value, code, date, id)
sales(code, salary, date, level)
Task: Select value from items where code exists in sales for the same code.
SQL: | SELECT value FROM items AS lne
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.code = lne.code
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_06653 | train |
v3 | Schema:
invoices (alias: inv)(code, level, name, id)
branches(type, status, salary, date)
Task: Find code from invoices where value exceeds the average amount from branches for the same status.
SQL: | SELECT code FROM invoices AS inv
WHERE value > (
SELECT AVG(amount) FROM branches AS brc
WHERE brc.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06654 | train |
v1 | Schema:
projects (alias: prj)(status, level, name, salary)
schedules(salary, amount, type, date)
Task: Find amount from projects where level appears in schedules entries with matching status.
SQL: | SELECT amount FROM projects AS prj
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "schedules",
"outer_alias": "prj",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_06655 | train |
v3 | Schema:
shipments (alias: shp)(date, amount, status, id)
tasks(salary, amount, level, status)
Task: Retrieve name from shipments with value above the AVG(value) of tasks rows sharing the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE value > (
SELECT AVG(value) FROM tasks AS tsk
WHERE tsk.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_06656 | train |
v3 | Schema:
regions (alias: rgn)(level, name, amount, type)
departments(type, date, value, id)
Task: Find value from regions where value exceeds the minimum salary from departments for the same status.
SQL: | SELECT value FROM regions AS rgn
WHERE value > (
SELECT MIN(salary) FROM departments AS dept
WHERE dept.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_06657 | train |
v3 | Schema:
managers (alias: mgr)(id, code, amount, salary)
departments(code, amount, name, salary)
Task: Find salary from managers where amount exceeds the average value from departments for the same type.
SQL: | SELECT salary FROM managers AS mgr
WHERE amount > (
SELECT AVG(value) FROM departments AS dept
WHERE dept.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06658 | train |
v2 | Schema:
categories (alias: catg)(date, code, level, id)
tasks(id, value, amount, name)
Task: Find amount from categories where a matching record exists in tasks with the same type.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06659 | train |
v3 | Schema:
schedules (alias: schd)(type, name, amount, date)
staff(salary, value, status, id)
Task: Find name from schedules where value exceeds the minimum salary from staff for the same code.
SQL: | SELECT name FROM schedules AS schd
WHERE value > (
SELECT MIN(salary) FROM staff AS empl
WHERE empl.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06660 | train |
v1 | Schema:
branches (alias: brc)(level, name, type, status)
sales(level, id, amount, type)
Task: Select name from branches where code exists in sales for the same level.
SQL: | SELECT name FROM branches AS brc
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06661 | train |
v2 | Schema:
projects (alias: prj)(name, level, id, status)
invoices(value, date, name, code)
Task: Find code from projects where a matching record exists in invoices with the same type.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_06662 | train |
v2 | Schema:
requests (alias: ordr)(amount, salary, type, name)
staff(amount, date, value, salary)
Task: Find id from requests where a matching record exists in staff with the same level.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_06663 | train |
v1 | Schema:
regions (alias: rgn)(type, date, code, amount)
staff(level, code, date, id)
Task: Find code from regions where level appears in staff entries with matching id.
SQL: | SELECT code FROM regions AS rgn
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_06664 | train |
v1 | Schema:
products (alias: prod)(salary, name, amount, value)
managers(status, type, name, code)
Task: Retrieve id from products whose status is found in managers rows where status matches the outer record.
SQL: | SELECT id FROM products AS prod
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.status = prod.status
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06665 | train |
v3 | Schema:
branches (alias: brc)(code, name, status, value)
tasks(code, name, id, salary)
Task: Retrieve value from branches with value above the AVG(value) of tasks rows sharing the same type.
SQL: | SELECT value FROM branches AS brc
WHERE value > (
SELECT AVG(value) FROM tasks AS tsk
WHERE tsk.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06666 | train |
v2 | Schema:
sales (alias: sale)(code, amount, date, status)
transactions(salary, name, type, amount)
Task: Retrieve code from sales that have at least one corresponding entry in transactions sharing the same type.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06667 | train |
v3 | Schema:
transactions (alias: txn)(id, amount, status, level)
schedules(status, code, date, value)
Task: Find value from transactions where amount exceeds the minimum amount from schedules for the same status.
SQL: | SELECT value FROM transactions AS txn
WHERE amount > (
SELECT MIN(amount) FROM schedules AS schd
WHERE schd.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06668 | train |
v3 | Schema:
invoices (alias: inv)(code, date, value, level)
tasks(amount, value, code, name)
Task: Find salary from invoices where salary exceeds the average value from tasks for the same level.
SQL: | SELECT salary FROM invoices AS inv
WHERE salary > (
SELECT AVG(value) FROM tasks AS tsk
WHERE tsk.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06669 | train |
v2 | Schema:
items (alias: lne)(id, salary, name, type)
categories(salary, name, type, amount)
Task: Find code from items where a matching record exists in categories with the same level.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = lne.level
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_06670 | train |
v1 | Schema:
invoices (alias: inv)(level, salary, status, name)
employees(level, id, status, code)
Task: Find name from invoices where level appears in employees entries with matching status.
SQL: | SELECT name FROM invoices AS inv
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06671 | train |
v1 | Schema:
shipments (alias: shp)(amount, id, status, value)
sales(code, status, amount, id)
Task: Retrieve name from shipments whose code is found in sales rows where code matches the outer record.
SQL: | SELECT name FROM shipments AS shp
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_06672 | train |
v2 | Schema:
requests (alias: ordr)(name, status, type, date)
branches(level, id, code, value)
Task: Retrieve value from requests that have at least one corresponding entry in branches sharing the same id.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_06673 | train |
v2 | Schema:
orders (alias: ord)(type, code, status, salary)
departments(type, name, value, level)
Task: Retrieve value from orders that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06674 | train |
v2 | Schema:
staff (alias: empl)(amount, salary, date, status)
accounts(date, status, name, code)
Task: Retrieve value from staff that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06675 | train |
v3 | Schema:
managers (alias: mgr)(id, code, value, status)
items(status, type, level, amount)
Task: Find salary from managers where salary exceeds the average value from items for the same status.
SQL: | SELECT salary FROM managers AS mgr
WHERE salary > (
SELECT AVG(value) FROM items AS lne
WHERE lne.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06676 | train |
v3 | Schema:
schedules (alias: schd)(status, salary, name, value)
regions(status, amount, id, type)
Task: Retrieve code from schedules with value above the MAX(salary) of regions rows sharing the same type.
SQL: | SELECT code FROM schedules AS schd
WHERE value > (
SELECT MAX(salary) FROM regions AS rgn
WHERE rgn.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06677 | train |
v3 | Schema:
employees (alias: emp)(amount, value, level, status)
shipments(code, amount, value, id)
Task: Find value from employees where amount exceeds the total amount from shipments for the same type.
SQL: | SELECT value FROM employees AS emp
WHERE amount > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06678 | train |
v1 | Schema:
orders (alias: ord)(salary, status, code, id)
requests(date, salary, id, type)
Task: Find amount from orders where level appears in requests entries with matching level.
SQL: | SELECT amount FROM orders AS ord
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06679 | train |
v3 | Schema:
departments (alias: dept)(value, date, id, code)
managers(level, amount, value, salary)
Task: Retrieve code from departments with salary above the COUNT(salary) of managers rows sharing the same level.
SQL: | SELECT code FROM departments AS dept
WHERE salary > (
SELECT COUNT(salary) FROM managers AS mgr
WHERE mgr.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06680 | train |
v3 | Schema:
products (alias: prod)(amount, id, status, code)
requests(salary, date, code, level)
Task: Retrieve name from products with value above the COUNT(value) of requests rows sharing the same id.
SQL: | SELECT name FROM products AS prod
WHERE value > (
SELECT COUNT(value) FROM requests AS ordr
WHERE ordr.id = prod.id
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06681 | train |
v1 | Schema:
staff (alias: empl)(value, code, level, status)
items(status, value, id, level)
Task: Select code from staff where id exists in items for the same level.
SQL: | SELECT code FROM staff AS empl
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06682 | train |
v1 | Schema:
branches (alias: brc)(name, code, status, type)
departments(salary, date, amount, id)
Task: Retrieve amount from branches whose level is found in departments rows where status matches the outer record.
SQL: | SELECT amount FROM branches AS brc
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "departments",
"outer_alias": "brc",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06683 | train |
v1 | Schema:
staff (alias: empl)(date, salary, code, type)
shipments(type, id, date, salary)
Task: Retrieve salary from staff whose id is found in shipments rows where level matches the outer record.
SQL: | SELECT salary FROM staff AS empl
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06684 | train |
v3 | Schema:
staff (alias: empl)(status, salary, name, amount)
orders(salary, status, id, value)
Task: Retrieve code from staff with salary above the SUM(salary) of orders rows sharing the same code.
SQL: | SELECT code FROM staff AS empl
WHERE salary > (
SELECT SUM(salary) FROM orders AS ord
WHERE ord.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06685 | train |
v3 | Schema:
transactions (alias: txn)(amount, code, salary, id)
regions(value, id, level, amount)
Task: Find salary from transactions where salary exceeds the average amount from regions for the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE salary > (
SELECT AVG(amount) FROM regions AS rgn
WHERE rgn.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06686 | train |
v3 | Schema:
regions (alias: rgn)(amount, name, level, id)
products(status, date, type, value)
Task: Retrieve salary from regions with amount above the MIN(amount) of products rows sharing the same level.
SQL: | SELECT salary FROM regions AS rgn
WHERE amount > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_06687 | train |
v1 | Schema:
tasks (alias: tsk)(amount, id, salary, status)
accounts(value, name, level, type)
Task: Retrieve value from tasks whose type is found in accounts rows where status matches the outer record.
SQL: | SELECT value FROM tasks AS tsk
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_06688 | train |
v2 | Schema:
managers (alias: mgr)(status, salary, date, value)
products(level, status, value, date)
Task: Find name from managers where a matching record exists in products with the same type.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06689 | train |
v3 | Schema:
invoices (alias: inv)(status, amount, salary, type)
schedules(type, status, amount, value)
Task: Retrieve value from invoices with amount above the SUM(salary) of schedules rows sharing the same status.
SQL: | SELECT value FROM invoices AS inv
WHERE amount > (
SELECT SUM(salary) FROM schedules AS schd
WHERE schd.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06690 | train |
v2 | Schema:
projects (alias: prj)(name, salary, amount, value)
tasks(salary, status, amount, type)
Task: Retrieve id from projects that have at least one corresponding entry in tasks sharing the same status.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "prj",
"inner_alias": "tsk",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_06691 | train |
v2 | Schema:
customers (alias: cust)(name, salary, type, date)
schedules(id, code, type, name)
Task: Retrieve value from customers that have at least one corresponding entry in schedules sharing the same id.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06692 | train |
v1 | Schema:
shipments (alias: shp)(amount, date, value, type)
accounts(type, value, salary, date)
Task: Find salary from shipments where status appears in accounts entries with matching code.
SQL: | SELECT salary FROM shipments AS shp
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_06693 | train |
v1 | Schema:
projects (alias: prj)(type, name, level, amount)
managers(status, id, type, amount)
Task: Select amount from projects where level exists in managers for the same code.
SQL: | SELECT amount FROM projects AS prj
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_06694 | train |
v1 | Schema:
customers (alias: cust)(salary, status, type, value)
employees(level, status, value, id)
Task: Find id from customers where level appears in employees entries with matching status.
SQL: | SELECT id FROM customers AS cust
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06695 | train |
v2 | Schema:
invoices (alias: inv)(code, value, amount, level)
customers(status, value, id, type)
Task: Find salary from invoices where a matching record exists in customers with the same level.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06696 | train |
v3 | Schema:
employees (alias: emp)(amount, date, name, type)
branches(name, date, type, level)
Task: Retrieve salary from employees with value above the AVG(amount) of branches rows sharing the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE value > (
SELECT AVG(amount) FROM branches AS brc
WHERE brc.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06697 | train |
v3 | Schema:
items (alias: lne)(status, value, amount, date)
requests(code, id, value, status)
Task: Retrieve value from items with value above the SUM(salary) of requests rows sharing the same code.
SQL: | SELECT value FROM items AS lne
WHERE value > (
SELECT SUM(salary) FROM requests AS ordr
WHERE ordr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_06698 | train |
v3 | Schema:
accounts (alias: acct)(date, name, id, value)
transactions(salary, type, code, name)
Task: Retrieve value from accounts with salary above the AVG(amount) of transactions rows sharing the same status.
SQL: | SELECT value FROM accounts AS acct
WHERE salary > (
SELECT AVG(amount) FROM transactions AS txn
WHERE txn.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06699 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.