variant stringclasses 3
values | prompt stringlengths 163 237 | sql stringlengths 103 143 | metadata unknown | id stringlengths 21 21 | split stringclasses 1
value | token_group stringclasses 2
values |
|---|---|---|---|---|---|---|
v2 | Schema:
items (alias: lne)(status, level, name, amount)
products(level, value, id, type)
Task: Find salary from items where a matching record exists in products with the same type.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = lne.type
); | {
"outer_table": "items",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_06200 | train | T2 |
v2 | Schema:
invoices (alias: inv)(amount, status, code, salary)
schedules(name, date, type, salary)
Task: Find salary from invoices where a matching record exists in schedules with the same status.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_06201 | train | T1 |
v3 | Schema:
budgets (alias: budg)(value, id, status, level)
staff(name, value, amount, salary)
Task: Retrieve name from budgets with salary above the MIN(salary) of staff rows sharing the same id.
SQL: | SELECT name FROM budgets AS budg
WHERE salary > (
SELECT MIN(salary) FROM staff AS empl
WHERE empl.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "staff",
"outer_alias": "budg",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_06202 | train | T2 |
v2 | Schema:
employees (alias: emp)(amount, type, value, id)
schedules(value, status, type, salary)
Task: Find salary from employees where a matching record exists in schedules with the same type.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_06203 | train | T1 |
v3 | Schema:
departments (alias: dept)(id, name, value, code)
warehouses(type, level, name, date)
Task: Retrieve salary from departments with value above the SUM(value) of warehouses rows sharing the same level.
SQL: | SELECT salary FROM departments AS dept
WHERE value > (
SELECT SUM(value) FROM warehouses AS whs
WHERE whs.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "warehouses",
"outer_alias": "dept",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_06204 | train | T1 |
v3 | Schema:
staff (alias: empl)(type, salary, level, id)
items(value, level, salary, status)
Task: Find code from staff where amount exceeds the average value from items for the same code.
SQL: | SELECT code FROM staff AS empl
WHERE amount > (
SELECT MAX(value) FROM items AS lne
WHERE lne.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_06205 | train | T2 |
v2 | Schema:
managers (alias: mgr)(date, value, salary, amount)
regions(name, salary, id, date)
Task: Retrieve id from managers that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_06206 | train | T1 |
v1 | Schema:
orders (alias: ord)(amount, date, type, salary)
managers(id, salary, status, name)
Task: Find salary from orders where id appears in managers entries with matching type.
SQL: | SELECT salary FROM orders AS ord
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_06207 | train | T1 |
v1 | Schema:
budgets (alias: budg)(value, salary, level, status)
schedules(name, code, id, type)
Task: Retrieve value from budgets whose status is found in schedules rows where code matches the outer record.
SQL: | SELECT value FROM budgets AS budg
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "schedules",
"outer_alias": "budg",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_06208 | train | T2 |
v2 | Schema:
shipments (alias: shp)(status, level, value, id)
invoices(salary, status, value, code)
Task: Find amount from shipments where a matching record exists in invoices with the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_06209 | train | T2 |
v3 | Schema:
sales (alias: sale)(value, id, status, amount)
products(status, date, name, level)
Task: Find value from sales where salary exceeds the average amount from products for the same id.
SQL: | SELECT value FROM sales AS sale
WHERE salary > (
SELECT MAX(amount) FROM products AS prod
WHERE prod.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_06210 | train | T1 |
v3 | Schema:
requests (alias: ordr)(level, type, salary, status)
managers(amount, value, salary, level)
Task: Retrieve value from requests with value above the MAX(salary) of managers rows sharing the same code.
SQL: | SELECT value FROM requests AS ordr
WHERE value > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_06211 | train | T2 |
v1 | Schema:
departments (alias: dept)(code, type, amount, name)
orders(name, amount, date, level)
Task: Retrieve amount from departments whose id is found in orders rows where code matches the outer record.
SQL: | SELECT amount FROM departments AS dept
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_06212 | train | T1 |
v2 | Schema:
accounts (alias: acct)(value, name, amount, id)
shipments(salary, type, amount, name)
Task: Find salary from accounts where a matching record exists in shipments with the same status.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_06213 | train | T1 |
v2 | Schema:
categories (alias: catg)(name, date, type, amount)
warehouses(status, id, amount, salary)
Task: Find value from categories where a matching record exists in warehouses with the same type.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "warehouses",
"outer_alias": "catg",
"inner_alias": "whs",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_06214 | train | T2 |
v2 | Schema:
services (alias: srvc)(date, id, value, level)
departments(value, status, date, type)
Task: Find id from services where a matching record exists in departments with the same id.
SQL: | SELECT id FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "departments",
"outer_alias": "srvc",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_06215 | train | T2 |
v2 | Schema:
categories (alias: catg)(code, level, name, value)
schedules(status, id, value, code)
Task: Find value from categories where a matching record exists in schedules with the same status.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_06216 | train | T2 |
v2 | Schema:
transactions (alias: txn)(value, name, id, salary)
items(status, id, date, name)
Task: Retrieve code from transactions that have at least one corresponding entry in items sharing the same code.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_06217 | train | T1 |
v2 | Schema:
shipments (alias: shp)(status, salary, date, id)
staff(code, level, name, amount)
Task: Find value from shipments where a matching record exists in staff with the same id.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_06218 | train | T2 |
v2 | Schema:
customers (alias: cust)(level, status, type, amount)
categories(id, amount, level, value)
Task: Find name from customers where a matching record exists in categories with the same level.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_06219 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(value, level, code, status)
orders(id, type, value, date)
Task: Select id from warehouses where status exists in orders for the same id.
SQL: | SELECT id FROM warehouses AS whs
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "orders",
"outer_alias": "whs",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_06220 | train | T2 |
v3 | Schema:
regions (alias: rgn)(code, value, level, id)
products(code, id, name, type)
Task: Find salary from regions where amount exceeds the average amount from products for the same level.
SQL: | SELECT salary FROM regions AS rgn
WHERE amount > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_06221 | train | T2 |
v3 | Schema:
invoices (alias: inv)(level, status, id, amount)
sales(id, status, date, amount)
Task: Find code from invoices where value exceeds the average amount from sales for the same level.
SQL: | SELECT code FROM invoices AS inv
WHERE value > (
SELECT SUM(amount) FROM sales AS sale
WHERE sale.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_06222 | train | T1 |
v3 | Schema:
transactions (alias: txn)(type, status, value, name)
schedules(id, status, amount, date)
Task: Retrieve amount from transactions with amount above the COUNT(salary) of schedules rows sharing the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE amount > (
SELECT COUNT(salary) FROM schedules AS schd
WHERE schd.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_06223 | train | T1 |
v1 | Schema:
regions (alias: rgn)(value, salary, date, type)
requests(code, date, type, amount)
Task: Retrieve code from regions whose status is found in requests rows where level matches the outer record.
SQL: | SELECT code FROM regions AS rgn
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_06224 | train | T2 |
v3 | Schema:
products (alias: prod)(code, status, name, level)
items(status, date, level, id)
Task: Retrieve amount from products with salary above the COUNT(salary) of items rows sharing the same level.
SQL: | SELECT amount FROM products AS prod
WHERE salary > (
SELECT COUNT(salary) FROM items AS lne
WHERE lne.level = prod.level
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_06225 | train | T1 |
v2 | Schema:
departments (alias: dept)(code, date, level, id)
requests(salary, status, type, name)
Task: Retrieve code from departments that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_06226 | train | T1 |
v3 | Schema:
staff (alias: empl)(level, salary, id, type)
items(type, amount, date, name)
Task: Find code from staff where value exceeds the average salary from items for the same type.
SQL: | SELECT code FROM staff AS empl
WHERE value > (
SELECT SUM(salary) FROM items AS lne
WHERE lne.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_06227 | train | T2 |
v3 | Schema:
categories (alias: catg)(level, date, amount, salary)
staff(value, code, salary, date)
Task: Retrieve amount from categories with amount above the MAX(amount) of staff rows sharing the same type.
SQL: | SELECT amount FROM categories AS catg
WHERE amount > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_06228 | train | T2 |
v3 | Schema:
sales (alias: sale)(value, level, name, date)
employees(amount, value, date, type)
Task: Retrieve salary from sales with amount above the COUNT(amount) of employees rows sharing the same id.
SQL: | SELECT salary FROM sales AS sale
WHERE amount > (
SELECT COUNT(amount) FROM employees AS emp
WHERE emp.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_06229 | train | T1 |
v2 | Schema:
invoices (alias: inv)(id, date, status, name)
requests(type, salary, amount, code)
Task: Find amount from invoices where a matching record exists in requests with the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_06230 | train | T1 |
v1 | Schema:
managers (alias: mgr)(amount, level, type, salary)
regions(code, level, type, name)
Task: Find name from managers where type appears in regions entries with matching level.
SQL: | SELECT name FROM managers AS mgr
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_06231 | train | T1 |
v2 | Schema:
sales (alias: sale)(id, date, status, salary)
items(value, date, type, name)
Task: Retrieve code from sales that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_06232 | train | T1 |
v3 | Schema:
departments (alias: dept)(type, amount, date, status)
budgets(date, value, name, id)
Task: Find amount from departments where amount exceeds the average amount from budgets for the same status.
SQL: | SELECT amount FROM departments AS dept
WHERE amount > (
SELECT COUNT(amount) FROM budgets AS budg
WHERE budg.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "budgets",
"outer_alias": "dept",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_06233 | train | T1 |
v1 | Schema:
categories (alias: catg)(date, type, salary, level)
items(name, id, status, date)
Task: Select salary from categories where id exists in items for the same id.
SQL: | SELECT salary FROM categories AS catg
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_06234 | train | T2 |
v3 | Schema:
departments (alias: dept)(value, type, code, id)
managers(status, salary, value, id)
Task: Find id from departments where amount exceeds the average salary from managers for the same code.
SQL: | SELECT id FROM departments AS dept
WHERE amount > (
SELECT COUNT(salary) FROM managers AS mgr
WHERE mgr.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_06235 | train | T1 |
v2 | Schema:
transactions (alias: txn)(value, amount, date, name)
regions(level, name, code, id)
Task: Find salary from transactions where a matching record exists in regions with the same status.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_06236 | train | T1 |
v2 | Schema:
categories (alias: catg)(name, id, code, value)
items(salary, level, status, name)
Task: Find salary from categories where a matching record exists in items with the same code.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_06237 | train | T2 |
v1 | Schema:
staff (alias: empl)(value, level, id, amount)
products(value, name, type, code)
Task: Select name from staff where status exists in products for the same status.
SQL: | SELECT name FROM staff AS empl
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_06238 | train | T2 |
v3 | Schema:
shipments (alias: shp)(id, name, date, value)
requests(level, amount, code, status)
Task: Retrieve salary from shipments with value above the COUNT(value) of requests rows sharing the same level.
SQL: | SELECT salary FROM shipments AS shp
WHERE value > (
SELECT COUNT(value) FROM requests AS ordr
WHERE ordr.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_06239 | train | T2 |
v3 | Schema:
orders (alias: ord)(name, date, type, value)
services(type, level, date, salary)
Task: Retrieve name from orders with value above the COUNT(amount) of services rows sharing the same level.
SQL: | SELECT name FROM orders AS ord
WHERE value > (
SELECT COUNT(amount) FROM services AS srvc
WHERE srvc.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "services",
"outer_alias": "ord",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_06240 | train | T1 |
v1 | Schema:
products (alias: prod)(date, id, code, status)
invoices(status, id, level, name)
Task: Retrieve amount from products whose level is found in invoices rows where level matches the outer record.
SQL: | SELECT amount FROM products AS prod
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.level = prod.level
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_06241 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(name, salary, value, code)
schedules(id, name, code, date)
Task: Retrieve value from warehouses with amount above the COUNT(salary) of schedules rows sharing the same type.
SQL: | SELECT value FROM warehouses AS whs
WHERE amount > (
SELECT COUNT(salary) FROM schedules AS schd
WHERE schd.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "schedules",
"outer_alias": "whs",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_06242 | train | T2 |
v3 | Schema:
regions (alias: rgn)(salary, level, status, value)
products(id, level, value, name)
Task: Retrieve code from regions with amount above the MIN(value) of products rows sharing the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE amount > (
SELECT MIN(value) FROM products AS prod
WHERE prod.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_06243 | train | T2 |
v3 | Schema:
products (alias: prod)(salary, value, type, level)
orders(code, level, name, status)
Task: Retrieve code from products with value above the AVG(amount) of orders rows sharing the same type.
SQL: | SELECT code FROM products AS prod
WHERE value > (
SELECT AVG(amount) FROM orders AS ord
WHERE ord.type = prod.type
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_06244 | train | T1 |
v3 | Schema:
transactions (alias: txn)(salary, amount, type, name)
items(id, code, status, name)
Task: Retrieve code from transactions with amount above the MIN(salary) of items rows sharing the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE amount > (
SELECT MIN(salary) 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": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_06245 | train | T1 |
v3 | Schema:
products (alias: prod)(level, type, value, status)
requests(id, date, value, type)
Task: Find name from products where amount exceeds the average salary from requests for the same code.
SQL: | SELECT name FROM products AS prod
WHERE amount > (
SELECT MIN(salary) FROM requests AS ordr
WHERE ordr.code = prod.code
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_06246 | train | T1 |
v3 | Schema:
customers (alias: cust)(code, date, level, salary)
orders(status, code, name, amount)
Task: Retrieve amount from customers with salary above the AVG(value) of orders rows sharing the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE salary > (
SELECT AVG(value) FROM orders AS ord
WHERE ord.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_06247 | train | T1 |
v2 | Schema:
regions (alias: rgn)(date, id, amount, level)
orders(id, status, amount, salary)
Task: Find code from regions where a matching record exists in orders with the same level.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_06248 | train | T2 |
v3 | Schema:
orders (alias: ord)(code, date, id, level)
invoices(status, type, date, amount)
Task: Retrieve amount from orders with salary above the COUNT(amount) of invoices rows sharing the same type.
SQL: | SELECT amount FROM orders AS ord
WHERE salary > (
SELECT COUNT(amount) FROM invoices AS inv
WHERE inv.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_06249 | train | T1 |
v3 | Schema:
orders (alias: ord)(level, code, date, value)
invoices(id, code, date, salary)
Task: Find value from orders where value exceeds the average value from invoices for the same id.
SQL: | SELECT value FROM orders AS ord
WHERE value > (
SELECT SUM(value) FROM invoices AS inv
WHERE inv.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_06250 | train | T1 |
v2 | Schema:
accounts (alias: acct)(amount, name, salary, level)
warehouses(id, level, code, salary)
Task: Retrieve salary from accounts that have at least one corresponding entry in warehouses sharing the same level.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "warehouses",
"outer_alias": "acct",
"inner_alias": "whs",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_06251 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(status, date, value, code)
managers(value, code, date, status)
Task: Select amount from warehouses where type exists in managers for the same status.
SQL: | SELECT amount FROM warehouses AS whs
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "managers",
"outer_alias": "whs",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_06252 | train | T2 |
v3 | Schema:
managers (alias: mgr)(amount, id, code, date)
warehouses(salary, code, type, amount)
Task: Retrieve salary from managers with salary above the AVG(salary) of warehouses rows sharing the same code.
SQL: | SELECT salary FROM managers AS mgr
WHERE salary > (
SELECT AVG(salary) FROM warehouses AS whs
WHERE whs.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "warehouses",
"outer_alias": "mgr",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_06253 | train | T1 |
v1 | Schema:
managers (alias: mgr)(id, status, date, type)
schedules(amount, id, status, salary)
Task: Retrieve amount from managers whose status is found in schedules rows where status matches the outer record.
SQL: | SELECT amount FROM managers AS mgr
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_06254 | train | T1 |
v3 | Schema:
budgets (alias: budg)(date, name, salary, amount)
products(code, type, level, id)
Task: Find value from budgets where amount exceeds the average amount from products for the same code.
SQL: | SELECT value FROM budgets AS budg
WHERE amount > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "products",
"outer_alias": "budg",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_06255 | train | T2 |
v2 | Schema:
departments (alias: dept)(type, name, level, code)
requests(id, salary, amount, type)
Task: Find amount from departments where a matching record exists in requests with the same code.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_06256 | train | T1 |
v2 | Schema:
transactions (alias: txn)(value, date, amount, name)
managers(date, level, code, id)
Task: Find id from transactions where a matching record exists in managers with the same level.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_06257 | train | T1 |
v2 | Schema:
managers (alias: mgr)(type, code, level, salary)
warehouses(code, value, type, id)
Task: Retrieve name from managers that have at least one corresponding entry in warehouses sharing the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "warehouses",
"outer_alias": "mgr",
"inner_alias": "whs",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_06258 | train | T1 |
v2 | Schema:
accounts (alias: acct)(salary, id, type, name)
items(value, amount, date, salary)
Task: Find name from accounts where a matching record exists in items with the same code.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_06259 | train | T1 |
v1 | Schema:
budgets (alias: budg)(id, code, status, name)
employees(salary, type, date, amount)
Task: Select value from budgets where type exists in employees for the same status.
SQL: | SELECT value FROM budgets AS budg
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "employees",
"outer_alias": "budg",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_06260 | train | T2 |
v2 | Schema:
orders (alias: ord)(value, status, name, id)
items(amount, code, date, name)
Task: Retrieve salary from orders that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_06261 | train | T1 |
v2 | Schema:
invoices (alias: inv)(level, name, type, code)
items(name, value, salary, code)
Task: Find amount from invoices where a matching record exists in items with the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_06262 | train | T1 |
v3 | Schema:
departments (alias: dept)(value, name, date, type)
warehouses(date, id, code, value)
Task: Find salary from departments where amount exceeds the average amount from warehouses for the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE amount > (
SELECT MAX(amount) FROM warehouses AS whs
WHERE whs.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "warehouses",
"outer_alias": "dept",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_06263 | train | T1 |
v1 | Schema:
products (alias: prod)(value, amount, id, date)
managers(salary, status, amount, level)
Task: Find salary from products where type appears in managers entries with matching status.
SQL: | SELECT salary FROM products AS prod
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.status = prod.status
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_06264 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(level, date, value, name)
items(code, salary, value, id)
Task: Select salary from warehouses where id exists in items for the same code.
SQL: | SELECT salary FROM warehouses AS whs
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "items",
"outer_alias": "whs",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_06265 | train | T2 |
v1 | Schema:
sales (alias: sale)(date, amount, code, level)
regions(id, status, name, type)
Task: Select code from sales where id exists in regions for the same status.
SQL: | SELECT code FROM sales AS sale
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_06266 | train | T1 |
v3 | Schema:
schedules (alias: schd)(level, type, salary, amount)
items(salary, code, status, id)
Task: Retrieve amount from schedules with value above the COUNT(amount) of items rows sharing the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE value > (
SELECT COUNT(amount) FROM items AS lne
WHERE lne.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_06267 | train | T2 |
v1 | Schema:
employees (alias: emp)(date, status, id, amount)
departments(status, id, name, code)
Task: Find id from employees where status appears in departments entries with matching status.
SQL: | SELECT id FROM employees AS emp
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_06268 | train | T1 |
v2 | Schema:
sales (alias: sale)(amount, level, id, type)
shipments(level, status, salary, id)
Task: Retrieve amount from sales that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_06269 | train | T1 |
v1 | Schema:
orders (alias: ord)(salary, amount, code, name)
employees(salary, level, id, value)
Task: Find code from orders where code appears in employees entries with matching type.
SQL: | SELECT code FROM orders AS ord
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_06270 | train | T1 |
v2 | Schema:
requests (alias: ordr)(code, amount, name, status)
shipments(amount, date, name, salary)
Task: Retrieve id from requests that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_06271 | train | T2 |
v1 | Schema:
departments (alias: dept)(date, status, salary, name)
requests(level, id, value, salary)
Task: Retrieve id from departments whose code is found in requests rows where code matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_06272 | train | T1 |
v2 | Schema:
sales (alias: sale)(value, date, salary, id)
shipments(level, type, salary, amount)
Task: Retrieve code from sales that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_06273 | train | T1 |
v2 | Schema:
schedules (alias: schd)(status, id, name, date)
requests(type, id, amount, value)
Task: Retrieve salary from schedules that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_06274 | train | T2 |
v1 | Schema:
customers (alias: cust)(level, code, id, type)
sales(type, level, name, status)
Task: Find code from customers where code appears in sales entries with matching status.
SQL: | SELECT code FROM customers AS cust
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_06275 | train | T1 |
v3 | Schema:
regions (alias: rgn)(status, code, id, salary)
accounts(date, value, name, salary)
Task: Retrieve name from regions with salary above the MAX(salary) of accounts rows sharing the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE salary > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_06276 | train | T2 |
v1 | Schema:
items (alias: lne)(id, type, amount, code)
transactions(status, salary, type, date)
Task: Select salary from items where id exists in transactions for the same id.
SQL: | SELECT salary FROM items AS lne
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.id = lne.id
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_06277 | train | T2 |
v2 | Schema:
products (alias: prod)(name, salary, type, date)
staff(value, status, code, level)
Task: Find value from products where a matching record exists in staff with the same status.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = prod.status
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_06278 | train | T1 |
v3 | Schema:
orders (alias: ord)(status, amount, name, date)
departments(amount, status, id, value)
Task: Retrieve id from orders with value above the AVG(value) of departments rows sharing the same id.
SQL: | SELECT id FROM orders AS ord
WHERE value > (
SELECT AVG(value) FROM departments AS dept
WHERE dept.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_06279 | train | T1 |
v3 | Schema:
customers (alias: cust)(status, id, amount, name)
categories(code, salary, amount, type)
Task: Find name from customers where value exceeds the average salary from categories for the same code.
SQL: | SELECT name FROM customers AS cust
WHERE value > (
SELECT AVG(salary) FROM categories AS catg
WHERE catg.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_06280 | train | T1 |
v3 | Schema:
staff (alias: empl)(code, salary, id, level)
services(code, amount, value, name)
Task: Retrieve amount from staff with value above the MAX(salary) of services rows sharing the same status.
SQL: | SELECT amount FROM staff AS empl
WHERE value > (
SELECT MAX(salary) FROM services AS srvc
WHERE srvc.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "services",
"outer_alias": "empl",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_06281 | train | T2 |
v2 | Schema:
departments (alias: dept)(code, status, type, id)
items(type, id, code, value)
Task: Find name from departments where a matching record exists in items with the same level.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_06282 | train | T1 |
v3 | Schema:
categories (alias: catg)(date, amount, level, value)
schedules(value, date, name, code)
Task: Find amount from categories where value exceeds the average value from schedules for the same level.
SQL: | SELECT amount FROM categories AS catg
WHERE value > (
SELECT COUNT(value) FROM schedules AS schd
WHERE schd.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_06283 | train | T2 |
v3 | Schema:
products (alias: prod)(type, id, level, code)
departments(date, salary, status, level)
Task: Retrieve amount from products with amount above the MAX(salary) of departments rows sharing the same code.
SQL: | SELECT amount FROM products AS prod
WHERE amount > (
SELECT MAX(salary) FROM departments AS dept
WHERE dept.code = prod.code
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_06284 | train | T1 |
v1 | Schema:
departments (alias: dept)(level, code, id, date)
services(amount, salary, name, level)
Task: Select name from departments where status exists in services for the same code.
SQL: | SELECT name FROM departments AS dept
WHERE status IN (
SELECT status FROM services AS srvc
WHERE srvc.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "services",
"outer_alias": "dept",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_06285 | train | T1 |
v3 | Schema:
employees (alias: emp)(level, amount, code, type)
customers(status, id, date, type)
Task: Retrieve name from employees with salary above the MIN(value) of customers rows sharing the same id.
SQL: | SELECT name FROM employees AS emp
WHERE salary > (
SELECT MIN(value) FROM customers AS cust
WHERE cust.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_06286 | train | T1 |
v1 | Schema:
items (alias: lne)(level, amount, code, name)
regions(level, code, type, amount)
Task: Find code from items where status appears in regions entries with matching status.
SQL: | SELECT code FROM items AS lne
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_06287 | train | T2 |
v3 | Schema:
departments (alias: dept)(date, amount, level, status)
accounts(value, level, name, amount)
Task: Find code from departments where amount exceeds the average amount from accounts for the same level.
SQL: | SELECT code FROM departments AS dept
WHERE amount > (
SELECT AVG(amount) FROM accounts AS acct
WHERE acct.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_06288 | train | T1 |
v1 | Schema:
regions (alias: rgn)(id, type, status, amount)
products(name, date, value, type)
Task: Select value from regions where status exists in products for the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_06289 | train | T2 |
v1 | Schema:
managers (alias: mgr)(name, date, code, salary)
staff(value, code, salary, id)
Task: Select amount from managers where code exists in staff for the same code.
SQL: | SELECT amount FROM managers AS mgr
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_06290 | train | T1 |
v1 | Schema:
regions (alias: rgn)(id, level, type, value)
orders(value, id, code, amount)
Task: Select value from regions where status exists in orders for the same level.
SQL: | SELECT value FROM regions AS rgn
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_06291 | train | T2 |
v3 | Schema:
requests (alias: ordr)(amount, name, code, level)
invoices(value, date, id, name)
Task: Find value from requests where amount exceeds the average amount from invoices for the same id.
SQL: | SELECT value FROM requests AS ordr
WHERE amount > (
SELECT SUM(amount) FROM invoices AS inv
WHERE inv.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_06292 | train | T2 |
v3 | Schema:
customers (alias: cust)(status, id, code, name)
warehouses(id, type, salary, level)
Task: Retrieve value from customers with amount above the MAX(amount) of warehouses rows sharing the same code.
SQL: | SELECT value FROM customers AS cust
WHERE amount > (
SELECT MAX(amount) FROM warehouses AS whs
WHERE whs.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "warehouses",
"outer_alias": "cust",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_06293 | train | T1 |
v2 | Schema:
shipments (alias: shp)(id, salary, status, level)
departments(level, name, type, status)
Task: Find value from shipments where a matching record exists in departments with the same status.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_06294 | train | T2 |
v2 | Schema:
services (alias: srvc)(name, amount, salary, code)
items(name, code, date, amount)
Task: Retrieve code from services that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT code FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "items",
"outer_alias": "srvc",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_06295 | train | T2 |
v3 | Schema:
customers (alias: cust)(type, id, value, amount)
warehouses(level, status, code, name)
Task: Retrieve code from customers with salary above the MAX(salary) of warehouses rows sharing the same level.
SQL: | SELECT code FROM customers AS cust
WHERE salary > (
SELECT MAX(salary) FROM warehouses AS whs
WHERE whs.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "warehouses",
"outer_alias": "cust",
"inner_alias": "whs",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_06296 | train | T1 |
v3 | Schema:
managers (alias: mgr)(level, date, value, name)
shipments(type, salary, value, name)
Task: Retrieve id from managers with amount above the AVG(value) of shipments rows sharing the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE amount > (
SELECT AVG(value) FROM shipments AS shp
WHERE shp.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_06297 | train | T1 |
v1 | Schema:
categories (alias: catg)(date, value, id, salary)
warehouses(id, status, date, amount)
Task: Find name from categories where type appears in warehouses entries with matching code.
SQL: | SELECT name FROM categories AS catg
WHERE type IN (
SELECT type FROM warehouses AS whs
WHERE whs.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "warehouses",
"outer_alias": "catg",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_06298 | train | T2 |
v1 | Schema:
regions (alias: rgn)(level, type, value, id)
warehouses(level, code, name, amount)
Task: Retrieve code from regions whose level is found in warehouses rows where status matches the outer record.
SQL: | SELECT code FROM regions AS rgn
WHERE level IN (
SELECT level FROM warehouses AS whs
WHERE whs.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "warehouses",
"outer_alias": "rgn",
"inner_alias": "whs",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_06299 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.