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 |
|---|---|---|---|---|---|---|
v3 | Schema:
products (alias: prod)(level, amount, value, date)
accounts(code, salary, name, value)
Task: Retrieve name from products with value above the COUNT(value) of accounts rows sharing the same type.
SQL: | SELECT name FROM products AS prod
WHERE value > (
SELECT COUNT(value) FROM accounts AS acct
WHERE acct.type = prod.type
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_00200 | train | T1 |
v1 | Schema:
managers (alias: mgr)(level, salary, status, id)
categories(level, date, status, id)
Task: Select id from managers where type exists in categories for the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_00201 | train | T1 |
v2 | Schema:
departments (alias: dept)(id, value, level, amount)
managers(value, type, status, salary)
Task: Find amount from departments where a matching record exists in managers with the same level.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_00202 | train | T1 |
v1 | Schema:
products (alias: prod)(name, level, id, date)
accounts(name, salary, id, type)
Task: Select value from products where type exists in accounts for the same level.
SQL: | SELECT value FROM products AS prod
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.level = prod.level
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_00203 | train | T1 |
v3 | Schema:
customers (alias: cust)(name, amount, type, salary)
shipments(salary, name, amount, value)
Task: Find name from customers where salary exceeds the average amount from shipments for the same code.
SQL: | SELECT name FROM customers AS cust
WHERE salary > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_00204 | train | T1 |
v1 | Schema:
categories (alias: catg)(date, type, level, value)
budgets(value, status, date, salary)
Task: Retrieve amount from categories whose status is found in budgets rows where level matches the outer record.
SQL: | SELECT amount FROM categories AS catg
WHERE status IN (
SELECT status FROM budgets AS budg
WHERE budg.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "budgets",
"outer_alias": "catg",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_00205 | train | T2 |
v3 | Schema:
employees (alias: emp)(code, level, name, id)
transactions(salary, id, name, status)
Task: Retrieve value from employees with value above the MIN(amount) of transactions rows sharing the same status.
SQL: | SELECT value FROM employees AS emp
WHERE value > (
SELECT MIN(amount) FROM transactions AS txn
WHERE txn.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_00206 | train | T1 |
v2 | Schema:
items (alias: lne)(id, value, date, type)
managers(value, code, id, name)
Task: Retrieve id from items that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = lne.level
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_00207 | train | T2 |
v3 | Schema:
schedules (alias: schd)(type, value, code, salary)
warehouses(type, date, status, id)
Task: Retrieve name from schedules with amount above the SUM(value) of warehouses rows sharing the same level.
SQL: | SELECT name FROM schedules AS schd
WHERE amount > (
SELECT SUM(value) FROM warehouses AS whs
WHERE whs.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "warehouses",
"outer_alias": "schd",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_00208 | train | T2 |
v1 | Schema:
items (alias: lne)(level, code, type, status)
customers(date, name, salary, code)
Task: Find salary from items where id appears in customers entries with matching type.
SQL: | SELECT salary FROM items AS lne
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.type = lne.type
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_00209 | train | T2 |
v2 | Schema:
products (alias: prod)(code, level, name, id)
schedules(salary, id, date, value)
Task: Find id from products where a matching record exists in schedules with the same type.
SQL: | SELECT id 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": "id",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_00210 | train | T1 |
v3 | Schema:
customers (alias: cust)(value, amount, code, id)
shipments(date, level, status, amount)
Task: Find id from customers where salary exceeds the average salary from shipments for the same id.
SQL: | SELECT id FROM customers AS cust
WHERE salary > (
SELECT MAX(salary) FROM shipments AS shp
WHERE shp.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_00211 | train | T1 |
v1 | Schema:
accounts (alias: acct)(id, salary, date, value)
orders(salary, level, value, code)
Task: Select salary from accounts where id exists in orders for the same id.
SQL: | SELECT salary FROM accounts AS acct
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_00212 | train | T1 |
v1 | Schema:
items (alias: lne)(salary, value, id, level)
schedules(type, value, name, amount)
Task: Find name from items where id appears in schedules entries with matching type.
SQL: | SELECT name FROM items AS lne
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.type = lne.type
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_00213 | train | T2 |
v1 | Schema:
departments (alias: dept)(amount, type, date, salary)
shipments(amount, code, level, value)
Task: Find salary from departments where level appears in shipments entries with matching status.
SQL: | SELECT salary FROM departments AS dept
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_00214 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(code, amount, status, level)
employees(code, amount, type, date)
Task: Retrieve amount from warehouses that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT amount FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "employees",
"outer_alias": "whs",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_00215 | train | T2 |
v3 | Schema:
products (alias: prod)(id, amount, level, name)
budgets(type, salary, name, id)
Task: Retrieve salary from products with amount above the SUM(amount) of budgets rows sharing the same code.
SQL: | SELECT salary FROM products AS prod
WHERE amount > (
SELECT SUM(amount) FROM budgets AS budg
WHERE budg.code = prod.code
); | {
"outer_table": "products",
"inner_table": "budgets",
"outer_alias": "prod",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_00216 | train | T1 |
v1 | Schema:
employees (alias: emp)(code, value, type, date)
shipments(code, date, level, id)
Task: Find salary from employees where code appears in shipments entries with matching code.
SQL: | SELECT salary FROM employees AS emp
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_00217 | train | T1 |
v3 | Schema:
employees (alias: emp)(status, name, amount, id)
products(code, amount, id, value)
Task: Find value from employees where salary exceeds the average amount from products for the same type.
SQL: | SELECT value FROM employees AS emp
WHERE salary > (
SELECT COUNT(amount) FROM products AS prod
WHERE prod.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_00218 | train | T1 |
v3 | Schema:
sales (alias: sale)(salary, code, date, amount)
budgets(value, level, date, salary)
Task: Retrieve name from sales with amount above the SUM(salary) of budgets rows sharing the same level.
SQL: | SELECT name FROM sales AS sale
WHERE amount > (
SELECT SUM(salary) FROM budgets AS budg
WHERE budg.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "budgets",
"outer_alias": "sale",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_00219 | train | T1 |
v1 | Schema:
staff (alias: empl)(level, amount, id, name)
services(id, type, name, status)
Task: Find value from staff where type appears in services entries with matching type.
SQL: | SELECT value FROM staff AS empl
WHERE type IN (
SELECT type FROM services AS srvc
WHERE srvc.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "services",
"outer_alias": "empl",
"inner_alias": "srvc",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_00220 | train | T2 |
v2 | Schema:
budgets (alias: budg)(salary, name, amount, date)
regions(type, status, salary, value)
Task: Find salary from budgets where a matching record exists in regions with the same type.
SQL: | SELECT salary FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "regions",
"outer_alias": "budg",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_00221 | train | T2 |
v2 | Schema:
products (alias: prod)(amount, value, id, status)
departments(amount, name, level, date)
Task: Find code from products where a matching record exists in departments with the same status.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = prod.status
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_00222 | train | T1 |
v1 | Schema:
budgets (alias: budg)(level, date, code, type)
departments(status, name, amount, type)
Task: Select amount from budgets where level exists in departments for the same level.
SQL: | SELECT amount FROM budgets AS budg
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "departments",
"outer_alias": "budg",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_00223 | train | T2 |
v2 | Schema:
shipments (alias: shp)(value, type, level, status)
sales(amount, date, name, status)
Task: Retrieve amount from shipments that have at least one corresponding entry in sales sharing the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_00224 | train | T2 |
v1 | Schema:
customers (alias: cust)(amount, salary, name, code)
categories(value, code, date, type)
Task: Select code from customers where type exists in categories for the same id.
SQL: | SELECT code FROM customers AS cust
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_00225 | train | T1 |
v1 | Schema:
requests (alias: ordr)(salary, id, code, level)
warehouses(name, code, level, amount)
Task: Retrieve salary from requests whose status is found in warehouses rows where type matches the outer record.
SQL: | SELECT salary FROM requests AS ordr
WHERE status IN (
SELECT status FROM warehouses AS whs
WHERE whs.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "warehouses",
"outer_alias": "ordr",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_00226 | train | T2 |
v2 | Schema:
managers (alias: mgr)(name, level, value, date)
categories(type, level, amount, id)
Task: Retrieve salary from managers that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_00227 | train | T1 |
v3 | Schema:
regions (alias: rgn)(value, level, amount, status)
schedules(name, id, salary, value)
Task: Find name from regions where salary exceeds the average value from schedules for the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE salary > (
SELECT MAX(value) FROM schedules AS schd
WHERE schd.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_00228 | train | T2 |
v1 | Schema:
shipments (alias: shp)(level, date, amount, status)
categories(amount, value, salary, level)
Task: Select amount from shipments where code exists in categories for the same type.
SQL: | SELECT amount FROM shipments AS shp
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_00229 | train | T2 |
v2 | Schema:
regions (alias: rgn)(name, code, level, type)
sales(id, type, name, value)
Task: Find name from regions where a matching record exists in sales with the same code.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_00230 | train | T2 |
v1 | Schema:
regions (alias: rgn)(name, date, salary, code)
orders(code, value, date, id)
Task: Find code from regions where level appears in orders entries with matching status.
SQL: | SELECT code FROM regions AS rgn
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_00231 | train | T2 |
v2 | Schema:
requests (alias: ordr)(code, value, date, name)
managers(status, salary, id, value)
Task: Find salary from requests where a matching record exists in managers with the same level.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_00232 | train | T2 |
v2 | Schema:
accounts (alias: acct)(name, salary, level, type)
services(amount, level, id, date)
Task: Find salary from accounts where a matching record exists in services with the same code.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "services",
"outer_alias": "acct",
"inner_alias": "srvc",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_00233 | train | T1 |
v2 | Schema:
categories (alias: catg)(id, salary, status, value)
employees(name, salary, amount, status)
Task: Find code from categories where a matching record exists in employees with the same type.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_00234 | train | T2 |
v1 | Schema:
products (alias: prod)(type, name, salary, status)
schedules(name, id, salary, type)
Task: Find value from products where id appears in schedules entries with matching level.
SQL: | SELECT value FROM products AS prod
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.level = prod.level
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_00235 | train | T1 |
v2 | Schema:
staff (alias: empl)(salary, type, name, value)
budgets(id, date, level, type)
Task: Retrieve id from staff that have at least one corresponding entry in budgets sharing the same id.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "budgets",
"outer_alias": "empl",
"inner_alias": "budg",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_00236 | train | T2 |
v1 | Schema:
sales (alias: sale)(type, level, name, code)
schedules(code, status, type, salary)
Task: Retrieve value from sales whose type is found in schedules rows where id matches the outer record.
SQL: | SELECT value FROM sales AS sale
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_00237 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(id, level, date, type)
shipments(salary, date, level, id)
Task: Find id from warehouses where a matching record exists in shipments with the same id.
SQL: | SELECT id FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "shipments",
"outer_alias": "whs",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_00238 | train | T2 |
v1 | Schema:
sales (alias: sale)(level, id, type, value)
budgets(name, type, amount, code)
Task: Retrieve id from sales whose level is found in budgets rows where code matches the outer record.
SQL: | SELECT id FROM sales AS sale
WHERE level IN (
SELECT level FROM budgets AS budg
WHERE budg.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "budgets",
"outer_alias": "sale",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_00239 | train | T1 |
v2 | Schema:
categories (alias: catg)(date, name, salary, value)
managers(value, code, date, status)
Task: Find name from categories where a matching record exists in managers with the same status.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_00240 | train | T2 |
v2 | Schema:
schedules (alias: schd)(value, type, name, amount)
shipments(salary, status, date, value)
Task: Retrieve id from schedules that have at least one corresponding entry in shipments sharing the same level.
SQL: | SELECT id 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": "id",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_00241 | train | T2 |
v2 | Schema:
customers (alias: cust)(name, level, value, amount)
orders(status, date, level, type)
Task: Find salary from customers where a matching record exists in orders with the same id.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_00242 | train | T1 |
v2 | Schema:
regions (alias: rgn)(id, type, level, value)
staff(salary, status, code, name)
Task: Find id from regions where a matching record exists in staff with the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_00243 | train | T2 |
v2 | Schema:
services (alias: srvc)(value, date, amount, name)
categories(level, type, amount, code)
Task: Find salary from services where a matching record exists in categories with the same id.
SQL: | SELECT salary FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "categories",
"outer_alias": "srvc",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_00244 | train | T2 |
v3 | Schema:
schedules (alias: schd)(level, id, value, code)
accounts(status, amount, level, code)
Task: Find name from schedules where value exceeds the average amount from accounts for the same id.
SQL: | SELECT name FROM schedules AS schd
WHERE value > (
SELECT MAX(amount) FROM accounts AS acct
WHERE acct.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_00245 | train | T2 |
v1 | Schema:
shipments (alias: shp)(id, value, date, status)
budgets(name, id, value, type)
Task: Select name from shipments where code exists in budgets for the same status.
SQL: | SELECT name FROM shipments AS shp
WHERE code IN (
SELECT code 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": "code",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_00246 | train | T2 |
v1 | Schema:
schedules (alias: schd)(name, code, type, date)
categories(name, date, code, status)
Task: Find value from schedules where code appears in categories entries with matching level.
SQL: | SELECT value FROM schedules AS schd
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_00247 | train | T2 |
v2 | Schema:
items (alias: lne)(value, name, salary, amount)
requests(code, id, name, status)
Task: Find code from items where a matching record exists in requests with the same code.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_00248 | train | T2 |
v3 | Schema:
regions (alias: rgn)(type, name, code, value)
requests(level, date, salary, type)
Task: Retrieve value from regions with amount above the SUM(value) of requests rows sharing the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE amount > (
SELECT SUM(value) FROM requests AS ordr
WHERE ordr.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_00249 | train | T2 |
v3 | Schema:
managers (alias: mgr)(amount, id, code, name)
transactions(code, salary, amount, name)
Task: Retrieve value from managers with amount above the SUM(amount) of transactions rows sharing the same id.
SQL: | SELECT value FROM managers AS mgr
WHERE amount > (
SELECT SUM(amount) FROM transactions AS txn
WHERE txn.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_00250 | train | T1 |
v2 | Schema:
managers (alias: mgr)(type, level, code, date)
orders(salary, date, amount, level)
Task: Find name from managers where a matching record exists in orders with the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_00251 | train | T1 |
v2 | Schema:
sales (alias: sale)(salary, date, code, level)
staff(id, value, level, amount)
Task: Retrieve name from sales that have at least one corresponding entry in staff sharing the same level.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_00252 | train | T1 |
v1 | Schema:
shipments (alias: shp)(salary, code, id, amount)
accounts(name, salary, value, level)
Task: Retrieve salary from shipments whose type is found in accounts rows where status matches the outer record.
SQL: | SELECT salary FROM shipments AS shp
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_00253 | train | T2 |
v3 | Schema:
accounts (alias: acct)(amount, salary, level, date)
departments(amount, type, code, status)
Task: Retrieve salary from accounts with value above the AVG(value) of departments rows sharing the same code.
SQL: | SELECT salary FROM accounts AS acct
WHERE value > (
SELECT AVG(value) FROM departments AS dept
WHERE dept.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_00254 | train | T1 |
v2 | Schema:
sales (alias: sale)(type, name, level, id)
accounts(id, name, value, code)
Task: Find salary from sales where a matching record exists in accounts with the same type.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_00255 | train | T1 |
v1 | Schema:
staff (alias: empl)(name, date, level, type)
budgets(status, salary, name, level)
Task: Retrieve salary from staff whose id is found in budgets rows where status matches the outer record.
SQL: | SELECT salary FROM staff AS empl
WHERE id IN (
SELECT id FROM budgets AS budg
WHERE budg.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "budgets",
"outer_alias": "empl",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_00256 | train | T2 |
v1 | Schema:
customers (alias: cust)(salary, type, value, date)
budgets(level, status, name, amount)
Task: Select amount from customers where type exists in budgets for the same type.
SQL: | SELECT amount FROM customers AS cust
WHERE type IN (
SELECT type FROM budgets AS budg
WHERE budg.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "budgets",
"outer_alias": "cust",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_00257 | train | T1 |
v1 | Schema:
employees (alias: emp)(value, date, code, status)
departments(date, code, id, type)
Task: Retrieve name from employees whose id is found in departments rows where status matches the outer record.
SQL: | SELECT name FROM employees AS emp
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_00258 | train | T1 |
v2 | Schema:
items (alias: lne)(amount, value, status, name)
services(name, date, status, level)
Task: Find name from items where a matching record exists in services with the same status.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.status = lne.status
); | {
"outer_table": "items",
"inner_table": "services",
"outer_alias": "lne",
"inner_alias": "srvc",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_00259 | train | T2 |
v2 | Schema:
departments (alias: dept)(salary, date, level, amount)
schedules(id, date, code, value)
Task: Retrieve name from departments that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_00260 | train | T1 |
v1 | Schema:
transactions (alias: txn)(type, date, id, name)
invoices(code, amount, date, name)
Task: Retrieve code from transactions whose code is found in invoices rows where status matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_00261 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(name, code, status, amount)
departments(id, date, value, name)
Task: Retrieve amount from warehouses with salary above the AVG(salary) of departments rows sharing the same level.
SQL: | SELECT amount FROM warehouses AS whs
WHERE salary > (
SELECT AVG(salary) FROM departments AS dept
WHERE dept.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "departments",
"outer_alias": "whs",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_00262 | train | T2 |
v2 | Schema:
invoices (alias: inv)(amount, value, type, level)
customers(date, id, level, code)
Task: Find code from invoices where a matching record exists in customers with the same status.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_00263 | train | T1 |
v2 | Schema:
services (alias: srvc)(type, salary, name, id)
budgets(amount, level, type, name)
Task: Retrieve id from services that have at least one corresponding entry in budgets sharing the same status.
SQL: | SELECT id FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "budgets",
"outer_alias": "srvc",
"inner_alias": "budg",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_00264 | train | T2 |
v2 | Schema:
managers (alias: mgr)(amount, code, salary, level)
sales(salary, amount, code, name)
Task: Retrieve name from managers that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_00265 | train | T1 |
v2 | Schema:
transactions (alias: txn)(code, date, status, name)
accounts(level, type, amount, salary)
Task: Retrieve salary from transactions that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_00266 | train | T1 |
v2 | Schema:
staff (alias: empl)(id, date, code, salary)
transactions(level, salary, name, id)
Task: Retrieve code from staff that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_00267 | train | T2 |
v2 | Schema:
staff (alias: empl)(code, salary, value, status)
transactions(amount, type, code, level)
Task: Find id from staff where a matching record exists in transactions with the same type.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_00268 | train | T2 |
v3 | Schema:
shipments (alias: shp)(level, name, status, type)
items(type, name, level, date)
Task: Retrieve amount from shipments with salary above the MIN(value) of items rows sharing the same level.
SQL: | SELECT amount FROM shipments AS shp
WHERE salary > (
SELECT MIN(value) FROM items AS lne
WHERE lne.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_00269 | train | T2 |
v1 | Schema:
orders (alias: ord)(amount, id, value, type)
staff(level, status, date, value)
Task: Retrieve salary from orders whose id is found in staff rows where type matches the outer record.
SQL: | SELECT salary FROM orders AS ord
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_00270 | train | T1 |
v2 | Schema:
employees (alias: emp)(id, salary, code, value)
products(code, type, id, amount)
Task: Retrieve salary from employees that have at least one corresponding entry in products sharing the same type.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_00271 | train | T1 |
v3 | Schema:
customers (alias: cust)(salary, level, date, type)
accounts(amount, name, status, salary)
Task: Find name from customers where value exceeds the average salary from accounts for the same type.
SQL: | SELECT name FROM customers AS cust
WHERE value > (
SELECT SUM(salary) FROM accounts AS acct
WHERE acct.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_00272 | train | T1 |
v1 | Schema:
requests (alias: ordr)(id, salary, level, code)
employees(date, salary, value, type)
Task: Find salary from requests where type appears in employees entries with matching id.
SQL: | SELECT salary FROM requests AS ordr
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_00273 | train | T2 |
v3 | Schema:
orders (alias: ord)(code, date, level, salary)
regions(amount, id, value, date)
Task: Retrieve amount from orders with salary above the MIN(amount) of regions rows sharing the same type.
SQL: | SELECT amount FROM orders AS ord
WHERE salary > (
SELECT MIN(amount) FROM regions AS rgn
WHERE rgn.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_00274 | train | T1 |
v2 | Schema:
departments (alias: dept)(code, status, salary, type)
items(status, id, salary, code)
Task: Retrieve id from departments that have at least one corresponding entry in items sharing the same status.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_00275 | train | T1 |
v3 | Schema:
employees (alias: emp)(amount, name, code, type)
sales(amount, status, salary, date)
Task: Retrieve name from employees with value above the MIN(value) of sales rows sharing the same type.
SQL: | SELECT name FROM employees AS emp
WHERE value > (
SELECT MIN(value) FROM sales AS sale
WHERE sale.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_00276 | train | T1 |
v3 | Schema:
orders (alias: ord)(level, id, type, date)
managers(amount, salary, level, id)
Task: Find amount from orders where salary exceeds the average salary from managers for the same status.
SQL: | SELECT amount FROM orders AS ord
WHERE salary > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_00277 | train | T1 |
v2 | Schema:
services (alias: srvc)(type, status, name, salary)
transactions(name, status, value, code)
Task: Find id from services where a matching record exists in transactions with the same type.
SQL: | SELECT id FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "transactions",
"outer_alias": "srvc",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_00278 | train | T2 |
v3 | Schema:
employees (alias: emp)(id, date, code, type)
customers(value, date, code, id)
Task: Retrieve salary from employees with amount above the AVG(salary) of customers rows sharing the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE amount > (
SELECT AVG(salary) FROM customers AS cust
WHERE cust.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_00279 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(name, code, date, type)
customers(name, date, code, id)
Task: Find salary from warehouses where a matching record exists in customers with the same level.
SQL: | SELECT salary FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "customers",
"outer_alias": "whs",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_00280 | train | T2 |
v1 | Schema:
accounts (alias: acct)(date, status, amount, type)
services(id, code, date, level)
Task: Retrieve id from accounts whose status is found in services rows where level matches the outer record.
SQL: | SELECT id FROM accounts AS acct
WHERE status IN (
SELECT status FROM services AS srvc
WHERE srvc.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "services",
"outer_alias": "acct",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_00281 | train | T1 |
v1 | Schema:
staff (alias: empl)(status, date, name, level)
schedules(status, name, level, type)
Task: Retrieve salary from staff whose id is found in schedules rows where type matches the outer record.
SQL: | SELECT salary FROM staff AS empl
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_00282 | train | T2 |
v3 | Schema:
transactions (alias: txn)(status, level, type, value)
orders(status, id, type, salary)
Task: Retrieve amount from transactions with salary above the MAX(salary) of orders rows sharing the same code.
SQL: | SELECT amount FROM transactions AS txn
WHERE salary > (
SELECT MAX(salary) FROM orders AS ord
WHERE ord.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_00283 | train | T1 |
v2 | Schema:
managers (alias: mgr)(salary, type, value, date)
invoices(value, name, type, salary)
Task: Find value from managers where a matching record exists in invoices with the same code.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_00284 | train | T1 |
v2 | Schema:
regions (alias: rgn)(status, id, type, value)
customers(name, type, salary, level)
Task: Retrieve id from regions that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_00285 | train | T2 |
v1 | Schema:
budgets (alias: budg)(value, salary, status, code)
departments(id, status, date, value)
Task: Select name from budgets where level exists in departments for the same code.
SQL: | SELECT name FROM budgets AS budg
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "departments",
"outer_alias": "budg",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_00286 | train | T2 |
v2 | Schema:
regions (alias: rgn)(amount, code, level, status)
staff(status, date, type, salary)
Task: Find id from regions where a matching record exists in staff with the same status.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_00287 | train | T2 |
v3 | Schema:
requests (alias: ordr)(date, type, id, value)
accounts(type, code, id, value)
Task: Retrieve code from requests with amount above the MAX(salary) of accounts rows sharing the same level.
SQL: | SELECT code FROM requests AS ordr
WHERE amount > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_00288 | train | T2 |
v2 | Schema:
services (alias: srvc)(date, value, code, level)
sales(type, id, salary, name)
Task: Retrieve amount from services that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT amount FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "sales",
"outer_alias": "srvc",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_00289 | train | T2 |
v3 | Schema:
shipments (alias: shp)(id, status, salary, name)
regions(level, type, name, status)
Task: Find name from shipments where value exceeds the average salary from regions for the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE value > (
SELECT AVG(salary) FROM regions AS rgn
WHERE rgn.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_00290 | train | T2 |
v2 | Schema:
staff (alias: empl)(salary, level, date, id)
regions(date, type, level, name)
Task: Find name from staff where a matching record exists in regions with the same type.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_00291 | train | T2 |
v3 | Schema:
budgets (alias: budg)(salary, level, value, date)
requests(code, level, id, date)
Task: Find name from budgets where value exceeds the average value from requests for the same code.
SQL: | SELECT name FROM budgets AS budg
WHERE value > (
SELECT AVG(value) FROM requests AS ordr
WHERE ordr.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "requests",
"outer_alias": "budg",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_00292 | train | T2 |
v3 | Schema:
requests (alias: ordr)(level, name, type, amount)
employees(date, amount, name, type)
Task: Find code from requests where amount exceeds the average salary from employees for the same type.
SQL: | SELECT code FROM requests AS ordr
WHERE amount > (
SELECT MAX(salary) FROM employees AS emp
WHERE emp.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_00293 | train | T2 |
v2 | Schema:
managers (alias: mgr)(type, id, code, amount)
customers(amount, status, id, date)
Task: Retrieve amount from managers that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_00294 | train | T1 |
v3 | Schema:
invoices (alias: inv)(amount, type, id, code)
schedules(status, date, level, amount)
Task: Find code from invoices where amount exceeds the average salary from schedules for the same id.
SQL: | SELECT code FROM invoices AS inv
WHERE amount > (
SELECT MAX(salary) FROM schedules AS schd
WHERE schd.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_00295 | train | T1 |
v2 | Schema:
categories (alias: catg)(id, type, status, salary)
shipments(status, date, id, value)
Task: Retrieve amount from categories that have at least one corresponding entry in shipments sharing the same level.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_00296 | train | T2 |
v2 | Schema:
transactions (alias: txn)(code, type, salary, date)
orders(value, type, salary, code)
Task: Retrieve code from transactions that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_00297 | train | T1 |
v3 | Schema:
departments (alias: dept)(amount, name, code, salary)
regions(id, name, type, salary)
Task: Find value from departments where salary exceeds the average value from regions for the same id.
SQL: | SELECT value FROM departments AS dept
WHERE salary > (
SELECT MIN(value) FROM regions AS rgn
WHERE rgn.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_00298 | train | T1 |
v2 | Schema:
items (alias: lne)(id, level, name, status)
managers(amount, id, name, level)
Task: Retrieve code from items that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = lne.type
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_00299 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.