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:
products (alias: prod)(value, status, name, salary)
accounts(status, salary, id, name)
Task: Find name from products where a matching record exists in accounts with the same id.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = prod.id
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08800 | train |
v2 | Schema:
tasks (alias: tsk)(status, name, id, code)
employees(code, type, date, value)
Task: Find amount from tasks where a matching record exists in employees with the same status.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "tsk",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08801 | train |
v1 | Schema:
orders (alias: ord)(name, salary, value, amount)
sales(id, type, code, salary)
Task: Select salary from orders where level exists in sales for the same level.
SQL: | SELECT salary FROM orders AS ord
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08802 | train |
v3 | Schema:
customers (alias: cust)(status, salary, name, date)
accounts(name, status, value, code)
Task: Retrieve name from customers with salary above the MAX(amount) of accounts rows sharing the same status.
SQL: | SELECT name FROM customers AS cust
WHERE salary > (
SELECT MAX(amount) FROM accounts AS acct
WHERE acct.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08803 | train |
v1 | Schema:
invoices (alias: inv)(value, code, status, name)
tasks(type, name, amount, date)
Task: Select value from invoices where id exists in tasks for the same level.
SQL: | SELECT value FROM invoices AS inv
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08804 | train |
v2 | Schema:
departments (alias: dept)(amount, status, date, name)
accounts(id, type, status, amount)
Task: Retrieve code from departments that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08805 | train |
v2 | Schema:
transactions (alias: txn)(level, status, amount, value)
items(level, type, status, id)
Task: Find amount from transactions where a matching record exists in items with the same code.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08806 | train |
v1 | Schema:
regions (alias: rgn)(code, value, salary, amount)
schedules(status, salary, name, amount)
Task: Find amount from regions where type appears in schedules entries with matching id.
SQL: | SELECT amount FROM regions AS rgn
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08807 | train |
v1 | Schema:
requests (alias: ordr)(amount, status, name, value)
categories(id, amount, name, salary)
Task: Retrieve name from requests whose id is found in categories rows where id matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08808 | train |
v1 | Schema:
requests (alias: ordr)(level, date, code, value)
products(value, level, id, date)
Task: Find salary from requests where code appears in products entries with matching status.
SQL: | SELECT salary FROM requests AS ordr
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08809 | train |
v3 | Schema:
departments (alias: dept)(name, value, id, status)
sales(status, level, salary, amount)
Task: Find salary from departments where salary exceeds the minimum salary from sales for the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE salary > (
SELECT MIN(salary) FROM sales AS sale
WHERE sale.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08810 | train |
v1 | Schema:
projects (alias: prj)(date, salary, level, code)
departments(type, level, code, id)
Task: Select name from projects where id exists in departments for the same status.
SQL: | SELECT name FROM projects AS prj
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08811 | train |
v1 | Schema:
categories (alias: catg)(date, salary, value, id)
sales(value, type, date, name)
Task: Select value from categories where level exists in sales for the same type.
SQL: | SELECT value FROM categories AS catg
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08812 | train |
v2 | Schema:
regions (alias: rgn)(id, name, status, type)
employees(name, status, salary, code)
Task: Retrieve code from regions that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08813 | train |
v3 | Schema:
transactions (alias: txn)(name, date, id, amount)
departments(value, amount, code, salary)
Task: Retrieve code from transactions with amount above the COUNT(salary) of departments rows sharing the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE amount > (
SELECT COUNT(salary) FROM departments AS dept
WHERE dept.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08814 | train |
v1 | Schema:
projects (alias: prj)(type, value, date, name)
tasks(status, name, value, salary)
Task: Select salary from projects where type exists in tasks for the same status.
SQL: | SELECT salary FROM projects AS prj
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "prj",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08815 | train |
v3 | Schema:
items (alias: lne)(code, value, amount, status)
schedules(id, amount, code, type)
Task: Find id from items where salary exceeds the total amount from schedules for the same status.
SQL: | SELECT id FROM items AS lne
WHERE salary > (
SELECT SUM(amount) FROM schedules AS schd
WHERE schd.status = lne.status
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08816 | train |
v1 | Schema:
products (alias: prod)(salary, code, date, name)
shipments(salary, type, id, date)
Task: Find name from products where level appears in shipments entries with matching code.
SQL: | SELECT name FROM products AS prod
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.code = prod.code
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08817 | train |
v1 | Schema:
regions (alias: rgn)(code, id, amount, level)
managers(id, status, amount, salary)
Task: Select code from regions where level exists in managers for the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08818 | train |
v1 | Schema:
regions (alias: rgn)(level, code, id, name)
products(name, code, level, salary)
Task: Find salary from regions where status appears in products entries with matching type.
SQL: | SELECT salary FROM regions AS rgn
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08819 | train |
v2 | Schema:
managers (alias: mgr)(status, salary, level, name)
accounts(type, id, status, name)
Task: Find value from managers where a matching record exists in accounts with the same type.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08820 | train |
v2 | Schema:
customers (alias: cust)(level, date, amount, name)
managers(salary, id, level, status)
Task: Find id from customers where a matching record exists in managers with the same level.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08821 | train |
v1 | Schema:
invoices (alias: inv)(salary, code, type, value)
requests(name, code, type, date)
Task: Find value from invoices where status appears in requests entries with matching code.
SQL: | SELECT value FROM invoices AS inv
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08822 | train |
v2 | Schema:
schedules (alias: schd)(id, level, type, code)
categories(date, type, status, level)
Task: Retrieve id from schedules that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08823 | train |
v1 | Schema:
departments (alias: dept)(code, amount, date, status)
orders(status, salary, date, code)
Task: Retrieve name from departments whose code is found in orders rows where code matches the outer record.
SQL: | SELECT name FROM departments AS dept
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08824 | train |
v1 | Schema:
sales (alias: sale)(status, code, name, value)
shipments(level, status, amount, type)
Task: Find name from sales where id appears in shipments entries with matching type.
SQL: | SELECT name FROM sales AS sale
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08825 | train |
v1 | Schema:
requests (alias: ordr)(salary, status, type, id)
tasks(level, salary, id, code)
Task: Find value from requests where id appears in tasks entries with matching id.
SQL: | SELECT value FROM requests AS ordr
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08826 | train |
v3 | Schema:
invoices (alias: inv)(code, salary, value, status)
regions(id, code, level, amount)
Task: Find code from invoices where salary exceeds the total value from regions for the same code.
SQL: | SELECT code FROM invoices AS inv
WHERE salary > (
SELECT SUM(value) FROM regions AS rgn
WHERE rgn.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08827 | train |
v1 | Schema:
tasks (alias: tsk)(name, status, amount, value)
shipments(amount, salary, code, type)
Task: Find id from tasks where code appears in shipments entries with matching status.
SQL: | SELECT id FROM tasks AS tsk
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08828 | train |
v2 | Schema:
categories (alias: catg)(amount, status, salary, value)
items(status, amount, value, code)
Task: Find id from categories where a matching record exists in items with the same status.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08829 | train |
v1 | Schema:
staff (alias: empl)(status, value, date, id)
employees(status, level, code, salary)
Task: Select id from staff where id exists in employees for the same code.
SQL: | SELECT id FROM staff AS empl
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08830 | train |
v1 | Schema:
items (alias: lne)(value, type, date, id)
categories(code, id, date, amount)
Task: Retrieve value from items whose id is found in categories rows where id matches the outer record.
SQL: | SELECT value FROM items AS lne
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.id = lne.id
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08831 | train |
v3 | Schema:
transactions (alias: txn)(date, id, amount, name)
requests(id, type, status, name)
Task: Find code from transactions where amount exceeds the total value from requests for the same code.
SQL: | SELECT code FROM transactions AS txn
WHERE amount > (
SELECT SUM(value) FROM requests AS ordr
WHERE ordr.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08832 | train |
v1 | Schema:
employees (alias: emp)(value, amount, name, level)
managers(type, value, name, status)
Task: Select id from employees where status exists in managers for the same status.
SQL: | SELECT id FROM employees AS emp
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08833 | train |
v3 | Schema:
accounts (alias: acct)(code, amount, level, name)
orders(status, name, level, value)
Task: Retrieve salary from accounts with value above the COUNT(amount) of orders rows sharing the same level.
SQL: | SELECT salary FROM accounts AS acct
WHERE value > (
SELECT COUNT(amount) FROM orders AS ord
WHERE ord.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08834 | train |
v1 | Schema:
customers (alias: cust)(level, id, value, salary)
categories(status, amount, value, level)
Task: Retrieve code from customers whose status is found in categories rows where status matches the outer record.
SQL: | SELECT code FROM customers AS cust
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08835 | train |
v1 | Schema:
projects (alias: prj)(name, date, salary, level)
categories(status, value, code, id)
Task: Select amount from projects where status exists in categories for the same id.
SQL: | SELECT amount FROM projects AS prj
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08836 | train |
v3 | Schema:
regions (alias: rgn)(type, status, value, date)
products(value, name, amount, code)
Task: Find value from regions where salary exceeds the maximum salary from products for the same type.
SQL: | SELECT value FROM regions AS rgn
WHERE salary > (
SELECT MAX(salary) FROM products AS prod
WHERE prod.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08837 | train |
v1 | Schema:
invoices (alias: inv)(level, amount, salary, name)
managers(type, value, amount, name)
Task: Select code from invoices where code exists in managers for the same id.
SQL: | SELECT code FROM invoices AS inv
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08838 | train |
v1 | Schema:
items (alias: lne)(level, value, amount, type)
staff(date, id, amount, level)
Task: Select code from items where type exists in staff for the same type.
SQL: | SELECT code FROM items AS lne
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.type = lne.type
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08839 | train |
v3 | Schema:
orders (alias: ord)(level, status, type, value)
items(type, status, salary, name)
Task: Retrieve amount from orders with salary above the SUM(amount) of items rows sharing the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE salary > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08840 | train |
v3 | Schema:
managers (alias: mgr)(value, amount, id, status)
requests(id, status, date, amount)
Task: Retrieve name from managers with amount above the SUM(value) of requests rows sharing the same level.
SQL: | SELECT name FROM managers AS mgr
WHERE amount > (
SELECT SUM(value) FROM requests AS ordr
WHERE ordr.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08841 | train |
v3 | Schema:
tasks (alias: tsk)(salary, code, status, value)
branches(status, salary, code, date)
Task: Find id from tasks where amount exceeds the average value from branches for the same type.
SQL: | SELECT id FROM tasks AS tsk
WHERE amount > (
SELECT AVG(value) FROM branches AS brc
WHERE brc.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08842 | train |
v3 | Schema:
orders (alias: ord)(name, type, amount, status)
products(amount, status, salary, date)
Task: Retrieve amount from orders with amount above the MIN(value) of products rows sharing the same id.
SQL: | SELECT amount FROM orders AS ord
WHERE amount > (
SELECT MIN(value) FROM products AS prod
WHERE prod.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08843 | train |
v3 | Schema:
projects (alias: prj)(type, name, salary, date)
tasks(name, type, date, status)
Task: Find code from projects where salary exceeds the maximum salary from tasks for the same id.
SQL: | SELECT code FROM projects AS prj
WHERE salary > (
SELECT MAX(salary) FROM tasks AS tsk
WHERE tsk.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "prj",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08844 | train |
v1 | Schema:
invoices (alias: inv)(salary, value, status, type)
transactions(value, name, date, status)
Task: Retrieve id from invoices whose id is found in transactions rows where id matches the outer record.
SQL: | SELECT id FROM invoices AS inv
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08845 | train |
v2 | Schema:
managers (alias: mgr)(id, salary, value, amount)
shipments(name, value, code, level)
Task: Retrieve amount from managers that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08846 | train |
v1 | Schema:
categories (alias: catg)(id, date, name, salary)
sales(status, name, amount, date)
Task: Retrieve id from categories whose type is found in sales rows where level matches the outer record.
SQL: | SELECT id FROM categories AS catg
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08847 | train |
v1 | Schema:
tasks (alias: tsk)(value, code, status, type)
customers(name, salary, level, type)
Task: Select name from tasks where type exists in customers for the same type.
SQL: | SELECT name FROM tasks AS tsk
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "tsk",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08848 | train |
v2 | Schema:
accounts (alias: acct)(status, type, name, level)
employees(value, id, date, amount)
Task: Find name from accounts where a matching record exists in employees with the same code.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08849 | train |
v1 | Schema:
projects (alias: prj)(name, id, level, salary)
departments(name, amount, date, id)
Task: Retrieve id from projects whose code is found in departments rows where type matches the outer record.
SQL: | SELECT id FROM projects AS prj
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08850 | train |
v1 | Schema:
managers (alias: mgr)(level, type, code, date)
branches(value, type, id, code)
Task: Select name from managers where level exists in branches for the same level.
SQL: | SELECT name FROM managers AS mgr
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08851 | train |
v2 | Schema:
schedules (alias: schd)(id, amount, code, level)
shipments(amount, id, name, date)
Task: Retrieve salary from schedules that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08852 | train |
v2 | Schema:
categories (alias: catg)(status, code, date, salary)
orders(salary, amount, value, status)
Task: Retrieve salary from categories that have at least one corresponding entry in orders sharing the same status.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08853 | train |
v2 | Schema:
invoices (alias: inv)(type, amount, id, date)
projects(name, id, level, date)
Task: Retrieve amount from invoices that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08854 | train |
v1 | Schema:
branches (alias: brc)(level, type, salary, code)
employees(id, date, code, salary)
Task: Retrieve value from branches whose type is found in employees rows where code matches the outer record.
SQL: | SELECT value FROM branches AS brc
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08855 | train |
v2 | Schema:
tasks (alias: tsk)(level, id, status, amount)
categories(value, amount, type, date)
Task: Retrieve name from tasks that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08856 | train |
v2 | Schema:
products (alias: prod)(type, status, code, level)
accounts(code, value, type, level)
Task: Retrieve amount from products that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = prod.id
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08857 | train |
v3 | Schema:
invoices (alias: inv)(salary, date, code, status)
branches(id, name, code, value)
Task: Find salary from invoices where salary exceeds the count of amount from branches for the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE salary > (
SELECT COUNT(amount) FROM branches AS brc
WHERE brc.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08858 | train |
v1 | Schema:
accounts (alias: acct)(code, status, type, amount)
projects(status, date, value, amount)
Task: Retrieve name from accounts whose level is found in projects rows where code matches the outer record.
SQL: | SELECT name FROM accounts AS acct
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08859 | train |
v1 | Schema:
projects (alias: prj)(level, amount, value, id)
managers(amount, code, level, date)
Task: Retrieve amount from projects whose id is found in managers rows where code matches the outer record.
SQL: | SELECT amount FROM projects AS prj
WHERE id IN (
SELECT id 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": "id",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08860 | train |
v2 | Schema:
customers (alias: cust)(id, date, value, amount)
requests(code, name, type, date)
Task: Retrieve name from customers that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08861 | train |
v1 | Schema:
sales (alias: sale)(id, salary, value, name)
shipments(status, name, id, level)
Task: Select id from sales where id exists in shipments for the same level.
SQL: | SELECT id FROM sales AS sale
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08862 | train |
v1 | Schema:
projects (alias: prj)(amount, status, code, value)
products(value, code, id, salary)
Task: Find id from projects where level appears in products entries with matching id.
SQL: | SELECT id FROM projects AS prj
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08863 | train |
v2 | Schema:
branches (alias: brc)(type, name, level, status)
transactions(amount, type, status, id)
Task: Retrieve amount from branches that have at least one corresponding entry in transactions sharing the same type.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "transactions",
"outer_alias": "brc",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08864 | train |
v2 | Schema:
managers (alias: mgr)(status, code, name, date)
orders(level, amount, salary, id)
Task: Retrieve name from managers that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08865 | train |
v2 | Schema:
customers (alias: cust)(code, type, amount, name)
regions(type, level, id, date)
Task: Retrieve salary from customers that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08866 | train |
v3 | Schema:
customers (alias: cust)(date, code, level, type)
branches(amount, value, code, salary)
Task: Find value from customers where salary exceeds the minimum salary from branches for the same status.
SQL: | SELECT value FROM customers AS cust
WHERE salary > (
SELECT MIN(salary) FROM branches AS brc
WHERE brc.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "branches",
"outer_alias": "cust",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08867 | train |
v3 | Schema:
items (alias: lne)(salary, id, amount, date)
managers(status, name, code, id)
Task: Find id from items where value exceeds the minimum value from managers for the same type.
SQL: | SELECT id FROM items AS lne
WHERE value > (
SELECT MIN(value) FROM managers AS mgr
WHERE mgr.type = lne.type
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08868 | train |
v1 | Schema:
staff (alias: empl)(status, date, level, id)
projects(value, name, type, salary)
Task: Find name from staff where code appears in projects entries with matching id.
SQL: | SELECT name FROM staff AS empl
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08869 | train |
v3 | Schema:
shipments (alias: shp)(amount, id, salary, level)
branches(code, value, amount, type)
Task: Retrieve amount from shipments with salary above the AVG(value) of branches rows sharing the same level.
SQL: | SELECT amount FROM shipments AS shp
WHERE salary > (
SELECT AVG(value) FROM branches AS brc
WHERE brc.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08870 | train |
v2 | Schema:
employees (alias: emp)(type, salary, level, id)
managers(id, code, amount, type)
Task: Retrieve salary from employees that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08871 | train |
v2 | Schema:
employees (alias: emp)(name, type, date, status)
transactions(code, id, status, value)
Task: Find salary from employees where a matching record exists in transactions with the same id.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08872 | train |
v2 | Schema:
products (alias: prod)(name, status, level, code)
items(salary, date, name, id)
Task: Find salary from products where a matching record exists in items with the same id.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = prod.id
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08873 | train |
v1 | Schema:
projects (alias: prj)(amount, salary, id, type)
shipments(salary, value, amount, name)
Task: Retrieve id from projects whose level is found in shipments rows where id matches the outer record.
SQL: | SELECT id FROM projects AS prj
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08874 | train |
v1 | Schema:
categories (alias: catg)(code, amount, status, id)
items(date, amount, salary, name)
Task: Find amount from categories where id appears in items entries with matching level.
SQL: | SELECT amount FROM categories AS catg
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08875 | train |
v3 | Schema:
customers (alias: cust)(type, value, salary, id)
regions(id, status, date, salary)
Task: Retrieve id from customers with value above the AVG(amount) of regions rows sharing the same status.
SQL: | SELECT id FROM customers AS cust
WHERE value > (
SELECT AVG(amount) FROM regions AS rgn
WHERE rgn.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08876 | train |
v3 | Schema:
sales (alias: sale)(value, salary, status, id)
tasks(status, id, code, amount)
Task: Retrieve id from sales with salary above the MAX(value) of tasks rows sharing the same type.
SQL: | SELECT id FROM sales AS sale
WHERE salary > (
SELECT MAX(value) FROM tasks AS tsk
WHERE tsk.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08877 | train |
v1 | Schema:
departments (alias: dept)(type, amount, level, salary)
orders(id, level, amount, type)
Task: Select name from departments where level exists in orders for the same status.
SQL: | SELECT name FROM departments AS dept
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08878 | train |
v3 | Schema:
managers (alias: mgr)(value, date, id, name)
employees(type, level, date, id)
Task: Retrieve amount from managers with value above the COUNT(amount) of employees rows sharing the same status.
SQL: | SELECT amount FROM managers AS mgr
WHERE value > (
SELECT COUNT(amount) FROM employees AS emp
WHERE emp.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08879 | train |
v2 | Schema:
sales (alias: sale)(amount, status, level, id)
products(date, salary, type, value)
Task: Find value from sales where a matching record exists in products with the same id.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08880 | train |
v1 | Schema:
customers (alias: cust)(value, amount, date, type)
categories(status, amount, type, salary)
Task: Find id from customers where status appears in categories entries with matching id.
SQL: | SELECT id FROM customers AS cust
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08881 | train |
v2 | Schema:
accounts (alias: acct)(salary, date, code, level)
categories(name, type, date, value)
Task: Find amount from accounts where a matching record exists in categories with the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08882 | train |
v2 | Schema:
staff (alias: empl)(amount, value, salary, level)
schedules(amount, id, date, level)
Task: Retrieve id from staff that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08883 | train |
v2 | Schema:
tasks (alias: tsk)(code, status, type, value)
managers(level, date, id, code)
Task: Find salary from tasks where a matching record exists in managers with the same status.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08884 | train |
v1 | Schema:
transactions (alias: txn)(status, salary, id, amount)
orders(name, level, code, amount)
Task: Find salary from transactions where code appears in orders entries with matching id.
SQL: | SELECT salary FROM transactions AS txn
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08885 | train |
v2 | Schema:
regions (alias: rgn)(level, id, name, value)
invoices(name, type, level, date)
Task: Retrieve code from regions that have at least one corresponding entry in invoices sharing the same id.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08886 | train |
v3 | Schema:
items (alias: lne)(salary, code, status, type)
departments(date, value, code, name)
Task: Retrieve name from items with amount above the MAX(amount) of departments rows sharing the same code.
SQL: | SELECT name FROM items AS lne
WHERE amount > (
SELECT MAX(amount) FROM departments AS dept
WHERE dept.code = lne.code
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08887 | train |
v2 | Schema:
employees (alias: emp)(value, salary, id, type)
sales(amount, type, level, value)
Task: Retrieve value from employees that have at least one corresponding entry in sales sharing the same status.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08888 | train |
v3 | Schema:
departments (alias: dept)(level, status, type, code)
items(type, date, value, id)
Task: Retrieve value from departments with amount above the MIN(amount) of items rows sharing the same level.
SQL: | SELECT value FROM departments AS dept
WHERE amount > (
SELECT MIN(amount) FROM items AS lne
WHERE lne.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08889 | train |
v3 | Schema:
branches (alias: brc)(amount, code, level, value)
accounts(level, date, amount, name)
Task: Find amount from branches where amount exceeds the total salary from accounts for the same id.
SQL: | SELECT amount FROM branches AS brc
WHERE amount > (
SELECT SUM(salary) FROM accounts AS acct
WHERE acct.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "accounts",
"outer_alias": "brc",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08890 | train |
v3 | Schema:
branches (alias: brc)(name, id, status, amount)
shipments(level, name, status, salary)
Task: Retrieve code from branches with value above the AVG(amount) of shipments rows sharing the same code.
SQL: | SELECT code FROM branches AS brc
WHERE value > (
SELECT AVG(amount) FROM shipments AS shp
WHERE shp.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08891 | train |
v1 | Schema:
departments (alias: dept)(salary, value, type, amount)
shipments(code, value, name, level)
Task: Retrieve salary from departments whose type is found in shipments rows where status matches the outer record.
SQL: | SELECT salary FROM departments AS dept
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08892 | train |
v1 | Schema:
tasks (alias: tsk)(code, name, date, type)
requests(level, date, type, salary)
Task: Retrieve code from tasks whose type is found in requests rows where id matches the outer record.
SQL: | SELECT code FROM tasks AS tsk
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08893 | train |
v1 | Schema:
managers (alias: mgr)(level, value, id, amount)
orders(id, value, salary, type)
Task: Retrieve salary from managers whose level is found in orders rows where status matches the outer record.
SQL: | SELECT salary FROM managers AS mgr
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08894 | train |
v1 | Schema:
shipments (alias: shp)(value, amount, status, id)
customers(amount, id, date, value)
Task: Retrieve amount from shipments whose level is found in customers rows where id matches the outer record.
SQL: | SELECT amount FROM shipments AS shp
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08895 | train |
v2 | Schema:
invoices (alias: inv)(type, value, name, amount)
departments(value, name, salary, type)
Task: Find amount from invoices where a matching record exists in departments with the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08896 | train |
v3 | Schema:
products (alias: prod)(status, value, name, code)
requests(status, value, salary, name)
Task: Find amount from products where value exceeds the total amount from requests for the same level.
SQL: | SELECT amount FROM products AS prod
WHERE value > (
SELECT SUM(amount) FROM requests AS ordr
WHERE ordr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08897 | train |
v3 | Schema:
departments (alias: dept)(value, status, code, amount)
managers(level, salary, code, name)
Task: Find id from departments where salary exceeds the minimum salary from managers for the same id.
SQL: | SELECT id FROM departments AS dept
WHERE salary > (
SELECT MIN(salary) FROM managers AS mgr
WHERE mgr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08898 | train |
v3 | Schema:
departments (alias: dept)(value, id, amount, code)
items(code, status, value, date)
Task: Retrieve amount from departments with value above the AVG(salary) of items rows sharing the same id.
SQL: | SELECT amount FROM departments AS dept
WHERE value > (
SELECT AVG(salary) FROM items AS lne
WHERE lne.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08899 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.