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:
accounts (alias: acct)(date, value, amount, level)
items(status, value, level, id)
Task: Find value from accounts where code appears in items entries with matching level.
SQL: | SELECT value FROM accounts AS acct
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_11000 | train | T1 |
v3 | Schema:
regions (alias: rgn)(name, amount, type, salary)
budgets(code, level, status, salary)
Task: Find id from regions where amount exceeds the average amount from budgets for the same type.
SQL: | SELECT id FROM regions AS rgn
WHERE amount > (
SELECT MIN(amount) FROM budgets AS budg
WHERE budg.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "budgets",
"outer_alias": "rgn",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_11001 | train | T2 |
v2 | Schema:
managers (alias: mgr)(name, value, status, date)
services(level, type, date, value)
Task: Find salary from managers where a matching record exists in services with the same level.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "services",
"outer_alias": "mgr",
"inner_alias": "srvc",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_11002 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(name, value, level, amount)
accounts(amount, value, salary, name)
Task: Find code from warehouses where value exceeds the average salary from accounts for the same status.
SQL: | SELECT code FROM warehouses AS whs
WHERE value > (
SELECT AVG(salary) FROM accounts AS acct
WHERE acct.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "accounts",
"outer_alias": "whs",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_11003 | train | T2 |
v3 | Schema:
departments (alias: dept)(amount, code, status, value)
requests(level, status, code, type)
Task: Find value from departments where salary exceeds the average salary from requests for the same status.
SQL: | SELECT value FROM departments AS dept
WHERE salary > (
SELECT COUNT(salary) FROM requests AS ordr
WHERE ordr.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_11004 | train | T1 |
v2 | Schema:
requests (alias: ordr)(level, id, salary, date)
schedules(salary, type, value, name)
Task: Find value from requests where a matching record exists in schedules with the same code.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_11005 | train | T2 |
v2 | Schema:
services (alias: srvc)(name, status, level, salary)
departments(type, name, level, id)
Task: Find salary from services where a matching record exists in departments with the same code.
SQL: | SELECT salary FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "departments",
"outer_alias": "srvc",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_11006 | train | T2 |
v2 | Schema:
accounts (alias: acct)(code, type, name, status)
schedules(code, date, id, status)
Task: Retrieve code from accounts that have at least one corresponding entry in schedules sharing the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_11007 | train | T1 |
v2 | Schema:
orders (alias: ord)(amount, value, status, salary)
staff(code, date, level, type)
Task: Find id from orders where a matching record exists in staff with the same status.
SQL: | SELECT id 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": "id",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_11008 | train | T1 |
v2 | Schema:
invoices (alias: inv)(status, type, salary, code)
customers(type, level, status, name)
Task: Find value from invoices where a matching record exists in customers with the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_11009 | train | T1 |
v3 | Schema:
services (alias: srvc)(type, code, status, id)
budgets(status, id, date, salary)
Task: Retrieve id from services with value above the SUM(salary) of budgets rows sharing the same level.
SQL: | SELECT id FROM services AS srvc
WHERE value > (
SELECT SUM(salary) FROM budgets AS budg
WHERE budg.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "budgets",
"outer_alias": "srvc",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_11010 | train | T2 |
v3 | Schema:
managers (alias: mgr)(code, date, name, type)
sales(status, id, value, salary)
Task: Find code from managers where value exceeds the average value from sales for the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE value > (
SELECT SUM(value) FROM sales AS sale
WHERE sale.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_11011 | train | T1 |
v1 | Schema:
departments (alias: dept)(value, code, type, salary)
products(type, salary, id, level)
Task: Select value from departments where id exists in products for the same type.
SQL: | SELECT value FROM departments AS dept
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_11012 | train | T1 |
v1 | Schema:
orders (alias: ord)(salary, code, value, name)
staff(status, value, amount, code)
Task: Select id from orders where code exists in staff for the same code.
SQL: | SELECT id FROM orders AS ord
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_11013 | train | T1 |
v3 | Schema:
budgets (alias: budg)(status, id, type, name)
schedules(salary, type, value, date)
Task: Retrieve name from budgets with value above the MAX(value) of schedules rows sharing the same level.
SQL: | SELECT name FROM budgets AS budg
WHERE value > (
SELECT MAX(value) FROM schedules AS schd
WHERE schd.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "schedules",
"outer_alias": "budg",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_11014 | train | T2 |
v1 | Schema:
customers (alias: cust)(type, name, status, level)
employees(salary, code, date, amount)
Task: Retrieve name from customers whose type is found in employees rows where id matches the outer record.
SQL: | SELECT name FROM customers AS cust
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_11015 | train | T1 |
v3 | Schema:
staff (alias: empl)(id, salary, name, level)
products(salary, amount, status, date)
Task: Find name from staff where amount exceeds the average value from products for the same code.
SQL: | SELECT name FROM staff AS empl
WHERE amount > (
SELECT MAX(value) FROM products AS prod
WHERE prod.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_11016 | train | T2 |
v1 | Schema:
managers (alias: mgr)(code, salary, name, type)
items(code, id, status, value)
Task: Retrieve amount from managers whose type is found in items rows where id matches the outer record.
SQL: | SELECT amount FROM managers AS mgr
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_11017 | train | T1 |
v3 | Schema:
schedules (alias: schd)(type, date, status, id)
services(level, id, amount, value)
Task: Find amount from schedules where value exceeds the average value from services for the same id.
SQL: | SELECT amount FROM schedules AS schd
WHERE value > (
SELECT COUNT(value) FROM services AS srvc
WHERE srvc.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "services",
"outer_alias": "schd",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_11018 | train | T2 |
v2 | Schema:
products (alias: prod)(amount, salary, type, code)
invoices(name, type, salary, value)
Task: Find amount from products where a matching record exists in invoices with the same level.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = prod.level
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_11019 | train | T1 |
v1 | Schema:
schedules (alias: schd)(id, code, name, amount)
sales(status, salary, value, level)
Task: Retrieve name from schedules whose code is found in sales rows where id matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_11020 | train | T2 |
v1 | Schema:
categories (alias: catg)(status, name, level, amount)
managers(salary, code, type, amount)
Task: Retrieve id from categories whose type is found in managers rows where id matches the outer record.
SQL: | SELECT id FROM categories AS catg
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_11021 | train | T2 |
v1 | Schema:
budgets (alias: budg)(id, type, level, date)
employees(level, type, id, amount)
Task: Retrieve salary from budgets whose level is found in employees rows where status matches the outer record.
SQL: | SELECT salary FROM budgets AS budg
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "employees",
"outer_alias": "budg",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_11022 | train | T2 |
v1 | Schema:
departments (alias: dept)(date, amount, value, level)
sales(salary, date, status, level)
Task: Select id from departments where status exists in sales for the same id.
SQL: | SELECT id FROM departments AS dept
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_11023 | train | T1 |
v2 | Schema:
customers (alias: cust)(code, type, status, id)
services(code, level, name, date)
Task: Retrieve value from customers that have at least one corresponding entry in services sharing the same id.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "services",
"outer_alias": "cust",
"inner_alias": "srvc",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_11024 | train | T1 |
v3 | Schema:
invoices (alias: inv)(status, name, type, amount)
accounts(level, value, amount, status)
Task: Retrieve amount from invoices with value above the COUNT(amount) of accounts rows sharing the same status.
SQL: | SELECT amount FROM invoices AS inv
WHERE value > (
SELECT COUNT(amount) FROM accounts AS acct
WHERE acct.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_11025 | train | T1 |
v2 | Schema:
regions (alias: rgn)(value, level, salary, id)
products(code, amount, status, type)
Task: Find name from regions where a matching record exists in products with the same status.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_11026 | train | T2 |
v3 | Schema:
departments (alias: dept)(date, type, amount, name)
categories(amount, salary, code, date)
Task: Find salary from departments where amount exceeds the average salary from categories for the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE amount > (
SELECT MIN(salary) FROM categories AS catg
WHERE catg.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_11027 | train | T1 |
v3 | Schema:
departments (alias: dept)(code, amount, value, status)
warehouses(type, name, code, id)
Task: Retrieve id from departments with salary above the AVG(salary) of warehouses rows sharing the same type.
SQL: | SELECT id FROM departments AS dept
WHERE salary > (
SELECT AVG(salary) FROM warehouses AS whs
WHERE whs.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "warehouses",
"outer_alias": "dept",
"inner_alias": "whs",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_11028 | train | T1 |
v1 | Schema:
customers (alias: cust)(level, code, date, salary)
categories(id, code, value, level)
Task: Find value from customers where status appears in categories entries with matching type.
SQL: | SELECT value FROM customers AS cust
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_11029 | train | T1 |
v3 | Schema:
employees (alias: emp)(name, id, level, salary)
products(level, status, code, salary)
Task: Find name from employees where value exceeds the average amount from products for the same id.
SQL: | SELECT name FROM employees AS emp
WHERE value > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_11030 | train | T1 |
v3 | Schema:
departments (alias: dept)(value, name, type, amount)
employees(date, id, level, status)
Task: Find value from departments where salary exceeds the average value from employees for the same code.
SQL: | SELECT value FROM departments AS dept
WHERE salary > (
SELECT COUNT(value) FROM employees AS emp
WHERE emp.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_11031 | train | T1 |
v3 | Schema:
regions (alias: rgn)(level, name, amount, type)
departments(level, value, type, status)
Task: Retrieve value from regions with salary above the MIN(amount) of departments rows sharing the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE salary > (
SELECT MIN(amount) FROM departments AS dept
WHERE dept.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_11032 | train | T2 |
v1 | Schema:
categories (alias: catg)(code, status, salary, id)
services(value, amount, name, level)
Task: Select amount from categories where type exists in services for the same code.
SQL: | SELECT amount FROM categories AS catg
WHERE type IN (
SELECT type FROM services AS srvc
WHERE srvc.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "services",
"outer_alias": "catg",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_11033 | train | T2 |
v2 | Schema:
schedules (alias: schd)(amount, level, salary, date)
transactions(level, id, name, type)
Task: Find salary from schedules where a matching record exists in transactions with the same level.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_11034 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(amount, level, date, value)
customers(value, code, salary, amount)
Task: Find code from warehouses where id appears in customers entries with matching level.
SQL: | SELECT code FROM warehouses AS whs
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "customers",
"outer_alias": "whs",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_11035 | train | T2 |
v1 | Schema:
employees (alias: emp)(date, status, type, salary)
departments(amount, type, value, name)
Task: Retrieve value from employees whose type is found in departments rows where type matches the outer record.
SQL: | SELECT value FROM employees AS emp
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_11036 | train | T1 |
v1 | Schema:
orders (alias: ord)(status, amount, value, id)
shipments(name, id, value, salary)
Task: Retrieve salary from orders whose code is found in shipments rows where status matches the outer record.
SQL: | SELECT salary FROM orders AS ord
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_11037 | train | T1 |
v1 | Schema:
transactions (alias: txn)(amount, salary, level, date)
customers(code, type, name, level)
Task: Retrieve name from transactions whose code is found in customers rows where level matches the outer record.
SQL: | SELECT name FROM transactions AS txn
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_11038 | train | T1 |
v1 | Schema:
requests (alias: ordr)(level, name, amount, type)
schedules(value, name, code, type)
Task: Retrieve value from requests whose code is found in schedules rows where type matches the outer record.
SQL: | SELECT value FROM requests AS ordr
WHERE code IN (
SELECT code 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": "code",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_11039 | train | T2 |
v3 | Schema:
orders (alias: ord)(value, amount, salary, name)
products(id, code, amount, salary)
Task: Find name from orders where salary exceeds the average value from products for the same type.
SQL: | SELECT name FROM orders AS ord
WHERE salary > (
SELECT AVG(value) FROM products AS prod
WHERE prod.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_11040 | train | T1 |
v2 | Schema:
customers (alias: cust)(level, status, type, name)
budgets(date, name, salary, level)
Task: Retrieve id from customers that have at least one corresponding entry in budgets sharing the same id.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "budgets",
"outer_alias": "cust",
"inner_alias": "budg",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_11041 | train | T1 |
v1 | Schema:
orders (alias: ord)(type, code, salary, amount)
sales(name, salary, value, type)
Task: Retrieve amount from orders whose code is found in sales rows where type matches the outer record.
SQL: | SELECT amount FROM orders AS ord
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_11042 | train | T1 |
v1 | Schema:
transactions (alias: txn)(id, amount, type, value)
regions(code, value, name, level)
Task: Retrieve name from transactions whose code is found in regions rows where status matches the outer record.
SQL: | SELECT name FROM transactions AS txn
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_11043 | train | T1 |
v1 | Schema:
schedules (alias: schd)(salary, value, type, id)
items(name, type, id, code)
Task: Find value from schedules where level appears in items entries with matching level.
SQL: | SELECT value FROM schedules AS schd
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_11044 | train | T2 |
v1 | Schema:
departments (alias: dept)(code, amount, date, status)
orders(status, salary, date, code)
Task: Retrieve name from departments whose code is found in orders rows where code matches the outer record.
SQL: | SELECT name FROM departments AS dept
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_11045 | train | T1 |
v3 | Schema:
products (alias: prod)(level, value, id, name)
staff(salary, type, amount, level)
Task: Retrieve salary from products with salary above the MAX(amount) of staff rows sharing the same id.
SQL: | SELECT salary FROM products AS prod
WHERE salary > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.id = prod.id
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_11046 | train | T1 |
v1 | Schema:
budgets (alias: budg)(status, date, amount, value)
services(name, value, amount, salary)
Task: Find name from budgets where level appears in services entries with matching code.
SQL: | SELECT name FROM budgets AS budg
WHERE level IN (
SELECT level FROM services AS srvc
WHERE srvc.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "services",
"outer_alias": "budg",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_11047 | train | T2 |
v3 | Schema:
products (alias: prod)(salary, type, id, value)
orders(status, id, code, salary)
Task: Find salary from products where salary exceeds the average value from orders for the same status.
SQL: | SELECT salary FROM products AS prod
WHERE salary > (
SELECT MAX(value) FROM orders AS ord
WHERE ord.status = prod.status
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_11048 | train | T1 |
v3 | Schema:
transactions (alias: txn)(salary, level, id, status)
services(salary, value, amount, code)
Task: Retrieve amount from transactions with salary above the SUM(value) of services rows sharing the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE salary > (
SELECT SUM(value) FROM services AS srvc
WHERE srvc.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "services",
"outer_alias": "txn",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_11049 | train | T1 |
v2 | Schema:
categories (alias: catg)(type, salary, name, date)
sales(name, amount, id, type)
Task: Retrieve amount from categories that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_11050 | train | T2 |
v2 | Schema:
invoices (alias: inv)(code, id, status, value)
items(id, name, salary, date)
Task: Find id from invoices where a matching record exists in items with the same type.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_11051 | train | T1 |
v3 | Schema:
categories (alias: catg)(level, salary, name, amount)
orders(status, id, date, type)
Task: Retrieve name from categories with value above the AVG(amount) of orders rows sharing the same status.
SQL: | SELECT name FROM categories AS catg
WHERE value > (
SELECT AVG(amount) FROM orders AS ord
WHERE ord.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_11052 | train | T2 |
v2 | Schema:
requests (alias: ordr)(type, salary, date, value)
customers(id, date, amount, type)
Task: Retrieve salary from requests that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_11053 | train | T2 |
v2 | Schema:
accounts (alias: acct)(id, status, code, value)
budgets(date, status, name, salary)
Task: Find code from accounts where a matching record exists in budgets with the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "budgets",
"outer_alias": "acct",
"inner_alias": "budg",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_11054 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(status, level, id, salary)
accounts(name, salary, date, level)
Task: Retrieve value from warehouses with salary above the SUM(amount) of accounts rows sharing the same status.
SQL: | SELECT value FROM warehouses AS whs
WHERE salary > (
SELECT SUM(amount) FROM accounts AS acct
WHERE acct.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "accounts",
"outer_alias": "whs",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_11055 | train | T2 |
v1 | Schema:
categories (alias: catg)(level, date, code, value)
products(value, level, id, date)
Task: Find salary from categories where code appears in products entries with matching status.
SQL: | SELECT salary FROM categories AS catg
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_11056 | train | T2 |
v1 | Schema:
accounts (alias: acct)(status, name, salary, amount)
staff(level, salary, status, id)
Task: Select amount from accounts where type exists in staff for the same id.
SQL: | SELECT amount FROM accounts AS acct
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_11057 | train | T1 |
v1 | Schema:
regions (alias: rgn)(value, level, id, status)
shipments(name, date, level, type)
Task: Find name from regions where status appears in shipments entries with matching code.
SQL: | SELECT name FROM regions AS rgn
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_11058 | train | T2 |
v1 | Schema:
regions (alias: rgn)(id, salary, status, name)
orders(date, level, salary, amount)
Task: Retrieve id from regions whose type is found in orders rows where level matches the outer record.
SQL: | SELECT id FROM regions AS rgn
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_11059 | train | T2 |
v1 | Schema:
services (alias: srvc)(id, amount, name, type)
requests(value, status, name, date)
Task: Select id from services where status exists in requests for the same status.
SQL: | SELECT id FROM services AS srvc
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "requests",
"outer_alias": "srvc",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_11060 | train | T2 |
v1 | Schema:
staff (alias: empl)(status, level, type, id)
accounts(name, value, date, amount)
Task: Retrieve salary from staff whose level is found in accounts rows where code matches the outer record.
SQL: | SELECT salary FROM staff AS empl
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_11061 | train | T2 |
v1 | Schema:
customers (alias: cust)(name, salary, amount, date)
services(status, code, value, amount)
Task: Retrieve amount from customers whose id is found in services rows where status matches the outer record.
SQL: | SELECT amount FROM customers AS cust
WHERE id IN (
SELECT id FROM services AS srvc
WHERE srvc.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "services",
"outer_alias": "cust",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_11062 | train | T1 |
v3 | Schema:
categories (alias: catg)(code, name, type, value)
items(amount, date, id, code)
Task: Retrieve code from categories with salary above the MAX(salary) of items rows sharing the same code.
SQL: | SELECT code FROM categories AS catg
WHERE salary > (
SELECT MAX(salary) FROM items AS lne
WHERE lne.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_11063 | train | T2 |
v1 | Schema:
categories (alias: catg)(id, status, name, salary)
requests(level, date, name, amount)
Task: Retrieve value from categories whose code is found in requests rows where type matches the outer record.
SQL: | SELECT value FROM categories AS catg
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_11064 | train | T2 |
v2 | Schema:
categories (alias: catg)(id, status, salary, amount)
requests(level, date, name, type)
Task: Retrieve id from categories that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_11065 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(status, type, amount, id)
orders(value, level, id, name)
Task: Find value from warehouses where a matching record exists in orders with the same code.
SQL: | SELECT value FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "orders",
"outer_alias": "whs",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_11066 | train | T2 |
v1 | Schema:
requests (alias: ordr)(type, date, salary, amount)
categories(value, id, salary, status)
Task: Select code from requests where type exists in categories for the same status.
SQL: | SELECT code FROM requests AS ordr
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_11067 | train | T2 |
v1 | Schema:
managers (alias: mgr)(amount, date, type, level)
orders(name, salary, code, amount)
Task: Select value from managers where code exists in orders for the same level.
SQL: | SELECT value FROM managers AS mgr
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_11068 | train | T1 |
v3 | Schema:
customers (alias: cust)(date, code, level, salary)
schedules(status, name, level, id)
Task: Find value from customers where value exceeds the average amount from schedules for the same type.
SQL: | SELECT value FROM customers AS cust
WHERE value > (
SELECT MIN(amount) FROM schedules AS schd
WHERE schd.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_11069 | train | T1 |
v1 | Schema:
transactions (alias: txn)(id, amount, value, code)
orders(name, salary, level, code)
Task: Find amount from transactions where type appears in orders entries with matching status.
SQL: | SELECT amount FROM transactions AS txn
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_11070 | train | T1 |
v1 | Schema:
services (alias: srvc)(name, salary, status, code)
employees(id, name, status, date)
Task: Select amount from services where id exists in employees for the same level.
SQL: | SELECT amount FROM services AS srvc
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "employees",
"outer_alias": "srvc",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_11071 | train | T2 |
v2 | Schema:
requests (alias: ordr)(amount, type, status, name)
departments(date, amount, status, id)
Task: Find salary from requests where a matching record exists in departments with the same code.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_11072 | train | T2 |
v1 | Schema:
orders (alias: ord)(date, name, type, code)
products(code, id, level, status)
Task: Select code from orders where level exists in products for the same level.
SQL: | SELECT code FROM orders AS ord
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_11073 | train | T1 |
v1 | Schema:
orders (alias: ord)(level, id, code, amount)
staff(salary, level, code, status)
Task: Retrieve amount from orders whose type is found in staff rows where type matches the outer record.
SQL: | SELECT amount FROM orders AS ord
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_11074 | train | T1 |
v2 | Schema:
invoices (alias: inv)(salary, value, level, name)
schedules(code, status, type, id)
Task: Find amount from invoices where a matching record exists in schedules with the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_11075 | train | T1 |
v1 | Schema:
budgets (alias: budg)(date, amount, value, code)
services(code, salary, name, amount)
Task: Find id from budgets where status appears in services entries with matching status.
SQL: | SELECT id FROM budgets AS budg
WHERE status IN (
SELECT status FROM services AS srvc
WHERE srvc.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "services",
"outer_alias": "budg",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_11076 | train | T2 |
v3 | Schema:
requests (alias: ordr)(amount, code, name, salary)
staff(amount, name, type, id)
Task: Retrieve amount from requests with value above the MIN(amount) of staff rows sharing the same type.
SQL: | SELECT amount FROM requests AS ordr
WHERE value > (
SELECT MIN(amount) FROM staff AS empl
WHERE empl.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_11077 | train | T2 |
v1 | Schema:
transactions (alias: txn)(id, type, name, date)
orders(salary, status, amount, level)
Task: Select name from transactions where level exists in orders for the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_11078 | train | T1 |
v2 | Schema:
items (alias: lne)(salary, id, level, date)
services(value, type, status, code)
Task: Find name from items where a matching record exists in services with the same code.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.code = lne.code
); | {
"outer_table": "items",
"inner_table": "services",
"outer_alias": "lne",
"inner_alias": "srvc",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_11079 | train | T2 |
v3 | Schema:
shipments (alias: shp)(code, level, type, salary)
budgets(value, date, amount, salary)
Task: Find name from shipments where value exceeds the average value from budgets for the same status.
SQL: | SELECT name FROM shipments AS shp
WHERE value > (
SELECT MIN(value) FROM budgets AS budg
WHERE budg.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "budgets",
"outer_alias": "shp",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_11080 | train | T2 |
v3 | Schema:
invoices (alias: inv)(code, level, type, salary)
warehouses(value, status, salary, name)
Task: Find value from invoices where value exceeds the average salary from warehouses for the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE value > (
SELECT MAX(salary) FROM warehouses AS whs
WHERE whs.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "warehouses",
"outer_alias": "inv",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_11081 | train | T1 |
v1 | Schema:
managers (alias: mgr)(id, level, salary, type)
requests(value, code, amount, salary)
Task: Find code from managers where id appears in requests entries with matching code.
SQL: | SELECT code FROM managers AS mgr
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_11082 | train | T1 |
v1 | Schema:
items (alias: lne)(code, value, amount, status)
transactions(level, value, date, status)
Task: Retrieve amount from items whose level is found in transactions rows where status matches the outer record.
SQL: | SELECT amount FROM items AS lne
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_11083 | train | T2 |
v3 | Schema:
customers (alias: cust)(level, amount, type, value)
items(amount, code, name, status)
Task: Find salary from customers where amount exceeds the average amount from items for the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE amount > (
SELECT MIN(amount) FROM items AS lne
WHERE lne.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_11084 | train | T1 |
v2 | Schema:
invoices (alias: inv)(date, code, status, name)
shipments(value, id, type, salary)
Task: Retrieve amount from invoices that have at least one corresponding entry in shipments sharing the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_11085 | train | T1 |
v1 | Schema:
products (alias: prod)(name, id, status, type)
regions(date, code, value, name)
Task: Select code from products where code exists in regions for the same type.
SQL: | SELECT code FROM products AS prod
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.type = prod.type
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_11086 | train | T1 |
v1 | Schema:
sales (alias: sale)(status, level, name, id)
accounts(salary, amount, type, name)
Task: Select name from sales where type exists in accounts for the same level.
SQL: | SELECT name FROM sales AS sale
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_11087 | train | T1 |
v1 | Schema:
regions (alias: rgn)(name, date, type, level)
orders(name, id, level, type)
Task: Find name from regions where type appears in orders entries with matching id.
SQL: | SELECT name FROM regions AS rgn
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_11088 | train | T2 |
v1 | Schema:
items (alias: lne)(salary, status, type, amount)
shipments(value, code, name, level)
Task: Retrieve name from items whose status is found in shipments rows where status matches the outer record.
SQL: | SELECT name FROM items AS lne
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.status = lne.status
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_11089 | train | T2 |
v3 | Schema:
regions (alias: rgn)(id, name, date, salary)
services(value, salary, status, code)
Task: Retrieve name from regions with salary above the AVG(amount) of services rows sharing the same code.
SQL: | SELECT name FROM regions AS rgn
WHERE salary > (
SELECT AVG(amount) FROM services AS srvc
WHERE srvc.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "services",
"outer_alias": "rgn",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_11090 | train | T2 |
v3 | Schema:
departments (alias: dept)(type, amount, salary, date)
items(level, id, value, salary)
Task: Retrieve code from departments with amount above the COUNT(value) of items rows sharing the same id.
SQL: | SELECT code FROM departments AS dept
WHERE amount > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_11091 | train | T1 |
v3 | Schema:
requests (alias: ordr)(amount, status, code, date)
regions(salary, value, type, amount)
Task: Find id from requests where salary exceeds the average value from regions for the same status.
SQL: | SELECT id FROM requests AS ordr
WHERE salary > (
SELECT MIN(value) FROM regions AS rgn
WHERE rgn.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_11092 | train | T2 |
v2 | Schema:
employees (alias: emp)(level, name, salary, value)
shipments(salary, status, type, code)
Task: Find name from employees where a matching record exists in shipments with the same id.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_11093 | train | T1 |
v3 | Schema:
transactions (alias: txn)(status, salary, date, amount)
warehouses(salary, amount, level, type)
Task: Find code from transactions where value exceeds the average amount from warehouses for the same type.
SQL: | SELECT code FROM transactions AS txn
WHERE value > (
SELECT COUNT(amount) FROM warehouses AS whs
WHERE whs.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "warehouses",
"outer_alias": "txn",
"inner_alias": "whs",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_11094 | train | T1 |
v2 | Schema:
items (alias: lne)(amount, type, status, code)
services(salary, status, id, date)
Task: Find code from items where a matching record exists in services with the same code.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.code = lne.code
); | {
"outer_table": "items",
"inner_table": "services",
"outer_alias": "lne",
"inner_alias": "srvc",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_11095 | train | T2 |
v2 | Schema:
budgets (alias: budg)(status, amount, id, level)
services(level, value, date, amount)
Task: Find name from budgets where a matching record exists in services with the same status.
SQL: | SELECT name FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "services",
"outer_alias": "budg",
"inner_alias": "srvc",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_11096 | train | T2 |
v3 | Schema:
schedules (alias: schd)(level, status, code, id)
regions(status, code, id, level)
Task: Find id from schedules where salary exceeds the average salary from regions for the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE salary > (
SELECT MAX(salary) FROM regions AS rgn
WHERE rgn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_11097 | train | T2 |
v3 | Schema:
departments (alias: dept)(code, id, level, status)
employees(salary, code, level, id)
Task: Retrieve code from departments with value above the MIN(value) of employees rows sharing the same status.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT MIN(value) FROM employees AS emp
WHERE emp.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_11098 | train | T1 |
v1 | Schema:
requests (alias: ordr)(type, amount, value, date)
customers(code, id, date, salary)
Task: Select code from requests where type exists in customers for the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_11099 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.