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 |
|---|---|---|---|---|---|---|
v3 | Schema:
transactions (alias: txn)(value, date, salary, id)
projects(code, date, level, amount)
Task: Retrieve code from transactions with amount above the MAX(value) of projects rows sharing the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE amount > (
SELECT MAX(value) FROM projects AS prj
WHERE prj.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05800 | train |
v2 | Schema:
requests (alias: ordr)(id, date, name, type)
products(code, level, amount, type)
Task: Retrieve value from requests that have at least one corresponding entry in products sharing the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05801 | train |
v2 | Schema:
staff (alias: empl)(name, value, code, level)
managers(type, code, level, name)
Task: Find value from staff where a matching record exists in managers with the same id.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05802 | train |
v3 | Schema:
projects (alias: prj)(value, code, id, name)
departments(id, value, code, date)
Task: Retrieve amount from projects with amount above the MAX(amount) of departments rows sharing the same type.
SQL: | SELECT amount FROM projects AS prj
WHERE amount > (
SELECT MAX(amount) FROM departments AS dept
WHERE dept.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05803 | train |
v2 | Schema:
departments (alias: dept)(type, level, amount, name)
orders(salary, amount, status, id)
Task: Retrieve name from departments that have at least one corresponding entry in orders sharing the same status.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05804 | train |
v3 | Schema:
customers (alias: cust)(id, amount, type, name)
accounts(status, id, type, code)
Task: Retrieve salary from customers with value above the COUNT(value) of accounts rows sharing the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE value > (
SELECT COUNT(value) FROM accounts AS acct
WHERE acct.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05805 | train |
v3 | Schema:
items (alias: lne)(salary, id, status, level)
accounts(level, value, code, id)
Task: Find value from items where value exceeds the maximum salary from accounts for the same status.
SQL: | SELECT value FROM items AS lne
WHERE value > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.status = lne.status
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05806 | train |
v2 | Schema:
shipments (alias: shp)(type, salary, amount, value)
items(date, type, level, salary)
Task: Find value from shipments where a matching record exists in items with the same status.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05807 | train |
v2 | Schema:
products (alias: prod)(name, level, salary, code)
managers(value, status, id, name)
Task: Retrieve code from products that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = prod.type
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05808 | train |
v1 | Schema:
shipments (alias: shp)(code, type, status, value)
schedules(type, code, id, name)
Task: Retrieve salary from shipments whose type is found in schedules rows where status matches the outer record.
SQL: | SELECT salary FROM shipments AS shp
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05809 | train |
v3 | Schema:
employees (alias: emp)(status, name, type, date)
departments(name, id, amount, status)
Task: Find code from employees where amount exceeds the maximum amount from departments for the same type.
SQL: | SELECT code FROM employees AS emp
WHERE amount > (
SELECT MAX(amount) FROM departments AS dept
WHERE dept.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05810 | train |
v2 | Schema:
products (alias: prod)(salary, type, status, name)
branches(amount, salary, code, type)
Task: Retrieve id from products that have at least one corresponding entry in branches sharing the same status.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = prod.status
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05811 | train |
v1 | Schema:
managers (alias: mgr)(status, code, name, value)
items(code, status, type, level)
Task: Select code from managers where level exists in items for the same level.
SQL: | SELECT code FROM managers AS mgr
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05812 | train |
v2 | Schema:
items (alias: lne)(salary, value, id, type)
regions(name, salary, type, value)
Task: Retrieve id from items that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = lne.type
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05813 | train |
v1 | Schema:
sales (alias: sale)(status, code, amount, name)
projects(level, status, id, code)
Task: Select amount from sales where id exists in projects for the same id.
SQL: | SELECT amount FROM sales AS sale
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05814 | train |
v3 | Schema:
invoices (alias: inv)(status, code, id, amount)
employees(amount, status, date, value)
Task: Retrieve value from invoices with value above the AVG(value) of employees rows sharing the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE value > (
SELECT AVG(value) FROM employees AS emp
WHERE emp.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05815 | train |
v2 | Schema:
requests (alias: ordr)(name, value, type, id)
transactions(status, id, value, code)
Task: Retrieve code from requests that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05816 | train |
v3 | Schema:
managers (alias: mgr)(amount, code, name, date)
orders(level, amount, type, date)
Task: Find salary from managers where amount exceeds the total value from orders for the same id.
SQL: | SELECT salary FROM managers AS mgr
WHERE amount > (
SELECT SUM(value) FROM orders AS ord
WHERE ord.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05817 | train |
v1 | Schema:
items (alias: lne)(amount, level, code, status)
projects(type, amount, level, salary)
Task: Select amount from items where type exists in projects for the same status.
SQL: | SELECT amount FROM items AS lne
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.status = lne.status
); | {
"outer_table": "items",
"inner_table": "projects",
"outer_alias": "lne",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05818 | train |
v2 | Schema:
items (alias: lne)(id, type, status, code)
employees(type, date, status, value)
Task: Find value from items where a matching record exists in employees with the same status.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = lne.status
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05819 | train |
v3 | Schema:
tasks (alias: tsk)(id, amount, type, name)
items(amount, level, value, id)
Task: Retrieve value from tasks with amount above the SUM(value) of items rows sharing the same status.
SQL: | SELECT value FROM tasks AS tsk
WHERE amount > (
SELECT SUM(value) FROM items AS lne
WHERE lne.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "items",
"outer_alias": "tsk",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05820 | train |
v2 | Schema:
schedules (alias: schd)(level, salary, name, id)
projects(salary, name, level, code)
Task: Find id from schedules where a matching record exists in projects with the same type.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05821 | train |
v1 | Schema:
accounts (alias: acct)(salary, amount, type, date)
managers(id, amount, date, value)
Task: Retrieve code from accounts whose id is found in managers rows where status matches the outer record.
SQL: | SELECT code FROM accounts AS acct
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05822 | train |
v2 | Schema:
items (alias: lne)(level, type, name, code)
tasks(status, id, level, salary)
Task: Find value from items where a matching record exists in tasks with the same level.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = lne.level
); | {
"outer_table": "items",
"inner_table": "tasks",
"outer_alias": "lne",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05823 | train |
v1 | Schema:
schedules (alias: schd)(id, amount, code, name)
employees(code, value, name, status)
Task: Find amount from schedules where code appears in employees entries with matching code.
SQL: | SELECT amount FROM schedules AS schd
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05824 | train |
v2 | Schema:
products (alias: prod)(id, code, value, amount)
schedules(date, name, level, status)
Task: Find id from products where a matching record exists in schedules with the same id.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = prod.id
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05825 | train |
v3 | Schema:
accounts (alias: acct)(code, id, type, date)
invoices(type, name, status, code)
Task: Find amount from accounts where amount exceeds the count of value from invoices for the same status.
SQL: | SELECT amount FROM accounts AS acct
WHERE amount > (
SELECT COUNT(value) FROM invoices AS inv
WHERE inv.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05826 | train |
v2 | Schema:
shipments (alias: shp)(id, status, level, code)
staff(level, salary, status, value)
Task: Find code from shipments where a matching record exists in staff with the same code.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05827 | train |
v1 | Schema:
schedules (alias: schd)(code, date, id, type)
products(name, amount, type, level)
Task: Select value from schedules where id exists in products for the same code.
SQL: | SELECT value FROM schedules AS schd
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05828 | train |
v2 | Schema:
tasks (alias: tsk)(status, salary, level, code)
staff(date, id, code, type)
Task: Find id from tasks where a matching record exists in staff with the same type.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "staff",
"outer_alias": "tsk",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05829 | train |
v3 | Schema:
requests (alias: ordr)(value, amount, date, status)
employees(status, id, code, level)
Task: Retrieve name from requests with amount above the AVG(salary) of employees rows sharing the same code.
SQL: | SELECT name FROM requests AS ordr
WHERE amount > (
SELECT AVG(salary) FROM employees AS emp
WHERE emp.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05830 | train |
v3 | Schema:
regions (alias: rgn)(name, amount, value, id)
accounts(amount, date, type, salary)
Task: Find salary from regions where salary exceeds the minimum amount from accounts for the same status.
SQL: | SELECT salary FROM regions AS rgn
WHERE salary > (
SELECT MIN(amount) FROM accounts AS acct
WHERE acct.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05831 | train |
v1 | Schema:
regions (alias: rgn)(id, amount, salary, type)
orders(name, value, code, id)
Task: Find salary from regions where level appears in orders entries with matching type.
SQL: | SELECT salary FROM regions AS rgn
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05832 | train |
v2 | Schema:
customers (alias: cust)(date, value, level, name)
schedules(amount, date, salary, id)
Task: Retrieve value from customers that have at least one corresponding entry in schedules sharing the same type.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05833 | train |
v2 | Schema:
schedules (alias: schd)(type, name, value, amount)
branches(salary, name, id, level)
Task: Find amount from schedules where a matching record exists in branches with the same code.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05834 | train |
v1 | Schema:
orders (alias: ord)(code, type, salary, date)
sales(type, value, name, level)
Task: Select salary from orders where level exists in sales for the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05835 | train |
v1 | Schema:
schedules (alias: schd)(type, id, name, salary)
regions(id, salary, level, type)
Task: Retrieve code from schedules whose status is found in regions rows where status matches the outer record.
SQL: | SELECT code FROM schedules AS schd
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05836 | train |
v1 | Schema:
categories (alias: catg)(status, name, id, value)
items(type, amount, code, status)
Task: Select name from categories where level exists in items for the same status.
SQL: | SELECT name FROM categories AS catg
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05837 | train |
v2 | Schema:
orders (alias: ord)(value, date, level, status)
requests(name, code, level, salary)
Task: Retrieve id from orders that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05838 | train |
v1 | Schema:
customers (alias: cust)(code, date, id, type)
items(type, value, date, amount)
Task: Find id from customers where id appears in items entries with matching id.
SQL: | SELECT id FROM customers AS cust
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05839 | train |
v1 | Schema:
customers (alias: cust)(amount, status, id, name)
products(level, code, id, salary)
Task: Find value from customers where type appears in products entries with matching code.
SQL: | SELECT value FROM customers AS cust
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05840 | train |
v3 | Schema:
requests (alias: ordr)(type, value, code, status)
transactions(id, salary, status, name)
Task: Find amount from requests where salary exceeds the count of value from transactions for the same code.
SQL: | SELECT amount FROM requests AS ordr
WHERE salary > (
SELECT COUNT(value) FROM transactions AS txn
WHERE txn.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05841 | train |
v2 | Schema:
tasks (alias: tsk)(id, code, name, status)
staff(date, status, amount, type)
Task: Find name from tasks where a matching record exists in staff with the same id.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "staff",
"outer_alias": "tsk",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05842 | train |
v3 | Schema:
staff (alias: empl)(type, status, salary, date)
products(date, level, name, type)
Task: Find id from staff where salary exceeds the minimum salary from products for the same id.
SQL: | SELECT id FROM staff AS empl
WHERE salary > (
SELECT MIN(salary) FROM products AS prod
WHERE prod.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05843 | train |
v1 | Schema:
shipments (alias: shp)(id, type, value, salary)
customers(id, salary, status, value)
Task: Find name from shipments where status appears in customers entries with matching id.
SQL: | SELECT name FROM shipments AS shp
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05844 | train |
v1 | Schema:
managers (alias: mgr)(salary, level, value, code)
shipments(level, code, name, type)
Task: Find code from managers where code appears in shipments entries with matching id.
SQL: | SELECT code FROM managers AS mgr
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05845 | train |
v1 | Schema:
transactions (alias: txn)(code, status, level, type)
managers(code, name, amount, type)
Task: Retrieve salary from transactions whose type is found in managers rows where type matches the outer record.
SQL: | SELECT salary FROM transactions AS txn
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05846 | train |
v2 | Schema:
customers (alias: cust)(status, name, value, salary)
transactions(status, amount, name, id)
Task: Retrieve amount from customers that have at least one corresponding entry in transactions sharing the same code.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05847 | train |
v3 | Schema:
shipments (alias: shp)(status, type, level, date)
transactions(id, value, amount, name)
Task: Retrieve name from shipments with salary above the MIN(value) of transactions rows sharing the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE salary > (
SELECT MIN(value) FROM transactions AS txn
WHERE txn.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05848 | train |
v2 | Schema:
departments (alias: dept)(salary, level, id, date)
requests(date, level, name, code)
Task: Retrieve code from departments that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05849 | train |
v2 | Schema:
orders (alias: ord)(status, salary, level, value)
regions(id, salary, name, code)
Task: Find salary from orders where a matching record exists in regions with the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05850 | train |
v2 | Schema:
branches (alias: brc)(salary, type, date, id)
customers(type, date, value, code)
Task: Find id from branches where a matching record exists in customers with the same level.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05851 | train |
v1 | Schema:
tasks (alias: tsk)(name, value, status, type)
managers(value, id, type, status)
Task: Find code from tasks where id appears in managers entries with matching status.
SQL: | SELECT code FROM tasks AS tsk
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05852 | train |
v3 | Schema:
staff (alias: empl)(status, level, id, date)
accounts(name, level, amount, date)
Task: Find code from staff where salary exceeds the average amount from accounts for the same id.
SQL: | SELECT code FROM staff AS empl
WHERE salary > (
SELECT AVG(amount) FROM accounts AS acct
WHERE acct.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05853 | train |
v3 | Schema:
transactions (alias: txn)(amount, salary, level, type)
tasks(salary, level, date, value)
Task: Find code from transactions where amount exceeds the maximum value from tasks for the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE amount > (
SELECT MAX(value) FROM tasks AS tsk
WHERE tsk.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05854 | train |
v2 | Schema:
transactions (alias: txn)(code, type, status, amount)
shipments(value, name, id, amount)
Task: Find salary from transactions where a matching record exists in shipments with the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05855 | train |
v3 | Schema:
shipments (alias: shp)(level, name, amount, id)
requests(code, status, salary, level)
Task: Find amount from shipments where value exceeds the minimum value from requests for the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE value > (
SELECT MIN(value) FROM requests AS ordr
WHERE ordr.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05856 | train |
v2 | Schema:
sales (alias: sale)(value, date, salary, name)
schedules(date, type, value, amount)
Task: Retrieve code from sales that have at least one corresponding entry in schedules sharing the same id.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05857 | train |
v2 | Schema:
departments (alias: dept)(date, amount, status, name)
managers(value, id, salary, code)
Task: Find code from departments where a matching record exists in managers with the same code.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05858 | train |
v1 | Schema:
tasks (alias: tsk)(status, salary, level, name)
sales(status, name, id, amount)
Task: Retrieve name from tasks whose level is found in sales rows where code matches the outer record.
SQL: | SELECT name FROM tasks AS tsk
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05859 | train |
v2 | Schema:
projects (alias: prj)(salary, status, type, level)
staff(code, type, level, date)
Task: Retrieve salary from projects that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "staff",
"outer_alias": "prj",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05860 | train |
v2 | Schema:
schedules (alias: schd)(id, name, salary, status)
regions(name, amount, type, value)
Task: Find code from schedules where a matching record exists in regions with the same level.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05861 | train |
v3 | Schema:
branches (alias: brc)(status, level, value, id)
employees(amount, name, status, type)
Task: Retrieve salary from branches with value above the COUNT(amount) of employees rows sharing the same status.
SQL: | SELECT salary FROM branches AS brc
WHERE value > (
SELECT COUNT(amount) FROM employees AS emp
WHERE emp.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05862 | train |
v2 | Schema:
accounts (alias: acct)(name, status, salary, value)
tasks(amount, id, status, name)
Task: Retrieve amount from accounts that have at least one corresponding entry in tasks sharing the same id.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05863 | train |
v1 | Schema:
projects (alias: prj)(amount, value, name, id)
branches(value, amount, date, status)
Task: Select value from projects where type exists in branches for the same type.
SQL: | SELECT value FROM projects AS prj
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05864 | train |
v1 | Schema:
sales (alias: sale)(date, amount, name, id)
tasks(code, name, date, level)
Task: Find name from sales where id appears in tasks entries with matching type.
SQL: | SELECT name FROM sales AS sale
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05865 | train |
v1 | Schema:
employees (alias: emp)(status, salary, name, code)
tasks(type, code, amount, date)
Task: Find code from employees where level appears in tasks entries with matching code.
SQL: | SELECT code FROM employees AS emp
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05866 | train |
v2 | Schema:
employees (alias: emp)(value, date, status, code)
managers(id, status, salary, value)
Task: Retrieve value from employees that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT value 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": "value",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05867 | train |
v3 | Schema:
employees (alias: emp)(code, type, date, name)
regions(date, level, code, salary)
Task: Retrieve amount from employees with value above the SUM(amount) of regions rows sharing the same status.
SQL: | SELECT amount FROM employees AS emp
WHERE value > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05868 | train |
v1 | Schema:
schedules (alias: schd)(salary, name, code, id)
orders(date, level, id, type)
Task: Retrieve code from schedules whose type is found in orders rows where level matches the outer record.
SQL: | SELECT code FROM schedules AS schd
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05869 | train |
v2 | Schema:
accounts (alias: acct)(salary, type, id, value)
requests(salary, status, value, date)
Task: Retrieve name from accounts that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05870 | train |
v1 | Schema:
orders (alias: ord)(status, code, type, id)
items(type, value, status, name)
Task: Select value from orders where code exists in items for the same code.
SQL: | SELECT value FROM orders AS ord
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05871 | train |
v3 | Schema:
shipments (alias: shp)(date, level, name, id)
tasks(level, status, id, code)
Task: Retrieve code from shipments with value above the AVG(salary) of tasks rows sharing the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE value > (
SELECT AVG(salary) FROM tasks AS tsk
WHERE tsk.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05872 | train |
v3 | Schema:
requests (alias: ordr)(code, id, status, name)
staff(name, level, code, amount)
Task: Find amount from requests where value exceeds the total value from staff for the same code.
SQL: | SELECT amount FROM requests AS ordr
WHERE value > (
SELECT SUM(value) FROM staff AS empl
WHERE empl.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05873 | train |
v1 | Schema:
shipments (alias: shp)(type, code, id, name)
invoices(date, salary, code, level)
Task: Retrieve code from shipments whose status is found in invoices rows where code matches the outer record.
SQL: | SELECT code FROM shipments AS shp
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05874 | train |
v2 | Schema:
categories (alias: catg)(type, code, name, date)
schedules(level, status, salary, date)
Task: Find amount from categories where a matching record exists in schedules with the same level.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05875 | train |
v3 | Schema:
tasks (alias: tsk)(amount, status, salary, id)
categories(value, level, date, amount)
Task: Retrieve code from tasks with amount above the MIN(amount) of categories rows sharing the same status.
SQL: | SELECT code FROM tasks AS tsk
WHERE amount > (
SELECT MIN(amount) FROM categories AS catg
WHERE catg.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05876 | train |
v1 | Schema:
staff (alias: empl)(date, id, code, status)
departments(value, id, date, salary)
Task: Retrieve name from staff whose code is found in departments rows where type matches the outer record.
SQL: | SELECT name FROM staff AS empl
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05877 | train |
v2 | Schema:
staff (alias: empl)(value, status, amount, name)
managers(name, value, date, amount)
Task: Find salary from staff where a matching record exists in managers with the same id.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05878 | train |
v1 | Schema:
tasks (alias: tsk)(amount, value, date, id)
products(id, status, value, name)
Task: Select value from tasks where type exists in products for the same status.
SQL: | SELECT value FROM tasks AS tsk
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05879 | train |
v1 | Schema:
staff (alias: empl)(status, date, type, code)
items(id, amount, level, type)
Task: Select value from staff where code exists in items for the same id.
SQL: | SELECT value FROM staff AS empl
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05880 | train |
v3 | Schema:
sales (alias: sale)(amount, code, name, type)
items(id, status, value, code)
Task: Find salary from sales where salary exceeds the maximum value from items for the same level.
SQL: | SELECT salary FROM sales AS sale
WHERE salary > (
SELECT MAX(value) FROM items AS lne
WHERE lne.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05881 | train |
v2 | Schema:
shipments (alias: shp)(code, name, id, type)
invoices(value, code, salary, name)
Task: Find value from shipments where a matching record exists in invoices with the same code.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05882 | train |
v2 | Schema:
categories (alias: catg)(status, value, salary, code)
requests(date, value, id, code)
Task: Find code from categories where a matching record exists in requests with the same type.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05883 | train |
v2 | Schema:
regions (alias: rgn)(value, name, code, status)
projects(salary, amount, status, id)
Task: Retrieve value from regions that have at least one corresponding entry in projects sharing the same level.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05884 | train |
v2 | Schema:
categories (alias: catg)(amount, name, status, date)
staff(name, status, value, salary)
Task: Find code from categories where a matching record exists in staff with the same code.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05885 | train |
v3 | Schema:
categories (alias: catg)(amount, level, name, salary)
customers(date, type, code, id)
Task: Find value from categories where salary exceeds the minimum amount from customers for the same level.
SQL: | SELECT value FROM categories AS catg
WHERE salary > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05886 | train |
v3 | Schema:
products (alias: prod)(value, id, status, name)
projects(value, type, date, level)
Task: Find amount from products where amount exceeds the minimum salary from projects for the same type.
SQL: | SELECT amount FROM products AS prod
WHERE amount > (
SELECT MIN(salary) FROM projects AS prj
WHERE prj.type = prod.type
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "prod",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05887 | train |
v3 | Schema:
branches (alias: brc)(id, level, code, status)
employees(salary, amount, code, date)
Task: Find value from branches where amount exceeds the total value from employees for the same status.
SQL: | SELECT value FROM branches AS brc
WHERE amount > (
SELECT SUM(value) FROM employees AS emp
WHERE emp.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05888 | train |
v2 | Schema:
schedules (alias: schd)(value, amount, status, date)
transactions(value, id, name, salary)
Task: Retrieve value from schedules that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05889 | train |
v2 | Schema:
categories (alias: catg)(level, code, type, date)
requests(code, salary, id, value)
Task: Find code from categories where a matching record exists in requests with the same type.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05890 | train |
v3 | Schema:
accounts (alias: acct)(type, status, salary, level)
requests(id, status, date, level)
Task: Retrieve salary from accounts with salary above the MAX(value) of requests rows sharing the same id.
SQL: | SELECT salary FROM accounts AS acct
WHERE salary > (
SELECT MAX(value) FROM requests AS ordr
WHERE ordr.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05891 | train |
v2 | Schema:
invoices (alias: inv)(id, value, status, code)
items(status, name, amount, value)
Task: Find value from invoices where a matching record exists in items with the same level.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05892 | train |
v2 | Schema:
invoices (alias: inv)(type, amount, level, name)
employees(value, amount, id, code)
Task: Retrieve id from invoices that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05893 | train |
v2 | Schema:
schedules (alias: schd)(level, salary, status, code)
managers(salary, date, value, name)
Task: Retrieve id from schedules that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05894 | train |
v2 | Schema:
tasks (alias: tsk)(status, date, name, amount)
items(level, date, code, salary)
Task: Find name from tasks where a matching record exists in items with the same id.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "items",
"outer_alias": "tsk",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05895 | train |
v3 | Schema:
transactions (alias: txn)(amount, level, id, value)
categories(type, level, date, name)
Task: Retrieve value from transactions with salary above the COUNT(value) of categories rows sharing the same level.
SQL: | SELECT value FROM transactions AS txn
WHERE salary > (
SELECT COUNT(value) FROM categories AS catg
WHERE catg.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05896 | train |
v2 | Schema:
sales (alias: sale)(salary, code, type, id)
projects(type, value, code, level)
Task: Retrieve name from sales that have at least one corresponding entry in projects sharing the same id.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05897 | train |
v1 | Schema:
shipments (alias: shp)(code, id, type, amount)
customers(name, id, salary, status)
Task: Find salary from shipments where code appears in customers entries with matching id.
SQL: | SELECT salary FROM shipments AS shp
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05898 | train |
v1 | Schema:
projects (alias: prj)(type, level, value, status)
accounts(level, id, code, amount)
Task: Select code from projects where code exists in accounts for the same status.
SQL: | SELECT code FROM projects AS prj
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05899 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.