variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v1 | Schema:
accounts (alias: acct)(level, id, code, date)
regions(type, id, salary, value)
Task: Find id from accounts where level appears in regions entries with matching type.
SQL: | SELECT id FROM accounts AS acct
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17600 | train |
v3 | Schema:
branches (alias: brc)(date, type, amount, name)
requests(salary, date, id, name)
Task: Find code from branches where amount exceeds the minimum amount from requests for the same code.
SQL: | SELECT code FROM branches AS brc
WHERE amount > (
SELECT MIN(amount) FROM requests AS ordr
WHERE ordr.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17601 | train |
v1 | Schema:
transactions (alias: txn)(status, id, amount, name)
projects(id, status, code, value)
Task: Find value from transactions where status appears in projects entries with matching code.
SQL: | SELECT value FROM transactions AS txn
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17602 | train |
v1 | Schema:
regions (alias: rgn)(id, salary, status, name)
orders(date, level, salary, amount)
Task: Retrieve id from regions whose type is found in orders rows where level matches the outer record.
SQL: | SELECT id FROM regions AS rgn
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17603 | train |
v2 | Schema:
employees (alias: emp)(name, date, code, salary)
tasks(salary, value, amount, level)
Task: Find name from employees where a matching record exists in tasks with the same id.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17604 | train |
v2 | Schema:
accounts (alias: acct)(amount, salary, level, id)
requests(id, level, type, salary)
Task: Find salary from accounts where a matching record exists in requests with the same id.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17605 | train |
v3 | Schema:
regions (alias: rgn)(name, salary, level, type)
managers(status, code, name, salary)
Task: Retrieve value from regions with salary above the AVG(amount) of managers rows sharing the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE salary > (
SELECT AVG(amount) FROM managers AS mgr
WHERE mgr.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17606 | train |
v1 | Schema:
items (alias: lne)(date, value, status, id)
branches(salary, code, name, level)
Task: Retrieve value from items whose level is found in branches rows where code matches the outer record.
SQL: | SELECT value FROM items AS lne
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.code = lne.code
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17607 | train |
v2 | Schema:
invoices (alias: inv)(value, type, level, code)
orders(name, amount, date, code)
Task: Retrieve id from invoices that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17608 | train |
v1 | Schema:
requests (alias: ordr)(name, type, salary, level)
tasks(name, value, level, amount)
Task: Select code from requests where code exists in tasks for the same status.
SQL: | SELECT code FROM requests AS ordr
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17609 | train |
v1 | Schema:
items (alias: lne)(code, status, salary, id)
products(date, status, type, name)
Task: Retrieve value from items whose type is found in products rows where level matches the outer record.
SQL: | SELECT value FROM items AS lne
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.level = lne.level
); | {
"outer_table": "items",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17610 | train |
v3 | Schema:
employees (alias: emp)(name, type, value, code)
staff(date, name, type, salary)
Task: Retrieve salary from employees with amount above the AVG(amount) of staff rows sharing the same id.
SQL: | SELECT salary FROM employees AS emp
WHERE amount > (
SELECT AVG(amount) FROM staff AS empl
WHERE empl.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17611 | train |
v1 | Schema:
categories (alias: catg)(code, name, date, value)
tasks(code, type, value, date)
Task: Retrieve amount from categories whose code is found in tasks rows where status matches the outer record.
SQL: | SELECT amount FROM categories AS catg
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17612 | train |
v2 | Schema:
schedules (alias: schd)(amount, level, code, status)
orders(id, status, name, type)
Task: Find amount from schedules where a matching record exists in orders with the same type.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17613 | train |
v3 | Schema:
categories (alias: catg)(code, level, type, amount)
sales(status, level, date, name)
Task: Find salary from categories where value exceeds the average salary from sales for the same id.
SQL: | SELECT salary FROM categories AS catg
WHERE value > (
SELECT AVG(salary) FROM sales AS sale
WHERE sale.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17614 | train |
v1 | Schema:
transactions (alias: txn)(id, status, name, salary)
staff(type, name, code, amount)
Task: Retrieve id from transactions whose type is found in staff rows where type matches the outer record.
SQL: | SELECT id FROM transactions AS txn
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17615 | train |
v1 | Schema:
regions (alias: rgn)(date, name, salary, code)
products(id, name, salary, level)
Task: Select salary from regions where id exists in products for the same id.
SQL: | SELECT salary FROM regions AS rgn
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17616 | train |
v3 | Schema:
categories (alias: catg)(date, value, name, id)
managers(amount, status, level, code)
Task: Retrieve name from categories with value above the SUM(value) of managers rows sharing the same id.
SQL: | SELECT name FROM categories AS catg
WHERE value > (
SELECT SUM(value) FROM managers AS mgr
WHERE mgr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17617 | train |
v1 | Schema:
shipments (alias: shp)(type, amount, salary, code)
regions(salary, level, value, status)
Task: Find code from shipments where type appears in regions entries with matching id.
SQL: | SELECT code FROM shipments AS shp
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17618 | train |
v2 | Schema:
customers (alias: cust)(code, salary, amount, level)
orders(value, type, status, date)
Task: Find salary from customers where a matching record exists in orders with the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17619 | train |
v1 | Schema:
projects (alias: prj)(type, level, code, value)
products(salary, value, date, code)
Task: Find amount from projects where status appears in products entries with matching id.
SQL: | SELECT amount FROM projects AS prj
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17620 | train |
v1 | Schema:
accounts (alias: acct)(type, status, amount, value)
products(type, level, id, salary)
Task: Select name from accounts where status exists in products for the same code.
SQL: | SELECT name FROM accounts AS acct
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17621 | train |
v1 | Schema:
regions (alias: rgn)(date, status, id, type)
accounts(id, type, status, date)
Task: Select salary from regions where level exists in accounts for the same status.
SQL: | SELECT salary FROM regions AS rgn
WHERE level IN (
SELECT level 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": "level",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17622 | train |
v1 | Schema:
employees (alias: emp)(code, name, salary, level)
regions(level, name, date, status)
Task: Select id from employees where code exists in regions for the same id.
SQL: | SELECT id FROM employees AS emp
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17623 | train |
v2 | Schema:
projects (alias: prj)(name, code, date, salary)
sales(code, value, status, type)
Task: Retrieve salary from projects that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17624 | train |
v3 | Schema:
sales (alias: sale)(status, amount, type, date)
customers(value, status, amount, salary)
Task: Retrieve amount from sales with amount above the MIN(salary) of customers rows sharing the same code.
SQL: | SELECT amount FROM sales AS sale
WHERE amount > (
SELECT MIN(salary) FROM customers AS cust
WHERE cust.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17625 | train |
v3 | Schema:
orders (alias: ord)(type, value, name, level)
invoices(salary, code, id, date)
Task: Retrieve salary from orders with amount above the AVG(salary) of invoices rows sharing the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE amount > (
SELECT AVG(salary) FROM invoices AS inv
WHERE inv.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17626 | train |
v1 | Schema:
accounts (alias: acct)(level, value, amount, name)
schedules(date, value, code, salary)
Task: Select name from accounts where code exists in schedules for the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17627 | train |
v2 | Schema:
categories (alias: catg)(level, salary, amount, code)
requests(date, id, code, salary)
Task: Retrieve salary from categories that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17628 | train |
v2 | Schema:
employees (alias: emp)(value, id, salary, status)
sales(date, code, status, value)
Task: Find amount from employees where a matching record exists in sales with the same level.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17629 | train |
v1 | Schema:
schedules (alias: schd)(id, date, amount, status)
invoices(id, status, amount, level)
Task: Find amount from schedules where level appears in invoices entries with matching type.
SQL: | SELECT amount FROM schedules AS schd
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17630 | train |
v1 | Schema:
categories (alias: catg)(type, code, date, name)
sales(type, date, amount, code)
Task: Select name from categories where type exists in sales for the same code.
SQL: | SELECT name FROM categories AS catg
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17631 | train |
v3 | Schema:
managers (alias: mgr)(salary, code, date, status)
employees(date, type, code, name)
Task: Find salary from managers where salary exceeds the count of amount from employees for the same status.
SQL: | SELECT salary FROM managers AS mgr
WHERE salary > (
SELECT COUNT(amount) FROM employees AS emp
WHERE emp.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17632 | train |
v1 | Schema:
transactions (alias: txn)(amount, date, name, level)
shipments(type, salary, id, date)
Task: Select name from transactions where code exists in shipments for the same type.
SQL: | SELECT name FROM transactions AS txn
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17633 | train |
v2 | Schema:
staff (alias: empl)(value, level, salary, code)
orders(name, type, salary, amount)
Task: Retrieve amount from staff that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17634 | train |
v1 | Schema:
projects (alias: prj)(level, salary, date, code)
regions(name, id, level, value)
Task: Find amount from projects where type appears in regions entries with matching type.
SQL: | SELECT amount FROM projects AS prj
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17635 | train |
v1 | Schema:
accounts (alias: acct)(salary, date, id, code)
orders(value, name, level, id)
Task: Find salary from accounts where code appears in orders entries with matching type.
SQL: | SELECT salary FROM accounts AS acct
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17636 | train |
v2 | Schema:
invoices (alias: inv)(value, code, amount, level)
shipments(salary, status, id, name)
Task: Find amount from invoices where a matching record exists in shipments with the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17637 | train |
v1 | Schema:
orders (alias: ord)(status, amount, date, level)
managers(name, level, id, date)
Task: Find value from orders where level appears in managers entries with matching level.
SQL: | SELECT value FROM orders AS ord
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17638 | train |
v1 | Schema:
tasks (alias: tsk)(level, date, id, value)
departments(code, id, name, type)
Task: Retrieve salary from tasks whose code is found in departments rows where level matches the outer record.
SQL: | SELECT salary FROM tasks AS tsk
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "tsk",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17639 | train |
v1 | Schema:
accounts (alias: acct)(date, value, level, type)
managers(name, code, amount, id)
Task: Select name from accounts where type exists in managers for the same level.
SQL: | SELECT name FROM accounts AS acct
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17640 | train |
v1 | Schema:
shipments (alias: shp)(code, id, name, date)
managers(code, name, salary, value)
Task: Find salary from shipments where code appears in managers entries with matching level.
SQL: | SELECT salary FROM shipments AS shp
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17641 | train |
v3 | Schema:
managers (alias: mgr)(code, status, type, name)
departments(amount, date, level, type)
Task: Retrieve name from managers with value above the MIN(value) of departments rows sharing the same code.
SQL: | SELECT name FROM managers AS mgr
WHERE value > (
SELECT MIN(value) FROM departments AS dept
WHERE dept.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17642 | train |
v2 | Schema:
projects (alias: prj)(amount, type, value, salary)
managers(level, id, amount, status)
Task: Find value from projects where a matching record exists in managers with the same level.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17643 | train |
v1 | Schema:
schedules (alias: schd)(id, salary, date, level)
staff(amount, level, id, salary)
Task: Select value from schedules where id exists in staff for the same code.
SQL: | SELECT value FROM schedules AS schd
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17644 | train |
v1 | Schema:
products (alias: prod)(salary, name, type, value)
projects(type, status, name, amount)
Task: Select value from products where status exists in projects for the same id.
SQL: | SELECT value FROM products AS prod
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.id = prod.id
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "prod",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17645 | train |
v2 | Schema:
departments (alias: dept)(code, amount, status, date)
categories(level, value, code, salary)
Task: Find code from departments where a matching record exists in categories with the same status.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17646 | train |
v3 | Schema:
accounts (alias: acct)(type, name, id, salary)
requests(code, name, amount, status)
Task: Retrieve name from accounts with amount above the COUNT(amount) of requests rows sharing the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE amount > (
SELECT COUNT(amount) FROM requests AS ordr
WHERE ordr.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17647 | train |
v2 | Schema:
employees (alias: emp)(salary, value, amount, level)
invoices(type, amount, code, status)
Task: Find value from employees where a matching record exists in invoices with the same code.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17648 | train |
v3 | Schema:
transactions (alias: txn)(code, value, status, level)
customers(id, value, level, amount)
Task: Find id from transactions where amount exceeds the total salary from customers for the same code.
SQL: | SELECT id FROM transactions AS txn
WHERE amount > (
SELECT SUM(salary) FROM customers AS cust
WHERE cust.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17649 | train |
v1 | Schema:
employees (alias: emp)(name, date, type, salary)
tasks(status, amount, code, name)
Task: Retrieve value from employees whose id is found in tasks rows where type matches the outer record.
SQL: | SELECT value FROM employees AS emp
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17650 | train |
v1 | Schema:
staff (alias: empl)(salary, status, name, level)
requests(amount, id, name, date)
Task: Find amount from staff where code appears in requests entries with matching id.
SQL: | SELECT amount FROM staff AS empl
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17651 | train |
v1 | Schema:
requests (alias: ordr)(id, code, name, date)
staff(status, level, type, code)
Task: Select value from requests where type exists in staff for the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17652 | train |
v3 | Schema:
orders (alias: ord)(date, code, name, status)
managers(code, level, amount, id)
Task: Retrieve amount from orders with salary above the AVG(amount) of managers rows sharing the same code.
SQL: | SELECT amount FROM orders AS ord
WHERE salary > (
SELECT AVG(amount) FROM managers AS mgr
WHERE mgr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17653 | train |
v1 | Schema:
requests (alias: ordr)(value, date, id, status)
products(salary, status, name, date)
Task: Select name from requests where level exists in products for the same code.
SQL: | SELECT name FROM requests AS ordr
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17654 | train |
v3 | Schema:
sales (alias: sale)(id, status, type, date)
items(value, name, salary, amount)
Task: Find id from sales where salary exceeds the maximum salary from items for the same code.
SQL: | SELECT id FROM sales AS sale
WHERE salary > (
SELECT MAX(salary) FROM items AS lne
WHERE lne.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17655 | train |
v1 | Schema:
invoices (alias: inv)(code, level, salary, id)
projects(amount, value, level, code)
Task: Find id from invoices where code appears in projects entries with matching level.
SQL: | SELECT id FROM invoices AS inv
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17656 | train |
v3 | Schema:
orders (alias: ord)(value, level, salary, id)
shipments(status, value, id, type)
Task: Find amount from orders where value exceeds the average value from shipments for the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE value > (
SELECT AVG(value) FROM shipments AS shp
WHERE shp.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17657 | train |
v3 | Schema:
orders (alias: ord)(name, level, code, status)
sales(date, name, type, level)
Task: Find value from orders where value exceeds the total amount from sales for the same level.
SQL: | SELECT value FROM orders AS ord
WHERE value > (
SELECT SUM(amount) FROM sales AS sale
WHERE sale.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17658 | train |
v2 | Schema:
branches (alias: brc)(date, name, level, amount)
products(status, value, date, code)
Task: Find name from branches where a matching record exists in products with the same code.
SQL: | SELECT name FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17659 | train |
v2 | Schema:
managers (alias: mgr)(date, value, level, status)
products(amount, id, code, date)
Task: Retrieve code from managers that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17660 | train |
v3 | Schema:
tasks (alias: tsk)(salary, code, date, level)
products(level, name, salary, id)
Task: Find name from tasks where value exceeds the minimum amount from products for the same level.
SQL: | SELECT name FROM tasks AS tsk
WHERE value > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17661 | train |
v3 | Schema:
employees (alias: emp)(salary, type, status, level)
managers(name, type, salary, date)
Task: Retrieve name from employees with amount above the COUNT(value) of managers rows sharing the same level.
SQL: | SELECT name FROM employees AS emp
WHERE amount > (
SELECT COUNT(value) FROM managers AS mgr
WHERE mgr.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17662 | train |
v2 | Schema:
departments (alias: dept)(value, status, name, code)
requests(id, salary, level, value)
Task: Find value from departments where a matching record exists in requests with the same id.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17663 | train |
v3 | Schema:
regions (alias: rgn)(status, id, date, value)
schedules(level, date, id, name)
Task: Retrieve salary from regions with amount above the SUM(amount) of schedules rows sharing the same status.
SQL: | SELECT salary FROM regions AS rgn
WHERE amount > (
SELECT SUM(amount) FROM schedules AS schd
WHERE schd.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17664 | train |
v3 | Schema:
transactions (alias: txn)(code, level, amount, value)
sales(name, date, value, status)
Task: Retrieve code from transactions with amount above the SUM(amount) of sales rows sharing the same code.
SQL: | SELECT code FROM transactions AS txn
WHERE amount > (
SELECT SUM(amount) FROM sales AS sale
WHERE sale.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17665 | train |
v1 | Schema:
items (alias: lne)(code, status, name, level)
staff(amount, date, name, salary)
Task: Retrieve amount from items whose level is found in staff rows where id matches the outer record.
SQL: | SELECT amount FROM items AS lne
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.id = lne.id
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17666 | train |
v1 | Schema:
accounts (alias: acct)(date, status, value, level)
transactions(value, status, id, level)
Task: Retrieve name from accounts whose id is found in transactions rows where level matches the outer record.
SQL: | SELECT name FROM accounts AS acct
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17667 | train |
v3 | Schema:
regions (alias: rgn)(status, name, level, amount)
shipments(status, date, name, salary)
Task: Retrieve name from regions with salary above the COUNT(amount) of shipments rows sharing the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE salary > (
SELECT COUNT(amount) FROM shipments AS shp
WHERE shp.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17668 | train |
v1 | Schema:
categories (alias: catg)(code, status, id, salary)
customers(id, type, name, code)
Task: Find code from categories where level appears in customers entries with matching type.
SQL: | SELECT code FROM categories AS catg
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17669 | train |
v2 | Schema:
items (alias: lne)(type, code, id, value)
invoices(type, id, status, salary)
Task: Find salary from items where a matching record exists in invoices with the same type.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = lne.type
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17670 | train |
v3 | Schema:
invoices (alias: inv)(status, value, date, id)
orders(name, level, id, salary)
Task: Retrieve value from invoices with amount above the MIN(amount) of orders rows sharing the same id.
SQL: | SELECT value FROM invoices AS inv
WHERE amount > (
SELECT MIN(amount) FROM orders AS ord
WHERE ord.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17671 | train |
v1 | Schema:
projects (alias: prj)(value, level, code, amount)
categories(name, id, amount, value)
Task: Select id from projects where status exists in categories for the same id.
SQL: | SELECT id FROM projects AS prj
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17672 | train |
v3 | Schema:
employees (alias: emp)(type, code, name, level)
staff(date, id, name, salary)
Task: Retrieve salary from employees with salary above the MAX(amount) of staff rows sharing the same id.
SQL: | SELECT salary FROM employees AS emp
WHERE salary > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17673 | train |
v3 | Schema:
branches (alias: brc)(level, date, status, name)
employees(type, code, value, id)
Task: Retrieve name from branches with amount above the MIN(salary) of employees rows sharing the same status.
SQL: | SELECT name FROM branches AS brc
WHERE amount > (
SELECT MIN(salary) FROM employees AS emp
WHERE emp.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17674 | train |
v2 | Schema:
staff (alias: empl)(salary, code, status, type)
branches(level, status, name, date)
Task: Find value from staff where a matching record exists in branches with the same id.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17675 | train |
v2 | Schema:
departments (alias: dept)(code, id, date, amount)
regions(date, id, type, name)
Task: Retrieve value from departments that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17676 | train |
v1 | Schema:
managers (alias: mgr)(salary, code, date, status)
categories(salary, amount, level, name)
Task: Retrieve name from managers whose status is found in categories rows where status matches the outer record.
SQL: | SELECT name FROM managers AS mgr
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17677 | train |
v3 | Schema:
projects (alias: prj)(salary, code, date, type)
sales(type, amount, status, salary)
Task: Find salary from projects where salary exceeds the minimum value from sales for the same code.
SQL: | SELECT salary FROM projects AS prj
WHERE salary > (
SELECT MIN(value) FROM sales AS sale
WHERE sale.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17678 | train |
v2 | Schema:
shipments (alias: shp)(date, code, value, id)
projects(code, status, value, amount)
Task: Find code from shipments where a matching record exists in projects with the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17679 | train |
v2 | Schema:
categories (alias: catg)(id, level, value, type)
products(amount, date, level, status)
Task: Find salary from categories where a matching record exists in products with the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17680 | train |
v2 | Schema:
staff (alias: empl)(code, date, value, id)
tasks(id, status, code, type)
Task: Retrieve amount from staff that have at least one corresponding entry in tasks sharing the same code.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17681 | train |
v1 | Schema:
sales (alias: sale)(status, id, amount, name)
requests(amount, status, level, code)
Task: Select value from sales where type exists in requests for the same type.
SQL: | SELECT value FROM sales AS sale
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17682 | train |
v2 | Schema:
products (alias: prod)(name, level, salary, amount)
orders(id, date, type, amount)
Task: Retrieve amount from products that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = prod.id
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17683 | train |
v3 | Schema:
transactions (alias: txn)(date, salary, name, amount)
sales(amount, code, name, salary)
Task: Retrieve value from transactions with value above the COUNT(value) of sales rows sharing the same id.
SQL: | SELECT value FROM transactions AS txn
WHERE value > (
SELECT COUNT(value) FROM sales AS sale
WHERE sale.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17684 | train |
v3 | Schema:
sales (alias: sale)(amount, level, status, id)
projects(code, amount, status, salary)
Task: Retrieve code from sales with value above the COUNT(amount) of projects rows sharing the same id.
SQL: | SELECT code FROM sales AS sale
WHERE value > (
SELECT COUNT(amount) FROM projects AS prj
WHERE prj.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17685 | train |
v1 | Schema:
orders (alias: ord)(date, name, id, type)
transactions(code, status, salary, date)
Task: Find salary from orders where id appears in transactions entries with matching id.
SQL: | SELECT salary FROM orders AS ord
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17686 | train |
v2 | Schema:
categories (alias: catg)(name, code, level, status)
items(code, salary, type, amount)
Task: Retrieve salary from categories that have at least one corresponding entry in items sharing the same status.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17687 | train |
v1 | Schema:
shipments (alias: shp)(date, value, code, level)
categories(amount, id, code, level)
Task: Select value from shipments where id exists in categories for the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17688 | train |
v3 | Schema:
regions (alias: rgn)(date, status, id, type)
sales(name, amount, id, level)
Task: Find amount from regions where amount exceeds the minimum salary from sales for the same level.
SQL: | SELECT amount FROM regions AS rgn
WHERE amount > (
SELECT MIN(salary) FROM sales AS sale
WHERE sale.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17689 | train |
v2 | Schema:
requests (alias: ordr)(id, code, status, level)
categories(date, salary, id, type)
Task: Retrieve salary from requests that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17690 | train |
v3 | Schema:
invoices (alias: inv)(id, value, level, amount)
transactions(value, date, type, amount)
Task: Retrieve amount from invoices with salary above the MIN(salary) of transactions rows sharing the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE salary > (
SELECT MIN(salary) FROM transactions AS txn
WHERE txn.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17691 | train |
v2 | Schema:
accounts (alias: acct)(salary, code, id, status)
categories(level, name, type, value)
Task: Find name from accounts where a matching record exists in categories with the same level.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17692 | train |
v3 | Schema:
orders (alias: ord)(id, salary, code, amount)
regions(type, amount, value, status)
Task: Retrieve value from orders with value above the AVG(amount) of regions rows sharing the same id.
SQL: | SELECT value FROM orders AS ord
WHERE value > (
SELECT AVG(amount) FROM regions AS rgn
WHERE rgn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17693 | train |
v3 | Schema:
customers (alias: cust)(date, id, value, status)
invoices(value, id, date, salary)
Task: Retrieve id from customers with value above the SUM(amount) of invoices rows sharing the same level.
SQL: | SELECT id FROM customers AS cust
WHERE value > (
SELECT SUM(amount) FROM invoices AS inv
WHERE inv.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17694 | train |
v2 | Schema:
products (alias: prod)(status, salary, level, amount)
customers(amount, value, id, salary)
Task: Retrieve id from products that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = prod.code
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17695 | train |
v1 | Schema:
projects (alias: prj)(salary, id, level, value)
sales(id, value, date, name)
Task: Select value from projects where level exists in sales for the same id.
SQL: | SELECT value FROM projects AS prj
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17696 | train |
v1 | Schema:
schedules (alias: schd)(type, status, date, level)
regions(code, name, amount, value)
Task: Find amount from schedules where level appears in regions entries with matching status.
SQL: | SELECT amount FROM schedules AS schd
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17697 | train |
v1 | Schema:
categories (alias: catg)(value, type, code, level)
tasks(date, level, name, salary)
Task: Find code from categories where status appears in tasks entries with matching id.
SQL: | SELECT code FROM categories AS catg
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17698 | train |
v1 | Schema:
items (alias: lne)(name, value, salary, amount)
shipments(code, date, value, name)
Task: Select salary from items where type exists in shipments for the same id.
SQL: | SELECT salary FROM items AS lne
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.id = lne.id
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17699 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.