variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v2 | Schema:
orders (alias: ord)(salary, date, value, code)
tasks(level, salary, code, type)
Task: Find name from orders where a matching record exists in tasks with the same type.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03300 | train |
v2 | Schema:
employees (alias: emp)(value, code, type, level)
customers(date, code, id, salary)
Task: Retrieve value from employees that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03301 | train |
v1 | Schema:
requests (alias: ordr)(code, status, salary, id)
shipments(value, amount, name, level)
Task: Select amount from requests where type exists in shipments for the same code.
SQL: | SELECT amount FROM requests AS ordr
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03302 | train |
v1 | Schema:
categories (alias: catg)(date, salary, id, name)
schedules(type, status, amount, level)
Task: Find id from categories where level appears in schedules entries with matching status.
SQL: | SELECT id FROM categories AS catg
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03303 | train |
v1 | Schema:
transactions (alias: txn)(id, type, name, date)
orders(salary, status, amount, level)
Task: Select name from transactions where level exists in orders for the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03304 | train |
v3 | Schema:
accounts (alias: acct)(code, status, amount, id)
items(type, amount, code, name)
Task: Find salary from accounts where amount exceeds the total amount from items for the same type.
SQL: | SELECT salary FROM accounts AS acct
WHERE amount > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03305 | train |
v3 | Schema:
projects (alias: prj)(code, type, status, level)
managers(salary, amount, name, type)
Task: Find name from projects where amount exceeds the minimum salary from managers for the same level.
SQL: | SELECT name FROM projects AS prj
WHERE amount > (
SELECT MIN(salary) FROM managers AS mgr
WHERE mgr.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03306 | train |
v1 | Schema:
sales (alias: sale)(type, date, id, code)
regions(date, name, level, value)
Task: Retrieve id from sales whose status is found in regions rows where id matches the outer record.
SQL: | SELECT id FROM sales AS sale
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03307 | train |
v2 | Schema:
items (alias: lne)(value, code, amount, id)
projects(id, date, type, name)
Task: Find salary from items where a matching record exists in projects with the same level.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = lne.level
); | {
"outer_table": "items",
"inner_table": "projects",
"outer_alias": "lne",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03308 | train |
v2 | Schema:
items (alias: lne)(status, code, level, type)
orders(id, salary, name, level)
Task: Find name from items where a matching record exists in orders with the same id.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = lne.id
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03309 | train |
v3 | Schema:
invoices (alias: inv)(date, salary, name, id)
managers(name, salary, level, amount)
Task: Retrieve id from invoices with salary above the MAX(salary) of managers rows sharing the same code.
SQL: | SELECT id FROM invoices AS inv
WHERE salary > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03310 | train |
v2 | Schema:
managers (alias: mgr)(amount, level, salary, name)
sales(status, id, value, code)
Task: Find name from managers where a matching record exists in sales with the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03311 | train |
v2 | Schema:
departments (alias: dept)(salary, date, level, amount)
schedules(id, date, code, value)
Task: Retrieve name from departments that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03312 | train |
v3 | Schema:
items (alias: lne)(status, level, value, date)
invoices(status, date, salary, amount)
Task: Find amount from items where salary exceeds the count of amount from invoices for the same level.
SQL: | SELECT amount FROM items AS lne
WHERE salary > (
SELECT COUNT(amount) FROM invoices AS inv
WHERE inv.level = lne.level
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03313 | train |
v1 | Schema:
transactions (alias: txn)(level, type, date, id)
items(amount, level, value, date)
Task: Retrieve code from transactions whose type is found in items rows where level matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03314 | train |
v2 | Schema:
orders (alias: ord)(name, salary, amount, type)
sales(status, date, amount, type)
Task: Find id from orders where a matching record exists in sales with the same level.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03315 | train |
v1 | Schema:
requests (alias: ordr)(code, level, name, value)
accounts(amount, code, id, salary)
Task: Find code from requests where code appears in accounts entries with matching id.
SQL: | SELECT code FROM requests AS ordr
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03316 | train |
v3 | Schema:
regions (alias: rgn)(code, name, value, id)
projects(type, name, date, id)
Task: Retrieve salary from regions with salary above the MAX(value) of projects rows sharing the same status.
SQL: | SELECT salary FROM regions AS rgn
WHERE salary > (
SELECT MAX(value) FROM projects AS prj
WHERE prj.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03317 | train |
v2 | Schema:
requests (alias: ordr)(code, amount, salary, type)
projects(code, type, status, date)
Task: Find id from requests where a matching record exists in projects with the same status.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03318 | train |
v2 | Schema:
products (alias: prod)(date, name, status, type)
accounts(date, level, salary, status)
Task: Find name from products where a matching record exists in accounts with the same status.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = prod.status
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03319 | train |
v2 | Schema:
items (alias: lne)(name, id, salary, level)
orders(amount, date, type, id)
Task: Retrieve amount from items that have at least one corresponding entry in orders sharing the same status.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = lne.status
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03320 | train |
v2 | Schema:
departments (alias: dept)(status, type, value, amount)
categories(salary, level, code, amount)
Task: Retrieve value from departments that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03321 | train |
v2 | Schema:
sales (alias: sale)(code, level, date, id)
transactions(type, status, code, value)
Task: Find id from sales where a matching record exists in transactions with the same code.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03322 | train |
v1 | Schema:
orders (alias: ord)(level, id, value, name)
regions(value, status, type, amount)
Task: Find amount from orders where level appears in regions entries with matching type.
SQL: | SELECT amount FROM orders AS ord
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03323 | train |
v2 | Schema:
managers (alias: mgr)(name, level, salary, amount)
schedules(code, level, id, value)
Task: Retrieve amount from managers that have at least one corresponding entry in schedules sharing the same status.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03324 | train |
v1 | Schema:
products (alias: prod)(level, salary, amount, code)
customers(status, level, type, code)
Task: Select amount from products where id exists in customers for the same type.
SQL: | SELECT amount FROM products AS prod
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.type = prod.type
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03325 | train |
v1 | Schema:
projects (alias: prj)(level, date, amount, salary)
customers(amount, salary, name, date)
Task: Find code from projects where type appears in customers entries with matching type.
SQL: | SELECT code FROM projects AS prj
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "prj",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03326 | train |
v1 | Schema:
schedules (alias: schd)(id, salary, code, value)
categories(code, salary, id, value)
Task: Select code from schedules where level exists in categories for the same status.
SQL: | SELECT code FROM schedules AS schd
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03327 | train |
v1 | Schema:
products (alias: prod)(salary, amount, type, level)
customers(id, value, date, type)
Task: Find id from products where status appears in customers entries with matching level.
SQL: | SELECT id FROM products AS prod
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.level = prod.level
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03328 | train |
v2 | Schema:
requests (alias: ordr)(amount, name, salary, status)
items(status, date, amount, id)
Task: Find id from requests where a matching record exists in items with the same type.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03329 | train |
v3 | Schema:
accounts (alias: acct)(type, amount, date, status)
items(status, level, date, name)
Task: Retrieve name from accounts with salary above the MIN(amount) of items rows sharing the same level.
SQL: | SELECT name FROM accounts AS acct
WHERE salary > (
SELECT MIN(amount) FROM items AS lne
WHERE lne.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03330 | train |
v2 | Schema:
customers (alias: cust)(name, amount, value, code)
orders(type, name, level, id)
Task: Retrieve salary from customers that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03331 | train |
v2 | Schema:
categories (alias: catg)(level, type, id, amount)
sales(value, salary, code, date)
Task: Retrieve code from categories that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03332 | train |
v1 | Schema:
products (alias: prod)(salary, value, name, status)
staff(status, value, id, salary)
Task: Select salary from products where status exists in staff for the same level.
SQL: | SELECT salary FROM products AS prod
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.level = prod.level
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03333 | train |
v2 | Schema:
branches (alias: brc)(date, level, id, type)
transactions(level, code, type, id)
Task: Find code from branches where a matching record exists in transactions with the same type.
SQL: | SELECT code 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": "code",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03334 | train |
v1 | Schema:
schedules (alias: schd)(date, name, level, status)
items(id, salary, name, level)
Task: Find value from schedules where code appears in items entries with matching id.
SQL: | SELECT value FROM schedules AS schd
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03335 | train |
v3 | Schema:
accounts (alias: acct)(code, amount, type, name)
departments(date, value, status, salary)
Task: Find id from accounts where value exceeds the minimum amount from departments for the same id.
SQL: | SELECT id FROM accounts AS acct
WHERE value > (
SELECT MIN(amount) FROM departments AS dept
WHERE dept.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03336 | train |
v1 | Schema:
transactions (alias: txn)(value, salary, status, code)
managers(type, name, amount, salary)
Task: Select value from transactions where status exists in managers for the same type.
SQL: | SELECT value FROM transactions AS txn
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03337 | train |
v2 | Schema:
departments (alias: dept)(status, amount, name, date)
requests(date, level, value, name)
Task: Retrieve amount from departments that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT amount 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": "amount",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03338 | train |
v1 | Schema:
staff (alias: empl)(id, salary, status, amount)
transactions(name, amount, level, salary)
Task: Retrieve salary from staff whose status is found in transactions rows where status matches the outer record.
SQL: | SELECT salary FROM staff AS empl
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03339 | train |
v1 | Schema:
invoices (alias: inv)(level, value, code, salary)
managers(id, amount, value, level)
Task: Select name from invoices where status exists in managers for the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03340 | train |
v1 | Schema:
transactions (alias: txn)(code, name, date, type)
projects(code, type, salary, date)
Task: Retrieve amount from transactions whose code is found in projects rows where status matches the outer record.
SQL: | SELECT amount FROM transactions AS txn
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03341 | train |
v3 | Schema:
departments (alias: dept)(id, name, status, amount)
schedules(status, code, value, amount)
Task: Find value from departments where amount exceeds the count of amount from schedules for the same code.
SQL: | SELECT value FROM departments AS dept
WHERE amount > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03342 | train |
v1 | Schema:
schedules (alias: schd)(date, amount, type, status)
customers(salary, date, value, status)
Task: Retrieve name from schedules whose code is found in customers rows where level matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03343 | train |
v1 | Schema:
categories (alias: catg)(code, id, status, date)
products(status, type, level, name)
Task: Retrieve code from categories whose code is found in products rows where level matches the outer record.
SQL: | SELECT code FROM categories AS catg
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03344 | train |
v3 | Schema:
accounts (alias: acct)(level, id, date, code)
regions(value, date, status, name)
Task: Retrieve amount from accounts with amount above the MIN(amount) of regions rows sharing the same status.
SQL: | SELECT amount FROM accounts AS acct
WHERE amount > (
SELECT MIN(amount) FROM regions AS rgn
WHERE rgn.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03345 | train |
v3 | Schema:
products (alias: prod)(name, type, code, date)
employees(id, value, name, status)
Task: Retrieve code from products with salary above the MAX(salary) of employees rows sharing the same status.
SQL: | SELECT code FROM products AS prod
WHERE salary > (
SELECT MAX(salary) FROM employees AS emp
WHERE emp.status = prod.status
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03346 | train |
v1 | Schema:
managers (alias: mgr)(code, name, id, date)
regions(type, id, status, salary)
Task: Retrieve code from managers whose id is found in regions rows where status matches the outer record.
SQL: | SELECT code FROM managers AS mgr
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03347 | train |
v3 | Schema:
employees (alias: emp)(salary, amount, date, status)
products(type, id, status, salary)
Task: Retrieve value from employees with salary above the SUM(amount) of products rows sharing the same type.
SQL: | SELECT value FROM employees AS emp
WHERE salary > (
SELECT SUM(amount) FROM products AS prod
WHERE prod.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03348 | train |
v3 | Schema:
branches (alias: brc)(salary, date, value, level)
projects(status, date, id, type)
Task: Find value from branches where salary exceeds the total value from projects for the same id.
SQL: | SELECT value FROM branches AS brc
WHERE salary > (
SELECT SUM(value) FROM projects AS prj
WHERE prj.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03349 | train |
v3 | Schema:
tasks (alias: tsk)(value, type, level, code)
invoices(id, level, name, type)
Task: Find code from tasks where value exceeds the maximum salary from invoices for the same status.
SQL: | SELECT code FROM tasks AS tsk
WHERE value > (
SELECT MAX(salary) FROM invoices AS inv
WHERE inv.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03350 | train |
v1 | Schema:
schedules (alias: schd)(amount, name, id, level)
customers(type, status, salary, value)
Task: Select value from schedules where code exists in customers for the same id.
SQL: | SELECT value FROM schedules AS schd
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03351 | train |
v1 | Schema:
departments (alias: dept)(name, level, status, amount)
sales(amount, code, level, status)
Task: Find value from departments where code appears in sales entries with matching level.
SQL: | SELECT value FROM departments AS dept
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03352 | train |
v3 | Schema:
managers (alias: mgr)(date, level, status, id)
schedules(type, code, amount, id)
Task: Find value from managers where salary exceeds the maximum amount from schedules for the same status.
SQL: | SELECT value FROM managers AS mgr
WHERE salary > (
SELECT MAX(amount) FROM schedules AS schd
WHERE schd.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03353 | train |
v2 | Schema:
tasks (alias: tsk)(amount, name, salary, level)
sales(status, id, name, amount)
Task: Find value from tasks where a matching record exists in sales with the same id.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03354 | train |
v3 | Schema:
accounts (alias: acct)(value, name, status, date)
requests(code, level, type, name)
Task: Retrieve id from accounts with salary above the COUNT(amount) of requests rows sharing the same id.
SQL: | SELECT id FROM accounts AS acct
WHERE salary > (
SELECT COUNT(amount) FROM requests AS ordr
WHERE ordr.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03355 | train |
v1 | Schema:
items (alias: lne)(value, type, level, code)
managers(salary, date, code, id)
Task: Select salary from items where code exists in managers for the same id.
SQL: | SELECT salary FROM items AS lne
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.id = lne.id
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03356 | train |
v1 | Schema:
orders (alias: ord)(id, salary, name, status)
requests(type, id, level, code)
Task: Retrieve id from orders whose status is found in requests rows where level matches the outer record.
SQL: | SELECT id FROM orders AS ord
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03357 | train |
v2 | Schema:
accounts (alias: acct)(name, status, salary, value)
regions(amount, type, salary, code)
Task: Retrieve id from accounts that have at least one corresponding entry in regions sharing the same level.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03358 | train |
v1 | Schema:
managers (alias: mgr)(amount, level, type, name)
accounts(amount, status, id, date)
Task: Select amount from managers where id exists in accounts for the same code.
SQL: | SELECT amount FROM managers AS mgr
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03359 | train |
v3 | Schema:
branches (alias: brc)(level, date, status, salary)
orders(status, salary, level, name)
Task: Retrieve value from branches with salary above the AVG(value) of orders rows sharing the same id.
SQL: | SELECT value FROM branches AS brc
WHERE salary > (
SELECT AVG(value) FROM orders AS ord
WHERE ord.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03360 | train |
v1 | Schema:
departments (alias: dept)(amount, type, level, date)
products(name, id, amount, code)
Task: Retrieve code from departments whose status is found in products rows where type matches the outer record.
SQL: | SELECT code FROM departments AS dept
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03361 | train |
v2 | Schema:
tasks (alias: tsk)(level, value, amount, status)
accounts(name, salary, status, level)
Task: Find salary from tasks where a matching record exists in accounts with the same level.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03362 | train |
v1 | Schema:
transactions (alias: txn)(status, code, name, type)
invoices(name, code, status, salary)
Task: Retrieve amount from transactions whose id is found in invoices rows where type matches the outer record.
SQL: | SELECT amount FROM transactions AS txn
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03363 | train |
v2 | Schema:
regions (alias: rgn)(code, name, type, amount)
items(amount, id, salary, date)
Task: Retrieve id from regions that have at least one corresponding entry in items sharing the same status.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03364 | train |
v3 | Schema:
shipments (alias: shp)(status, date, name, salary)
invoices(salary, value, type, status)
Task: Retrieve id from shipments with amount above the MAX(value) of invoices rows sharing the same status.
SQL: | SELECT id FROM shipments AS shp
WHERE amount > (
SELECT MAX(value) FROM invoices AS inv
WHERE inv.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03365 | train |
v3 | Schema:
accounts (alias: acct)(salary, date, amount, value)
customers(code, amount, date, id)
Task: Find value from accounts where salary exceeds the minimum salary from customers for the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE salary > (
SELECT MIN(salary) FROM customers AS cust
WHERE cust.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03366 | train |
v2 | Schema:
orders (alias: ord)(type, name, code, amount)
schedules(type, salary, name, amount)
Task: Find value from orders where a matching record exists in schedules with the same level.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03367 | train |
v1 | Schema:
shipments (alias: shp)(type, date, code, level)
regions(code, status, type, id)
Task: Retrieve salary from shipments whose level is found in regions rows where id matches the outer record.
SQL: | SELECT salary FROM shipments AS shp
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03368 | train |
v1 | Schema:
schedules (alias: schd)(type, id, name, code)
branches(salary, date, status, amount)
Task: Retrieve name from schedules whose level is found in branches rows where code matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03369 | train |
v2 | Schema:
regions (alias: rgn)(code, name, date, type)
sales(type, code, salary, id)
Task: Retrieve value from regions that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03370 | train |
v3 | Schema:
items (alias: lne)(date, name, status, level)
invoices(name, code, status, type)
Task: Find name from items where salary exceeds the count of value from invoices for the same level.
SQL: | SELECT name FROM items AS lne
WHERE salary > (
SELECT COUNT(value) FROM invoices AS inv
WHERE inv.level = lne.level
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03371 | train |
v3 | Schema:
managers (alias: mgr)(date, name, id, status)
employees(type, value, name, id)
Task: Retrieve id from managers with salary above the COUNT(salary) of employees rows sharing the same id.
SQL: | SELECT id FROM managers AS mgr
WHERE salary > (
SELECT COUNT(salary) FROM employees AS emp
WHERE emp.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03372 | train |
v3 | Schema:
categories (alias: catg)(amount, name, date, status)
customers(date, salary, status, amount)
Task: Retrieve code from categories with salary above the SUM(value) of customers rows sharing the same id.
SQL: | SELECT code FROM categories AS catg
WHERE salary > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03373 | train |
v1 | Schema:
items (alias: lne)(id, level, type, code)
employees(salary, type, name, amount)
Task: Retrieve amount from items whose id is found in employees rows where level matches the outer record.
SQL: | SELECT amount FROM items AS lne
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.level = lne.level
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03374 | train |
v1 | Schema:
transactions (alias: txn)(id, name, type, code)
requests(date, code, name, id)
Task: Select code from transactions where code exists in requests for the same type.
SQL: | SELECT code FROM transactions AS txn
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03375 | train |
v1 | Schema:
customers (alias: cust)(salary, name, level, value)
regions(type, date, code, salary)
Task: Retrieve amount from customers whose level is found in regions rows where code matches the outer record.
SQL: | SELECT amount FROM customers AS cust
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03376 | train |
v1 | Schema:
projects (alias: prj)(type, level, status, salary)
sales(level, salary, name, amount)
Task: Retrieve amount from projects whose id is found in sales rows where status matches the outer record.
SQL: | SELECT amount FROM projects AS prj
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03377 | train |
v2 | Schema:
shipments (alias: shp)(code, name, type, value)
orders(level, name, id, amount)
Task: Retrieve id from shipments that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03378 | train |
v1 | Schema:
categories (alias: catg)(type, amount, date, salary)
orders(code, amount, id, name)
Task: Retrieve code from categories whose status is found in orders rows where code matches the outer record.
SQL: | SELECT code FROM categories AS catg
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03379 | train |
v2 | Schema:
schedules (alias: schd)(level, code, id, salary)
products(status, code, date, value)
Task: Find amount from schedules where a matching record exists in products with the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03380 | train |
v1 | Schema:
transactions (alias: txn)(amount, code, type, value)
categories(value, date, type, status)
Task: Select amount from transactions where type exists in categories for the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03381 | train |
v2 | Schema:
departments (alias: dept)(type, level, date, salary)
projects(id, salary, date, name)
Task: Retrieve salary from departments that have at least one corresponding entry in projects sharing the same level.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03382 | train |
v3 | Schema:
categories (alias: catg)(code, id, name, salary)
branches(salary, code, type, date)
Task: Retrieve code from categories with salary above the AVG(amount) of branches rows sharing the same level.
SQL: | SELECT code FROM categories AS catg
WHERE salary > (
SELECT AVG(amount) FROM branches AS brc
WHERE brc.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03383 | train |
v2 | Schema:
customers (alias: cust)(amount, value, level, name)
sales(value, salary, amount, level)
Task: Retrieve salary from customers that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03384 | train |
v2 | Schema:
regions (alias: rgn)(amount, type, value, name)
transactions(type, id, level, code)
Task: Retrieve amount from regions that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03385 | train |
v1 | Schema:
transactions (alias: txn)(level, code, id, name)
accounts(status, code, id, level)
Task: Find id from transactions where id appears in accounts entries with matching id.
SQL: | SELECT id FROM transactions AS txn
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03386 | train |
v1 | Schema:
sales (alias: sale)(value, id, level, name)
tasks(value, salary, date, level)
Task: Retrieve value from sales whose level is found in tasks rows where code matches the outer record.
SQL: | SELECT value FROM sales AS sale
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03387 | train |
v1 | Schema:
regions (alias: rgn)(amount, id, name, date)
categories(value, level, type, id)
Task: Select value from regions where status exists in categories for the same status.
SQL: | SELECT value FROM regions AS rgn
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03388 | train |
v1 | Schema:
orders (alias: ord)(type, id, status, salary)
invoices(value, code, name, level)
Task: Select salary from orders where level exists in invoices for the same type.
SQL: | SELECT salary FROM orders AS ord
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03389 | train |
v2 | Schema:
tasks (alias: tsk)(level, code, salary, amount)
managers(level, salary, amount, date)
Task: Retrieve amount from tasks that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03390 | train |
v2 | Schema:
shipments (alias: shp)(type, name, amount, salary)
accounts(amount, level, name, salary)
Task: Find salary from shipments where a matching record exists in accounts with the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03391 | train |
v3 | Schema:
staff (alias: empl)(date, value, status, name)
sales(type, level, id, name)
Task: Retrieve code from staff with amount above the COUNT(salary) of sales rows sharing the same level.
SQL: | SELECT code FROM staff AS empl
WHERE amount > (
SELECT COUNT(salary) FROM sales AS sale
WHERE sale.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03392 | train |
v2 | Schema:
shipments (alias: shp)(status, type, level, salary)
staff(amount, value, code, level)
Task: Retrieve salary from shipments that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT salary 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": "salary",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03393 | train |
v3 | Schema:
managers (alias: mgr)(type, level, salary, value)
projects(id, level, amount, salary)
Task: Retrieve name from managers with value above the MIN(salary) of projects rows sharing the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE value > (
SELECT MIN(salary) FROM projects AS prj
WHERE prj.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03394 | train |
v2 | Schema:
requests (alias: ordr)(date, amount, type, id)
invoices(status, name, type, level)
Task: Retrieve salary from requests that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03395 | train |
v3 | Schema:
departments (alias: dept)(code, value, level, type)
staff(level, status, amount, id)
Task: Retrieve code from departments with value above the COUNT(amount) of staff rows sharing the same type.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT COUNT(amount) FROM staff AS empl
WHERE empl.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03396 | train |
v3 | Schema:
products (alias: prod)(status, code, level, id)
requests(salary, status, type, value)
Task: Find code from products where value exceeds the minimum salary from requests for the same id.
SQL: | SELECT code FROM products AS prod
WHERE value > (
SELECT MIN(salary) FROM requests AS ordr
WHERE ordr.id = prod.id
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03397 | train |
v1 | Schema:
regions (alias: rgn)(code, date, level, name)
orders(value, name, code, id)
Task: Retrieve code from regions whose level is found in orders rows where status matches the outer record.
SQL: | SELECT code FROM regions AS rgn
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03398 | train |
v3 | Schema:
products (alias: prod)(amount, status, date, code)
managers(id, date, type, code)
Task: Retrieve name from products with salary above the MIN(value) of managers rows sharing the same type.
SQL: | SELECT name FROM products AS prod
WHERE salary > (
SELECT MIN(value) FROM managers AS mgr
WHERE mgr.type = prod.type
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03399 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.