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 |
|---|---|---|---|---|---|---|
v1 | Schema:
transactions (alias: txn)(type, level, id, amount)
requests(amount, salary, code, value)
Task: Retrieve salary from transactions whose status is found in requests rows where status matches the outer record.
SQL: | SELECT salary FROM transactions AS txn
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_05300 | train | T1 |
v1 | Schema:
customers (alias: cust)(value, id, type, date)
managers(amount, type, id, salary)
Task: Select salary from customers where id exists in managers for the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_05301 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(salary, date, value, name)
departments(amount, value, status, date)
Task: Retrieve value from warehouses that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT value FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "departments",
"outer_alias": "whs",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_05302 | train | T2 |
v1 | Schema:
orders (alias: ord)(amount, status, code, value)
accounts(date, salary, id, value)
Task: Retrieve id from orders whose id is found in accounts rows where level matches the outer record.
SQL: | SELECT id FROM orders AS ord
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_05303 | train | T1 |
v2 | Schema:
products (alias: prod)(date, status, amount, type)
customers(id, name, type, date)
Task: Retrieve id from products that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = prod.level
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_05304 | train | T1 |
v1 | Schema:
customers (alias: cust)(type, level, value, code)
items(type, level, value, date)
Task: Retrieve salary from customers whose type is found in items rows where type matches the outer record.
SQL: | SELECT salary FROM customers AS cust
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_05305 | train | T1 |
v2 | Schema:
services (alias: srvc)(amount, level, date, code)
orders(id, value, status, code)
Task: Retrieve value from services that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT value FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "orders",
"outer_alias": "srvc",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_05306 | train | T2 |
v2 | Schema:
requests (alias: ordr)(id, date, code, value)
categories(name, value, status, salary)
Task: Retrieve amount from requests that have at least one corresponding entry in categories sharing the same level.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_05307 | train | T2 |
v1 | Schema:
sales (alias: sale)(salary, status, id, type)
items(value, amount, name, id)
Task: Retrieve name from sales whose status is found in items rows where id matches the outer record.
SQL: | SELECT name FROM sales AS sale
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_05308 | train | T1 |
v2 | Schema:
requests (alias: ordr)(level, value, code, type)
items(salary, status, value, id)
Task: Retrieve code from requests that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_05309 | train | T2 |
v1 | Schema:
departments (alias: dept)(id, type, level, value)
orders(date, status, level, amount)
Task: Find id from departments where status appears in orders entries with matching code.
SQL: | SELECT id FROM departments AS dept
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_05310 | train | T1 |
v1 | Schema:
regions (alias: rgn)(salary, date, type, amount)
employees(salary, date, id, status)
Task: Select value from regions where code exists in employees for the same type.
SQL: | SELECT value FROM regions AS rgn
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_05311 | train | T2 |
v2 | Schema:
departments (alias: dept)(salary, amount, name, level)
items(id, amount, level, value)
Task: Retrieve code from departments that have at least one corresponding entry in items sharing the same code.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_05312 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(amount, name, code, level)
transactions(type, value, amount, date)
Task: Select id from warehouses where status exists in transactions for the same level.
SQL: | SELECT id FROM warehouses AS whs
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "transactions",
"outer_alias": "whs",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_05313 | train | T2 |
v2 | Schema:
products (alias: prod)(code, salary, date, type)
accounts(salary, name, date, value)
Task: Retrieve name from products that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = prod.status
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_05314 | train | T1 |
v2 | Schema:
shipments (alias: shp)(status, salary, value, date)
invoices(level, id, type, value)
Task: Find value from shipments where a matching record exists in invoices with the same type.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_05315 | train | T2 |
v1 | Schema:
departments (alias: dept)(salary, code, date, type)
managers(salary, code, date, status)
Task: Retrieve name from departments whose code is found in managers rows where level matches the outer record.
SQL: | SELECT name FROM departments AS dept
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_05316 | train | T1 |
v2 | Schema:
managers (alias: mgr)(date, amount, type, value)
customers(name, id, amount, code)
Task: Retrieve value from managers that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_05317 | train | T1 |
v2 | Schema:
employees (alias: emp)(date, id, amount, salary)
requests(date, type, name, code)
Task: Retrieve code from employees that have at least one corresponding entry in requests sharing the same id.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_05318 | train | T1 |
v3 | Schema:
requests (alias: ordr)(date, type, amount, value)
employees(level, amount, name, salary)
Task: Find amount from requests where amount exceeds the average value from employees for the same code.
SQL: | SELECT amount FROM requests AS ordr
WHERE amount > (
SELECT COUNT(value) FROM employees AS emp
WHERE emp.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_05319 | train | T2 |
v1 | Schema:
customers (alias: cust)(code, id, type, salary)
categories(level, amount, status, value)
Task: Find id from customers where type appears in categories entries with matching type.
SQL: | SELECT id FROM customers AS cust
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_05320 | train | T1 |
v2 | Schema:
invoices (alias: inv)(name, date, level, salary)
sales(salary, amount, value, code)
Task: Find value from invoices where a matching record exists in sales with the same level.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_05321 | train | T1 |
v1 | Schema:
staff (alias: empl)(amount, id, code, date)
budgets(status, date, code, name)
Task: Retrieve salary from staff whose status is found in budgets rows where type matches the outer record.
SQL: | SELECT salary FROM staff AS empl
WHERE status IN (
SELECT status FROM budgets AS budg
WHERE budg.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "budgets",
"outer_alias": "empl",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_05322 | train | T2 |
v2 | Schema:
employees (alias: emp)(id, date, type, salary)
managers(level, id, status, date)
Task: Retrieve id from employees that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_05323 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(type, date, status, value)
sales(amount, value, id, name)
Task: Find name from warehouses where a matching record exists in sales with the same level.
SQL: | SELECT name FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "sales",
"outer_alias": "whs",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_05324 | train | T2 |
v1 | Schema:
departments (alias: dept)(code, value, amount, type)
sales(date, status, type, name)
Task: Retrieve name from departments whose id is found in sales rows where level matches the outer record.
SQL: | SELECT name FROM departments AS dept
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_05325 | train | T1 |
v1 | Schema:
departments (alias: dept)(name, id, salary, status)
budgets(amount, name, type, date)
Task: Retrieve salary from departments whose status is found in budgets rows where type matches the outer record.
SQL: | SELECT salary FROM departments AS dept
WHERE status IN (
SELECT status FROM budgets AS budg
WHERE budg.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "budgets",
"outer_alias": "dept",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_05326 | train | T1 |
v1 | Schema:
items (alias: lne)(type, date, code, id)
customers(name, type, date, amount)
Task: Find value from items where code appears in customers entries with matching level.
SQL: | SELECT value FROM items AS lne
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.level = lne.level
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_05327 | train | T2 |
v3 | Schema:
departments (alias: dept)(amount, date, id, name)
employees(salary, date, amount, status)
Task: Retrieve amount from departments with value above the SUM(salary) of employees rows sharing the same level.
SQL: | SELECT amount FROM departments AS dept
WHERE value > (
SELECT SUM(salary) FROM employees AS emp
WHERE emp.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_05328 | train | T1 |
v2 | Schema:
accounts (alias: acct)(amount, value, salary, id)
sales(value, salary, date, type)
Task: Retrieve salary from accounts that have at least one corresponding entry in sales sharing the same status.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_05329 | train | T1 |
v3 | Schema:
staff (alias: empl)(amount, salary, id, code)
customers(type, value, code, id)
Task: Retrieve amount from staff with salary above the SUM(amount) of customers rows sharing the same status.
SQL: | SELECT amount FROM staff AS empl
WHERE salary > (
SELECT SUM(amount) FROM customers AS cust
WHERE cust.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_05330 | train | T2 |
v1 | Schema:
orders (alias: ord)(value, name, salary, id)
schedules(amount, salary, code, date)
Task: Retrieve salary from orders whose id is found in schedules rows where status matches the outer record.
SQL: | SELECT salary FROM orders AS ord
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_05331 | train | T1 |
v2 | Schema:
services (alias: srvc)(name, salary, status, amount)
items(amount, name, value, date)
Task: Find value from services where a matching record exists in items with the same id.
SQL: | SELECT value 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": "value",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_05332 | train | T2 |
v1 | Schema:
accounts (alias: acct)(level, name, value, code)
transactions(value, code, date, name)
Task: Find name from accounts where type appears in transactions entries with matching code.
SQL: | SELECT name FROM accounts AS acct
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_05333 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(code, status, value, level)
products(salary, date, level, amount)
Task: Retrieve salary from warehouses that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT salary FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "products",
"outer_alias": "whs",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_05334 | train | T2 |
v2 | Schema:
products (alias: prod)(salary, code, id, value)
schedules(value, name, date, id)
Task: Retrieve salary from products that have at least one corresponding entry in schedules sharing the same type.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = prod.type
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_05335 | train | T1 |
v2 | Schema:
services (alias: srvc)(status, name, type, salary)
regions(name, date, status, salary)
Task: Retrieve name from services that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT name FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "regions",
"outer_alias": "srvc",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_05336 | train | T2 |
v2 | Schema:
managers (alias: mgr)(date, salary, amount, status)
sales(code, status, amount, date)
Task: Find salary from managers where a matching record exists in sales with the same id.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_05337 | train | T1 |
v1 | Schema:
items (alias: lne)(date, level, amount, status)
sales(id, type, amount, date)
Task: Find id from items where code appears in sales entries with matching level.
SQL: | SELECT id FROM items AS lne
WHERE code IN (
SELECT code 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": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_05338 | train | T2 |
v1 | Schema:
requests (alias: ordr)(status, date, salary, value)
warehouses(amount, code, date, name)
Task: Select name from requests where type exists in warehouses for the same level.
SQL: | SELECT name FROM requests AS ordr
WHERE type IN (
SELECT type FROM warehouses AS whs
WHERE whs.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "warehouses",
"outer_alias": "ordr",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_05339 | train | T2 |
v1 | Schema:
sales (alias: sale)(id, salary, status, type)
products(level, type, salary, id)
Task: Retrieve amount from sales whose code is found in products rows where type matches the outer record.
SQL: | SELECT amount FROM sales AS sale
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_05340 | train | T1 |
v3 | Schema:
accounts (alias: acct)(amount, status, salary, type)
requests(date, status, name, value)
Task: Find value from accounts where value exceeds the average salary from requests for the same type.
SQL: | SELECT value FROM accounts AS acct
WHERE value > (
SELECT COUNT(salary) FROM requests AS ordr
WHERE ordr.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_05341 | train | T1 |
v3 | Schema:
services (alias: srvc)(amount, name, type, status)
staff(code, id, value, name)
Task: Find code from services where amount exceeds the average salary from staff for the same status.
SQL: | SELECT code FROM services AS srvc
WHERE amount > (
SELECT MAX(salary) FROM staff AS empl
WHERE empl.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "staff",
"outer_alias": "srvc",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_05342 | train | T2 |
v1 | Schema:
shipments (alias: shp)(type, status, date, salary)
warehouses(salary, name, level, id)
Task: Find value from shipments where level appears in warehouses entries with matching id.
SQL: | SELECT value FROM shipments AS shp
WHERE level IN (
SELECT level FROM warehouses AS whs
WHERE whs.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "warehouses",
"outer_alias": "shp",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_05343 | train | T2 |
v3 | Schema:
employees (alias: emp)(salary, value, status, date)
items(code, amount, level, name)
Task: Find name from employees where amount exceeds the average amount from items for the same code.
SQL: | SELECT name FROM employees AS emp
WHERE amount > (
SELECT COUNT(amount) FROM items AS lne
WHERE lne.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_05344 | train | T1 |
v3 | Schema:
transactions (alias: txn)(status, amount, type, level)
shipments(amount, type, name, code)
Task: Find salary from transactions where salary exceeds the average value from shipments for the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE salary > (
SELECT MIN(value) FROM shipments AS shp
WHERE shp.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_05345 | train | T1 |
v2 | Schema:
shipments (alias: shp)(name, level, value, amount)
staff(name, type, value, level)
Task: Retrieve name from shipments that have at least one corresponding entry in staff sharing the same type.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_05346 | train | T2 |
v1 | Schema:
managers (alias: mgr)(name, type, level, date)
warehouses(date, code, value, type)
Task: Find id from managers where status appears in warehouses entries with matching type.
SQL: | SELECT id FROM managers AS mgr
WHERE status IN (
SELECT status FROM warehouses AS whs
WHERE whs.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "warehouses",
"outer_alias": "mgr",
"inner_alias": "whs",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_05347 | train | T1 |
v2 | Schema:
products (alias: prod)(salary, code, date, id)
accounts(value, id, level, type)
Task: Retrieve salary from products that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = prod.id
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_05348 | train | T1 |
v3 | Schema:
managers (alias: mgr)(type, name, amount, level)
regions(type, value, amount, name)
Task: Retrieve value from managers with amount above the COUNT(value) of regions rows sharing the same level.
SQL: | SELECT value FROM managers AS mgr
WHERE amount > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_05349 | train | T1 |
v1 | Schema:
employees (alias: emp)(type, status, date, name)
categories(name, level, date, amount)
Task: Find id from employees where type appears in categories entries with matching type.
SQL: | SELECT id FROM employees AS emp
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_05350 | train | T1 |
v3 | Schema:
shipments (alias: shp)(id, value, status, level)
categories(value, id, code, salary)
Task: Find code from shipments where amount exceeds the average salary from categories for the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE amount > (
SELECT SUM(salary) FROM categories AS catg
WHERE catg.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_05351 | train | T2 |
v1 | Schema:
regions (alias: rgn)(code, name, type, amount)
categories(level, code, name, date)
Task: Retrieve id from regions whose type is found in categories rows where type matches the outer record.
SQL: | SELECT id FROM regions AS rgn
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_05352 | train | T2 |
v3 | Schema:
shipments (alias: shp)(type, date, salary, status)
orders(code, salary, value, status)
Task: Retrieve value from shipments with amount above the MIN(value) of orders rows sharing the same code.
SQL: | SELECT value FROM shipments AS shp
WHERE amount > (
SELECT MIN(value) 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": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_05353 | train | T2 |
v2 | Schema:
transactions (alias: txn)(name, code, type, date)
employees(date, value, id, level)
Task: Find salary from transactions where a matching record exists in employees with the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_05354 | train | T1 |
v3 | Schema:
requests (alias: ordr)(name, code, level, status)
regions(level, value, amount, status)
Task: Retrieve name from requests with salary above the AVG(salary) of regions rows sharing the same level.
SQL: | SELECT name FROM requests AS ordr
WHERE salary > (
SELECT AVG(salary) FROM regions AS rgn
WHERE rgn.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_05355 | train | T2 |
v3 | Schema:
invoices (alias: inv)(name, amount, type, code)
warehouses(name, amount, level, id)
Task: Retrieve amount from invoices with amount above the MIN(value) of warehouses rows sharing the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE amount > (
SELECT MIN(value) FROM warehouses AS whs
WHERE whs.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "warehouses",
"outer_alias": "inv",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_05356 | train | T1 |
v3 | Schema:
requests (alias: ordr)(level, name, value, code)
staff(date, level, status, value)
Task: Retrieve value from requests with value above the AVG(value) of staff rows sharing the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE value > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_05357 | train | T2 |
v2 | Schema:
categories (alias: catg)(salary, level, amount, code)
items(code, value, id, salary)
Task: Retrieve salary from categories that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_05358 | train | T2 |
v3 | Schema:
sales (alias: sale)(value, id, level, type)
invoices(id, level, status, salary)
Task: Retrieve id from sales with value above the AVG(salary) of invoices rows sharing the same level.
SQL: | SELECT id FROM sales AS sale
WHERE value > (
SELECT AVG(salary) FROM invoices AS inv
WHERE inv.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_05359 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(code, value, salary, amount)
transactions(code, name, salary, amount)
Task: Find id from warehouses where a matching record exists in transactions with the same id.
SQL: | SELECT id FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "transactions",
"outer_alias": "whs",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_05360 | train | T2 |
v3 | Schema:
requests (alias: ordr)(salary, name, level, status)
accounts(name, type, code, value)
Task: Find value from requests where salary exceeds the average salary from accounts for the same level.
SQL: | SELECT value FROM requests AS ordr
WHERE salary > (
SELECT SUM(salary) FROM accounts AS acct
WHERE acct.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_05361 | train | T2 |
v2 | Schema:
budgets (alias: budg)(name, date, type, code)
customers(amount, code, level, type)
Task: Find name from budgets where a matching record exists in customers with the same type.
SQL: | SELECT name FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "customers",
"outer_alias": "budg",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_05362 | train | T2 |
v2 | Schema:
customers (alias: cust)(name, status, code, type)
departments(level, id, value, amount)
Task: Find amount from customers where a matching record exists in departments with the same type.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_05363 | train | T1 |
v1 | Schema:
accounts (alias: acct)(date, amount, value, code)
managers(name, type, amount, level)
Task: Find code from accounts where id appears in managers entries with matching type.
SQL: | SELECT code FROM accounts AS acct
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_05364 | train | T1 |
v2 | Schema:
items (alias: lne)(value, code, id, status)
warehouses(value, name, date, amount)
Task: Retrieve code from items that have at least one corresponding entry in warehouses sharing the same id.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.id = lne.id
); | {
"outer_table": "items",
"inner_table": "warehouses",
"outer_alias": "lne",
"inner_alias": "whs",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_05365 | train | T2 |
v3 | Schema:
invoices (alias: inv)(code, status, value, id)
customers(amount, type, value, level)
Task: Retrieve salary from invoices with amount above the MIN(value) of customers rows sharing the same status.
SQL: | SELECT salary FROM invoices AS inv
WHERE amount > (
SELECT MIN(value) FROM customers AS cust
WHERE cust.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_05366 | train | T1 |
v2 | Schema:
customers (alias: cust)(amount, id, type, name)
employees(level, type, code, date)
Task: Find salary from customers where a matching record exists in employees with the same id.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_05367 | train | T1 |
v2 | Schema:
services (alias: srvc)(salary, id, code, name)
shipments(value, salary, type, status)
Task: Retrieve amount from services that have at least one corresponding entry in shipments sharing the same level.
SQL: | SELECT amount FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "shipments",
"outer_alias": "srvc",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_05368 | train | T2 |
v3 | Schema:
orders (alias: ord)(level, id, code, value)
shipments(value, code, salary, id)
Task: Find id from orders where amount exceeds the average salary from shipments for the same id.
SQL: | SELECT id FROM orders AS ord
WHERE amount > (
SELECT MIN(salary) FROM shipments AS shp
WHERE shp.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_05369 | train | T1 |
v2 | Schema:
employees (alias: emp)(type, level, value, date)
budgets(type, value, id, date)
Task: Retrieve amount from employees that have at least one corresponding entry in budgets sharing the same id.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "budgets",
"outer_alias": "emp",
"inner_alias": "budg",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_05370 | train | T1 |
v1 | Schema:
items (alias: lne)(amount, value, level, type)
categories(id, code, salary, status)
Task: Find value from items where id appears in categories entries with matching level.
SQL: | SELECT value FROM items AS lne
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.level = lne.level
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_05371 | train | T2 |
v3 | Schema:
budgets (alias: budg)(date, salary, value, level)
staff(salary, code, level, name)
Task: Retrieve salary from budgets with value above the MAX(salary) of staff rows sharing the same id.
SQL: | SELECT salary FROM budgets AS budg
WHERE value > (
SELECT MAX(salary) FROM staff AS empl
WHERE empl.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "staff",
"outer_alias": "budg",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_05372 | train | T2 |
v1 | Schema:
items (alias: lne)(type, level, date, name)
staff(salary, id, type, amount)
Task: Select code from items where code exists in staff for the same code.
SQL: | SELECT code FROM items AS lne
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.code = lne.code
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_05373 | train | T2 |
v1 | Schema:
services (alias: srvc)(code, type, status, value)
schedules(type, code, id, name)
Task: Retrieve salary from services whose type is found in schedules rows where status matches the outer record.
SQL: | SELECT salary FROM services AS srvc
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "schedules",
"outer_alias": "srvc",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_05374 | train | T2 |
v3 | Schema:
items (alias: lne)(name, amount, type, value)
schedules(name, amount, salary, code)
Task: Retrieve salary from items with salary above the MIN(value) of schedules rows sharing the same type.
SQL: | SELECT salary FROM items AS lne
WHERE salary > (
SELECT MIN(value) FROM schedules AS schd
WHERE schd.type = lne.type
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_05375 | train | T2 |
v3 | Schema:
departments (alias: dept)(id, salary, date, code)
transactions(name, value, level, date)
Task: Find salary from departments where salary exceeds the average amount from transactions for the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE salary > (
SELECT MIN(amount) FROM transactions AS txn
WHERE txn.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_05376 | train | T1 |
v1 | Schema:
budgets (alias: budg)(name, id, status, type)
invoices(level, type, code, value)
Task: Select value from budgets where level exists in invoices for the same level.
SQL: | SELECT value FROM budgets AS budg
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "invoices",
"outer_alias": "budg",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_05377 | train | T2 |
v2 | Schema:
managers (alias: mgr)(date, status, name, type)
departments(date, value, code, name)
Task: Retrieve amount from managers that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_05378 | train | T1 |
v2 | Schema:
accounts (alias: acct)(type, salary, value, name)
staff(status, value, salary, code)
Task: Find name from accounts where a matching record exists in staff with the same type.
SQL: | SELECT name 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": "name",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_05379 | train | T1 |
v2 | Schema:
accounts (alias: acct)(level, value, status, amount)
customers(status, date, level, salary)
Task: Find salary from accounts where a matching record exists in customers with the same status.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_05380 | train | T1 |
v2 | Schema:
employees (alias: emp)(date, code, salary, type)
shipments(type, salary, code, status)
Task: Find amount from employees where a matching record exists in shipments with the same type.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_05381 | train | T1 |
v2 | Schema:
transactions (alias: txn)(level, name, salary, type)
invoices(status, amount, value, id)
Task: Find value from transactions where a matching record exists in invoices with the same id.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_05382 | train | T1 |
v2 | Schema:
budgets (alias: budg)(salary, level, date, name)
shipments(type, name, salary, status)
Task: Find id from budgets where a matching record exists in shipments with the same code.
SQL: | SELECT id FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "shipments",
"outer_alias": "budg",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_05383 | train | T2 |
v2 | Schema:
invoices (alias: inv)(type, amount, salary, value)
orders(type, date, code, value)
Task: Find code from invoices where a matching record exists in orders with the same code.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_05384 | train | T1 |
v2 | Schema:
items (alias: lne)(salary, date, amount, status)
departments(code, value, id, type)
Task: Retrieve id from items that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = lne.status
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_05385 | train | T2 |
v1 | Schema:
transactions (alias: txn)(type, status, id, value)
accounts(level, date, status, code)
Task: Select name from transactions where level exists in accounts for the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_05386 | train | T1 |
v3 | Schema:
managers (alias: mgr)(status, id, amount, code)
services(salary, type, status, code)
Task: Find name from managers where salary exceeds the average salary from services for the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE salary > (
SELECT MAX(salary) FROM services AS srvc
WHERE srvc.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "services",
"outer_alias": "mgr",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_05387 | train | T1 |
v3 | Schema:
sales (alias: sale)(level, value, code, amount)
invoices(code, date, salary, level)
Task: Find salary from sales where salary exceeds the average value from invoices for the same code.
SQL: | SELECT salary FROM sales AS sale
WHERE salary > (
SELECT SUM(value) FROM invoices AS inv
WHERE inv.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_05388 | train | T1 |
v2 | Schema:
sales (alias: sale)(date, type, id, level)
managers(amount, date, code, type)
Task: Find name from sales where a matching record exists in managers with the same code.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_05389 | train | T1 |
v2 | Schema:
schedules (alias: schd)(level, value, status, id)
shipments(level, date, salary, name)
Task: Find name from schedules where a matching record exists in shipments with the same level.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_05390 | train | T2 |
v2 | Schema:
products (alias: prod)(code, amount, date, id)
orders(type, level, value, amount)
Task: Retrieve id from products that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = prod.code
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_05391 | train | T1 |
v1 | Schema:
shipments (alias: shp)(status, amount, code, id)
requests(value, id, type, date)
Task: Retrieve value from shipments whose id is found in requests rows where status matches the outer record.
SQL: | SELECT value FROM shipments AS shp
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_05392 | train | T2 |
v2 | Schema:
categories (alias: catg)(name, value, date, type)
shipments(value, salary, type, status)
Task: Retrieve salary from categories that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_05393 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(value, date, salary, status)
customers(date, name, id, status)
Task: Find value from warehouses where amount exceeds the average salary from customers for the same status.
SQL: | SELECT value FROM warehouses AS whs
WHERE amount > (
SELECT SUM(salary) FROM customers AS cust
WHERE cust.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "customers",
"outer_alias": "whs",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_05394 | train | T2 |
v2 | Schema:
requests (alias: ordr)(salary, date, amount, code)
services(salary, name, type, code)
Task: Find code from requests where a matching record exists in services with the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "services",
"outer_alias": "ordr",
"inner_alias": "srvc",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_05395 | train | T2 |
v2 | Schema:
orders (alias: ord)(status, level, name, amount)
accounts(salary, type, amount, name)
Task: Retrieve salary from orders that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_05396 | train | T1 |
v2 | Schema:
transactions (alias: txn)(salary, type, value, code)
categories(status, id, salary, code)
Task: Find value from transactions where a matching record exists in categories with the same level.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_05397 | train | T1 |
v1 | Schema:
staff (alias: empl)(name, status, amount, value)
categories(name, date, code, type)
Task: Retrieve amount from staff whose id is found in categories rows where status matches the outer record.
SQL: | SELECT amount FROM staff AS empl
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_05398 | train | T2 |
v1 | Schema:
staff (alias: empl)(name, level, code, id)
departments(code, date, status, type)
Task: Find code from staff where code appears in departments entries with matching code.
SQL: | SELECT code FROM staff AS empl
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_05399 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.