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:
warehouses (alias: whs)(date, type, amount, value)
staff(salary, amount, date, level)
Task: Find name from warehouses where a matching record exists in staff with the same code.
SQL: | SELECT name FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "staff",
"outer_alias": "whs",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_08200 | train | T2 |
v1 | Schema:
schedules (alias: schd)(amount, code, status, date)
regions(id, value, salary, type)
Task: Retrieve name from schedules whose id is found in regions rows where id matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_08201 | train | T2 |
v2 | Schema:
regions (alias: rgn)(name, code, value, id)
warehouses(type, name, value, level)
Task: Find id from regions where a matching record exists in warehouses with the same type.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "warehouses",
"outer_alias": "rgn",
"inner_alias": "whs",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_08202 | train | T2 |
v2 | Schema:
departments (alias: dept)(level, type, id, salary)
transactions(value, name, date, id)
Task: Find code from departments where a matching record exists in transactions with the same id.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_08203 | train | T1 |
v3 | Schema:
accounts (alias: acct)(value, level, salary, id)
employees(code, status, level, id)
Task: Retrieve amount from accounts with salary above the COUNT(amount) of employees rows sharing the same code.
SQL: | SELECT amount FROM accounts AS acct
WHERE salary > (
SELECT COUNT(amount) FROM employees AS emp
WHERE emp.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_08204 | train | T1 |
v3 | Schema:
shipments (alias: shp)(code, type, amount, status)
requests(date, salary, type, id)
Task: Retrieve name from shipments with amount above the MIN(amount) of requests rows sharing the same type.
SQL: | SELECT name FROM shipments AS shp
WHERE amount > (
SELECT MIN(amount) FROM requests AS ordr
WHERE ordr.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_08205 | train | T2 |
v2 | Schema:
shipments (alias: shp)(date, type, value, code)
sales(salary, date, level, status)
Task: Retrieve name from shipments that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_08206 | train | T2 |
v3 | Schema:
staff (alias: empl)(value, amount, name, type)
accounts(name, salary, date, status)
Task: Find value from staff where salary exceeds the average amount from accounts for the same type.
SQL: | SELECT value FROM staff AS empl
WHERE salary > (
SELECT MIN(amount) FROM accounts AS acct
WHERE acct.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_08207 | train | T2 |
v3 | Schema:
invoices (alias: inv)(code, amount, name, status)
items(date, salary, name, value)
Task: Find name from invoices where value exceeds the average amount from items for the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE value > (
SELECT MIN(amount) FROM items AS lne
WHERE lne.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_08208 | train | T1 |
v3 | Schema:
schedules (alias: schd)(date, salary, status, name)
budgets(level, value, status, date)
Task: Find value from schedules where amount exceeds the average amount from budgets for the same type.
SQL: | SELECT value FROM schedules AS schd
WHERE amount > (
SELECT MIN(amount) FROM budgets AS budg
WHERE budg.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "budgets",
"outer_alias": "schd",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_08209 | train | T2 |
v1 | Schema:
departments (alias: dept)(name, date, code, salary)
shipments(value, type, name, status)
Task: Find value from departments where code appears in shipments entries with matching id.
SQL: | SELECT value FROM departments AS dept
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_08210 | train | T1 |
v1 | Schema:
orders (alias: ord)(type, level, value, status)
managers(id, level, status, type)
Task: Select amount from orders where id exists in managers for the same id.
SQL: | SELECT amount FROM orders AS ord
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_08211 | train | T1 |
v2 | Schema:
products (alias: prod)(name, value, date, type)
services(name, level, type, value)
Task: Retrieve salary from products that have at least one corresponding entry in services sharing the same code.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.code = prod.code
); | {
"outer_table": "products",
"inner_table": "services",
"outer_alias": "prod",
"inner_alias": "srvc",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_08212 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(amount, status, date, level)
services(code, type, amount, value)
Task: Retrieve value from warehouses with amount above the MIN(salary) of services rows sharing the same id.
SQL: | SELECT value FROM warehouses AS whs
WHERE amount > (
SELECT MIN(salary) FROM services AS srvc
WHERE srvc.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "services",
"outer_alias": "whs",
"inner_alias": "srvc",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_08213 | train | T2 |
v1 | Schema:
transactions (alias: txn)(value, name, amount, level)
customers(code, date, amount, level)
Task: Select name from transactions where level exists in customers for the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_08214 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(status, id, name, value)
transactions(date, salary, type, status)
Task: Retrieve code from warehouses that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT code FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "transactions",
"outer_alias": "whs",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_08215 | train | T2 |
v1 | Schema:
staff (alias: empl)(type, status, level, value)
items(salary, amount, code, id)
Task: Retrieve value from staff whose status is found in items rows where status matches the outer record.
SQL: | SELECT value FROM staff AS empl
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_08216 | train | T2 |
v2 | Schema:
budgets (alias: budg)(amount, value, code, id)
transactions(type, level, code, salary)
Task: Retrieve salary from budgets that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT salary FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "transactions",
"outer_alias": "budg",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_08217 | train | T2 |
v1 | Schema:
products (alias: prod)(name, code, status, date)
staff(name, status, level, date)
Task: Select amount from products where id exists in staff for the same status.
SQL: | SELECT amount FROM products AS prod
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.status = prod.status
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_08218 | train | T1 |
v3 | Schema:
products (alias: prod)(value, type, name, date)
managers(id, date, amount, salary)
Task: Retrieve code from products with amount above the SUM(value) of managers rows sharing the same status.
SQL: | SELECT code FROM products AS prod
WHERE amount > (
SELECT SUM(value) FROM managers AS mgr
WHERE mgr.status = prod.status
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_08219 | train | T1 |
v2 | Schema:
orders (alias: ord)(type, name, status, id)
staff(level, value, id, status)
Task: Find value from orders where a matching record exists in staff with the same status.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_08220 | train | T1 |
v3 | Schema:
orders (alias: ord)(name, id, date, status)
requests(code, date, status, name)
Task: Find value from orders where amount exceeds the average amount from requests for the same code.
SQL: | SELECT value FROM orders AS ord
WHERE amount > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_08221 | train | T1 |
v1 | Schema:
requests (alias: ordr)(id, level, value, salary)
managers(date, value, type, level)
Task: Retrieve salary from requests whose status is found in managers rows where type matches the outer record.
SQL: | SELECT salary FROM requests AS ordr
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_08222 | train | T2 |
v1 | Schema:
managers (alias: mgr)(value, amount, date, salary)
customers(name, amount, code, level)
Task: Retrieve code from managers whose type is found in customers rows where type matches the outer record.
SQL: | SELECT code FROM managers AS mgr
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_08223 | train | T1 |
v1 | Schema:
orders (alias: ord)(type, name, level, amount)
products(date, code, level, id)
Task: Find name from orders where status appears in products entries with matching code.
SQL: | SELECT name FROM orders AS ord
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_08224 | train | T1 |
v3 | Schema:
employees (alias: emp)(status, id, value, salary)
customers(date, type, code, id)
Task: Retrieve salary from employees with salary above the AVG(amount) of customers rows sharing the same level.
SQL: | SELECT salary FROM employees AS emp
WHERE salary > (
SELECT AVG(amount) FROM customers AS cust
WHERE cust.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_08225 | train | T1 |
v3 | Schema:
shipments (alias: shp)(value, id, date, amount)
schedules(name, amount, level, salary)
Task: Retrieve salary from shipments with amount above the MAX(salary) of schedules rows sharing the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE amount > (
SELECT MAX(salary) FROM schedules AS schd
WHERE schd.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_08226 | train | T2 |
v3 | Schema:
categories (alias: catg)(amount, salary, value, id)
transactions(salary, level, amount, name)
Task: Retrieve salary from categories with amount above the COUNT(amount) of transactions rows sharing the same code.
SQL: | SELECT salary FROM categories AS catg
WHERE amount > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_08227 | train | T2 |
v1 | Schema:
staff (alias: empl)(id, value, amount, level)
budgets(id, code, salary, date)
Task: Find code from staff where code appears in budgets entries with matching status.
SQL: | SELECT code FROM staff AS empl
WHERE code IN (
SELECT code FROM budgets AS budg
WHERE budg.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "budgets",
"outer_alias": "empl",
"inner_alias": "budg",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_08228 | train | T2 |
v1 | Schema:
items (alias: lne)(value, code, level, amount)
transactions(id, salary, date, amount)
Task: Select id from items where status exists in transactions for the same id.
SQL: | SELECT id FROM items AS lne
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.id = lne.id
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_08229 | train | T2 |
v2 | Schema:
customers (alias: cust)(status, value, date, id)
requests(type, value, salary, status)
Task: Find code from customers where a matching record exists in requests with the same code.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_08230 | train | T1 |
v3 | Schema:
regions (alias: rgn)(status, value, date, name)
budgets(salary, code, id, value)
Task: Find name from regions where salary exceeds the average value from budgets for the same id.
SQL: | SELECT name FROM regions AS rgn
WHERE salary > (
SELECT MIN(value) FROM budgets AS budg
WHERE budg.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "budgets",
"outer_alias": "rgn",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_08231 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(name, amount, code, salary)
shipments(code, salary, value, type)
Task: Retrieve amount from warehouses that have at least one corresponding entry in shipments sharing the same status.
SQL: | SELECT amount FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "shipments",
"outer_alias": "whs",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_08232 | train | T2 |
v2 | Schema:
shipments (alias: shp)(code, id, status, amount)
managers(date, name, salary, level)
Task: Find salary from shipments where a matching record exists in managers with the same level.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_08233 | train | T2 |
v1 | Schema:
categories (alias: catg)(id, name, level, salary)
departments(status, type, code, date)
Task: Find amount from categories where status appears in departments entries with matching type.
SQL: | SELECT amount FROM categories AS catg
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_08234 | train | T2 |
v1 | Schema:
services (alias: srvc)(value, amount, status, name)
transactions(type, name, status, code)
Task: Retrieve value from services whose id is found in transactions rows where id matches the outer record.
SQL: | SELECT value FROM services AS srvc
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "transactions",
"outer_alias": "srvc",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_08235 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(value, name, level, status)
requests(code, amount, name, level)
Task: Retrieve value from warehouses whose type is found in requests rows where id matches the outer record.
SQL: | SELECT value FROM warehouses AS whs
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "requests",
"outer_alias": "whs",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_08236 | train | T2 |
v2 | Schema:
schedules (alias: schd)(status, value, salary, id)
sales(type, id, salary, code)
Task: Retrieve salary from schedules that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_08237 | train | T2 |
v1 | Schema:
requests (alias: ordr)(level, amount, code, name)
transactions(value, salary, type, name)
Task: Retrieve name from requests whose code is found in transactions rows where status matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_08238 | train | T2 |
v1 | Schema:
categories (alias: catg)(code, date, type, value)
transactions(code, type, date, level)
Task: Find name from categories where level appears in transactions entries with matching type.
SQL: | SELECT name FROM categories AS catg
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_08239 | train | T2 |
v1 | Schema:
orders (alias: ord)(date, name, code, salary)
budgets(level, code, date, status)
Task: Select name from orders where level exists in budgets for the same id.
SQL: | SELECT name FROM orders AS ord
WHERE level IN (
SELECT level FROM budgets AS budg
WHERE budg.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "budgets",
"outer_alias": "ord",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_08240 | train | T1 |
v3 | Schema:
invoices (alias: inv)(date, name, code, salary)
warehouses(id, level, date, name)
Task: Find name from invoices where amount exceeds the average salary from warehouses for the same code.
SQL: | SELECT name FROM invoices AS inv
WHERE amount > (
SELECT MAX(salary) FROM warehouses AS whs
WHERE whs.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "warehouses",
"outer_alias": "inv",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_08241 | train | T1 |
v2 | Schema:
departments (alias: dept)(id, date, type, code)
customers(id, name, salary, amount)
Task: Retrieve salary from departments that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_08242 | train | T1 |
v1 | Schema:
customers (alias: cust)(type, name, amount, id)
shipments(salary, name, id, code)
Task: Find name from customers where status appears in shipments entries with matching type.
SQL: | SELECT name FROM customers AS cust
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_08243 | train | T1 |
v3 | Schema:
services (alias: srvc)(id, status, type, date)
regions(code, id, amount, status)
Task: Find amount from services where value exceeds the average amount from regions for the same status.
SQL: | SELECT amount FROM services AS srvc
WHERE value > (
SELECT COUNT(amount) FROM regions AS rgn
WHERE rgn.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "regions",
"outer_alias": "srvc",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_08244 | train | T2 |
v3 | Schema:
schedules (alias: schd)(salary, type, status, name)
categories(level, type, code, name)
Task: Find id from schedules where amount exceeds the average value from categories for the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE amount > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_08245 | train | T2 |
v3 | Schema:
categories (alias: catg)(value, amount, name, date)
invoices(value, type, code, name)
Task: Find amount from categories where salary exceeds the average amount from invoices for the same level.
SQL: | SELECT amount FROM categories AS catg
WHERE salary > (
SELECT SUM(amount) FROM invoices AS inv
WHERE inv.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_08246 | train | T2 |
v1 | Schema:
departments (alias: dept)(level, salary, amount, status)
employees(name, value, date, type)
Task: Select id from departments where id exists in employees for the same level.
SQL: | SELECT id FROM departments AS dept
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_08247 | train | T1 |
v1 | Schema:
invoices (alias: inv)(date, name, amount, status)
requests(name, id, code, status)
Task: Retrieve amount from invoices whose level is found in requests rows where id matches the outer record.
SQL: | SELECT amount FROM invoices AS inv
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_08248 | train | T1 |
v2 | Schema:
categories (alias: catg)(code, salary, status, id)
services(level, id, amount, date)
Task: Find id from categories where a matching record exists in services with the same type.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "services",
"outer_alias": "catg",
"inner_alias": "srvc",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_08249 | train | T2 |
v1 | Schema:
products (alias: prod)(type, date, name, value)
departments(level, name, id, value)
Task: Retrieve value from products whose id is found in departments rows where code matches the outer record.
SQL: | SELECT value FROM products AS prod
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.code = prod.code
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_08250 | train | T1 |
v1 | Schema:
shipments (alias: shp)(level, id, name, value)
orders(status, level, id, type)
Task: Find value from shipments where id appears in orders entries with matching code.
SQL: | SELECT value FROM shipments AS shp
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_08251 | train | T2 |
v2 | Schema:
shipments (alias: shp)(value, date, salary, code)
staff(level, salary, code, type)
Task: Find value from shipments where a matching record exists in staff with the same status.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_08252 | train | T2 |
v3 | Schema:
budgets (alias: budg)(name, salary, code, type)
categories(id, name, code, type)
Task: Find name from budgets where salary exceeds the average value from categories for the same level.
SQL: | SELECT name FROM budgets AS budg
WHERE salary > (
SELECT MIN(value) FROM categories AS catg
WHERE catg.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "categories",
"outer_alias": "budg",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_08253 | train | T2 |
v1 | Schema:
products (alias: prod)(code, date, salary, level)
managers(code, id, name, salary)
Task: Retrieve id from products whose type is found in managers rows where level matches the outer record.
SQL: | SELECT id FROM products AS prod
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_08254 | train | T1 |
v2 | Schema:
shipments (alias: shp)(code, type, date, name)
accounts(name, code, salary, level)
Task: Retrieve salary from shipments that have at least one corresponding entry in accounts sharing the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_08255 | train | T2 |
v2 | Schema:
transactions (alias: txn)(amount, date, type, name)
warehouses(id, date, value, name)
Task: Retrieve amount from transactions that have at least one corresponding entry in warehouses sharing the same type.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "warehouses",
"outer_alias": "txn",
"inner_alias": "whs",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_08256 | train | T1 |
v1 | Schema:
staff (alias: empl)(value, level, code, amount)
budgets(name, id, amount, value)
Task: Select id from staff where status exists in budgets for the same id.
SQL: | SELECT id FROM staff AS empl
WHERE status IN (
SELECT status FROM budgets AS budg
WHERE budg.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "budgets",
"outer_alias": "empl",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_08257 | train | T2 |
v2 | Schema:
items (alias: lne)(level, type, salary, value)
regions(status, code, name, date)
Task: Find amount from items where a matching record exists in regions with the same code.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = lne.code
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_08258 | train | T2 |
v3 | Schema:
regions (alias: rgn)(date, id, status, value)
services(name, amount, value, id)
Task: Find code from regions where value exceeds the average value from services for the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE value > (
SELECT MIN(value) FROM services AS srvc
WHERE srvc.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "services",
"outer_alias": "rgn",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_08259 | train | T2 |
v1 | Schema:
schedules (alias: schd)(salary, type, name, level)
accounts(amount, value, level, code)
Task: Find id from schedules where code appears in accounts entries with matching type.
SQL: | SELECT id FROM schedules AS schd
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_08260 | train | T2 |
v2 | Schema:
accounts (alias: acct)(date, level, code, name)
staff(amount, code, id, level)
Task: Find code from accounts where a matching record exists in staff with the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_08261 | train | T1 |
v1 | Schema:
managers (alias: mgr)(status, value, name, salary)
warehouses(code, salary, amount, name)
Task: Find name from managers where id appears in warehouses entries with matching status.
SQL: | SELECT name FROM managers AS mgr
WHERE id IN (
SELECT id FROM warehouses AS whs
WHERE whs.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "warehouses",
"outer_alias": "mgr",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_08262 | train | T1 |
v2 | Schema:
requests (alias: ordr)(level, value, date, name)
customers(status, type, code, salary)
Task: Find value from requests where a matching record exists in customers with the same id.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_08263 | train | T2 |
v1 | Schema:
transactions (alias: txn)(code, name, date, level)
employees(status, level, code, value)
Task: Find name from transactions where code appears in employees entries with matching status.
SQL: | SELECT name FROM transactions AS txn
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_08264 | train | T1 |
v1 | Schema:
requests (alias: ordr)(value, amount, level, name)
schedules(date, code, level, status)
Task: Select value from requests where id exists in schedules for the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_08265 | train | T2 |
v2 | Schema:
orders (alias: ord)(type, date, salary, value)
transactions(code, amount, value, id)
Task: Retrieve name from orders that have at least one corresponding entry in transactions sharing the same type.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_08266 | train | T1 |
v2 | Schema:
schedules (alias: schd)(value, status, code, name)
invoices(status, id, name, code)
Task: Find salary from schedules where a matching record exists in invoices with the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_08267 | train | T2 |
v3 | Schema:
employees (alias: emp)(salary, status, id, level)
accounts(id, value, status, salary)
Task: Retrieve id from employees with value above the COUNT(salary) of accounts rows sharing the same type.
SQL: | SELECT id FROM employees AS emp
WHERE value > (
SELECT COUNT(salary) FROM accounts AS acct
WHERE acct.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_08268 | train | T1 |
v2 | Schema:
transactions (alias: txn)(level, date, type, id)
shipments(value, level, id, amount)
Task: Retrieve salary from transactions that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_08269 | train | T1 |
v3 | Schema:
categories (alias: catg)(level, date, value, type)
invoices(id, type, value, name)
Task: Retrieve amount from categories with value above the MAX(amount) of invoices rows sharing the same level.
SQL: | SELECT amount FROM categories AS catg
WHERE value > (
SELECT MAX(amount) FROM invoices AS inv
WHERE inv.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_08270 | train | T2 |
v1 | Schema:
items (alias: lne)(name, status, amount, value)
staff(level, name, type, status)
Task: Retrieve id from items whose code is found in staff rows where status matches the outer record.
SQL: | SELECT id FROM items AS lne
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.status = lne.status
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_08271 | train | T2 |
v3 | Schema:
items (alias: lne)(salary, type, code, value)
sales(code, level, name, amount)
Task: Find id from items where value exceeds the average amount from sales for the same level.
SQL: | SELECT id FROM items AS lne
WHERE value > (
SELECT COUNT(amount) FROM sales AS sale
WHERE sale.level = lne.level
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_08272 | train | T2 |
v2 | Schema:
transactions (alias: txn)(id, level, date, amount)
departments(id, status, salary, type)
Task: Find salary from transactions where a matching record exists in departments with the same level.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_08273 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(id, status, value, amount)
regions(amount, date, level, status)
Task: Retrieve id from warehouses with value above the MAX(salary) of regions rows sharing the same status.
SQL: | SELECT id FROM warehouses AS whs
WHERE value > (
SELECT MAX(salary) FROM regions AS rgn
WHERE rgn.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "regions",
"outer_alias": "whs",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_08274 | train | T2 |
v1 | Schema:
employees (alias: emp)(type, amount, value, level)
budgets(type, level, status, id)
Task: Retrieve value from employees whose code is found in budgets rows where code matches the outer record.
SQL: | SELECT value FROM employees AS emp
WHERE code IN (
SELECT code FROM budgets AS budg
WHERE budg.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "budgets",
"outer_alias": "emp",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_08275 | train | T1 |
v3 | Schema:
sales (alias: sale)(level, code, name, status)
orders(date, status, name, salary)
Task: Retrieve value from sales with salary above the MIN(salary) of orders rows sharing the same code.
SQL: | SELECT value FROM sales AS sale
WHERE salary > (
SELECT MIN(salary) FROM orders AS ord
WHERE ord.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_08276 | train | T1 |
v2 | Schema:
schedules (alias: schd)(status, date, type, salary)
accounts(amount, salary, status, value)
Task: Retrieve code from schedules that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_08277 | train | T2 |
v1 | Schema:
orders (alias: ord)(status, id, type, salary)
regions(status, code, id, salary)
Task: Retrieve salary from orders whose code is found in regions rows where level matches the outer record.
SQL: | SELECT salary FROM orders AS ord
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_08278 | train | T1 |
v2 | Schema:
items (alias: lne)(amount, date, id, value)
services(code, salary, type, level)
Task: Retrieve id from items that have at least one corresponding entry in services sharing the same level.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.level = lne.level
); | {
"outer_table": "items",
"inner_table": "services",
"outer_alias": "lne",
"inner_alias": "srvc",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_08279 | train | T2 |
v1 | Schema:
requests (alias: ordr)(id, salary, code, date)
regions(id, amount, code, type)
Task: Find id from requests where status appears in regions entries with matching type.
SQL: | SELECT id FROM requests AS ordr
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_08280 | train | T2 |
v2 | Schema:
invoices (alias: inv)(level, id, date, status)
shipments(code, name, salary, status)
Task: Retrieve id from invoices that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_08281 | train | T1 |
v2 | Schema:
transactions (alias: txn)(code, id, date, name)
sales(value, id, code, date)
Task: Find name from transactions where a matching record exists in sales with the same type.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_08282 | train | T1 |
v1 | Schema:
schedules (alias: schd)(date, code, level, amount)
sales(code, type, salary, name)
Task: Retrieve amount from schedules whose type is found in sales rows where type matches the outer record.
SQL: | SELECT amount FROM schedules AS schd
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_08283 | train | T2 |
v1 | Schema:
accounts (alias: acct)(value, salary, status, date)
invoices(name, salary, id, level)
Task: Find name from accounts where code appears in invoices entries with matching type.
SQL: | SELECT name FROM accounts AS acct
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_08284 | train | T1 |
v3 | Schema:
departments (alias: dept)(amount, salary, value, code)
categories(amount, id, code, salary)
Task: Find name from departments where salary exceeds the average salary from categories for the same id.
SQL: | SELECT name FROM departments AS dept
WHERE salary > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_08285 | train | T1 |
v1 | Schema:
departments (alias: dept)(level, code, id, amount)
budgets(amount, id, name, date)
Task: Find value from departments where code appears in budgets entries with matching type.
SQL: | SELECT value FROM departments AS dept
WHERE code IN (
SELECT code FROM budgets AS budg
WHERE budg.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "budgets",
"outer_alias": "dept",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_08286 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(name, status, code, value)
products(salary, status, value, date)
Task: Find amount from warehouses where level appears in products entries with matching id.
SQL: | SELECT amount FROM warehouses AS whs
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "products",
"outer_alias": "whs",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_08287 | train | T2 |
v1 | Schema:
products (alias: prod)(level, id, name, type)
invoices(status, date, code, id)
Task: Retrieve salary from products whose level is found in invoices rows where code matches the outer record.
SQL: | SELECT salary FROM products AS prod
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.code = prod.code
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_08288 | train | T1 |
v2 | Schema:
products (alias: prod)(salary, status, type, value)
departments(status, date, name, id)
Task: Find code from products where a matching record exists in departments with the same code.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = prod.code
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_08289 | train | T1 |
v1 | Schema:
sales (alias: sale)(code, amount, type, name)
regions(salary, name, type, value)
Task: Select value from sales where type exists in regions for the same level.
SQL: | SELECT value FROM sales AS sale
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_08290 | train | T1 |
v3 | Schema:
transactions (alias: txn)(date, salary, status, value)
accounts(status, name, salary, level)
Task: Find salary from transactions where salary exceeds the average salary from accounts for the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE salary > (
SELECT SUM(salary) FROM accounts AS acct
WHERE acct.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_08291 | train | T1 |
v2 | Schema:
invoices (alias: inv)(id, salary, code, status)
transactions(status, salary, code, name)
Task: Find salary from invoices where a matching record exists in transactions with the same level.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_08292 | train | T1 |
v2 | Schema:
schedules (alias: schd)(type, date, code, level)
employees(salary, name, date, type)
Task: Find name from schedules where a matching record exists in employees with the same type.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_08293 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(date, amount, level, type)
schedules(id, status, date, name)
Task: Find value from warehouses where salary exceeds the average amount from schedules for the same type.
SQL: | SELECT value FROM warehouses AS whs
WHERE salary > (
SELECT MIN(amount) 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": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_08294 | train | T2 |
v2 | Schema:
orders (alias: ord)(amount, type, value, salary)
staff(salary, id, name, amount)
Task: Retrieve amount from orders that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_08295 | train | T1 |
v1 | Schema:
services (alias: srvc)(salary, code, level, id)
categories(id, value, salary, level)
Task: Select name from services where code exists in categories for the same type.
SQL: | SELECT name FROM services AS srvc
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "categories",
"outer_alias": "srvc",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_08296 | train | T2 |
v3 | Schema:
employees (alias: emp)(value, type, salary, date)
transactions(status, value, type, salary)
Task: Retrieve salary from employees with value above the COUNT(amount) of transactions rows sharing the same id.
SQL: | SELECT salary FROM employees AS emp
WHERE value > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_08297 | train | T1 |
v1 | Schema:
categories (alias: catg)(date, salary, type, id)
employees(amount, name, date, status)
Task: Select code from categories where status exists in employees for the same id.
SQL: | SELECT code FROM categories AS catg
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_08298 | train | T2 |
v1 | Schema:
sales (alias: sale)(code, salary, type, date)
regions(code, date, type, id)
Task: Find amount from sales where level appears in regions entries with matching status.
SQL: | SELECT amount FROM sales AS sale
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_08299 | train | T1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.