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:
regions (alias: rgn)(level, date, name, amount)
requests(value, level, status, code)
Task: Find value from regions where salary exceeds the average value from requests for the same type.
SQL: | SELECT value FROM regions AS rgn
WHERE salary > (
SELECT AVG(value) FROM requests AS ordr
WHERE ordr.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_02900 | train | T2 |
v1 | Schema:
departments (alias: dept)(type, level, value, amount)
warehouses(value, salary, id, status)
Task: Retrieve amount from departments whose code is found in warehouses rows where id matches the outer record.
SQL: | SELECT amount FROM departments AS dept
WHERE code IN (
SELECT code FROM warehouses AS whs
WHERE whs.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "warehouses",
"outer_alias": "dept",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_02901 | train | T1 |
v1 | Schema:
staff (alias: empl)(type, id, date, level)
requests(amount, code, salary, status)
Task: Find amount from staff where id appears in requests entries with matching code.
SQL: | SELECT amount FROM staff AS empl
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_02902 | train | T2 |
v1 | Schema:
services (alias: srvc)(date, salary, type, amount)
managers(name, type, level, amount)
Task: Select name from services where code exists in managers for the same id.
SQL: | SELECT name FROM services AS srvc
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "managers",
"outer_alias": "srvc",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_02903 | train | T2 |
v2 | Schema:
regions (alias: rgn)(id, name, salary, status)
orders(code, date, name, type)
Task: Find salary from regions where a matching record exists in orders with the same level.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_02904 | train | T2 |
v3 | Schema:
sales (alias: sale)(amount, status, type, name)
customers(amount, type, salary, code)
Task: Retrieve salary from sales with value above the MAX(salary) of customers rows sharing the same status.
SQL: | SELECT salary FROM sales AS sale
WHERE value > (
SELECT MAX(salary) FROM customers AS cust
WHERE cust.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_02905 | train | T1 |
v1 | Schema:
products (alias: prod)(salary, type, status, amount)
items(name, status, code, value)
Task: Select salary from products where level exists in items for the same level.
SQL: | SELECT salary FROM products AS prod
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.level = prod.level
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_02906 | train | T1 |
v1 | Schema:
managers (alias: mgr)(status, amount, value, type)
customers(value, code, date, status)
Task: Retrieve name from managers whose code is found in customers rows where id matches the outer record.
SQL: | SELECT name FROM managers AS mgr
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_02907 | train | T1 |
v2 | Schema:
budgets (alias: budg)(level, salary, type, name)
warehouses(id, salary, date, name)
Task: Retrieve id from budgets that have at least one corresponding entry in warehouses sharing the same id.
SQL: | SELECT id FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "warehouses",
"outer_alias": "budg",
"inner_alias": "whs",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_02908 | train | T2 |
v2 | Schema:
departments (alias: dept)(status, code, date, level)
services(level, date, value, type)
Task: Retrieve amount from departments that have at least one corresponding entry in services sharing the same status.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "services",
"outer_alias": "dept",
"inner_alias": "srvc",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_02909 | train | T1 |
v3 | Schema:
budgets (alias: budg)(date, status, id, salary)
shipments(code, id, type, value)
Task: Retrieve id from budgets with value above the MAX(salary) of shipments rows sharing the same status.
SQL: | SELECT id FROM budgets AS budg
WHERE value > (
SELECT MAX(salary) FROM shipments AS shp
WHERE shp.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "shipments",
"outer_alias": "budg",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_02910 | train | T2 |
v3 | Schema:
staff (alias: empl)(value, salary, code, id)
items(amount, salary, value, name)
Task: Find name from staff where value exceeds the average amount from items for the same level.
SQL: | SELECT name FROM staff AS empl
WHERE value > (
SELECT COUNT(amount) FROM items AS lne
WHERE lne.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_02911 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(name, amount, value, level)
invoices(salary, amount, level, id)
Task: Find name from warehouses where value exceeds the average amount from invoices for the same id.
SQL: | SELECT name FROM warehouses AS whs
WHERE value > (
SELECT COUNT(amount) FROM invoices AS inv
WHERE inv.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "invoices",
"outer_alias": "whs",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_02912 | train | T2 |
v1 | Schema:
departments (alias: dept)(amount, name, code, status)
schedules(value, status, code, level)
Task: Find code from departments where level appears in schedules entries with matching code.
SQL: | SELECT code FROM departments AS dept
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_02913 | train | T1 |
v3 | Schema:
departments (alias: dept)(code, name, type, salary)
transactions(amount, date, id, status)
Task: Find name from departments where salary exceeds the average salary from transactions for the same id.
SQL: | SELECT name FROM departments AS dept
WHERE salary > (
SELECT COUNT(salary) FROM transactions AS txn
WHERE txn.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_02914 | train | T1 |
v3 | Schema:
departments (alias: dept)(value, code, level, id)
budgets(salary, status, value, type)
Task: Find amount from departments where salary exceeds the average value from budgets for the same type.
SQL: | SELECT amount FROM departments AS dept
WHERE salary > (
SELECT SUM(value) FROM budgets AS budg
WHERE budg.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "budgets",
"outer_alias": "dept",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_02915 | train | T1 |
v2 | Schema:
regions (alias: rgn)(type, status, salary, id)
categories(amount, name, id, salary)
Task: Retrieve name from regions that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_02916 | train | T2 |
v3 | Schema:
products (alias: prod)(salary, amount, value, code)
items(name, level, status, id)
Task: Find amount from products where value exceeds the average amount from items for the same type.
SQL: | SELECT amount FROM products AS prod
WHERE value > (
SELECT MAX(amount) FROM items AS lne
WHERE lne.type = prod.type
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_02917 | train | T1 |
v2 | Schema:
categories (alias: catg)(date, type, amount, status)
shipments(name, date, status, value)
Task: Retrieve value from categories that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_02918 | train | T2 |
v3 | Schema:
transactions (alias: txn)(amount, salary, type, id)
items(level, name, status, code)
Task: Find value from transactions where value exceeds the average salary from items for the same id.
SQL: | SELECT value FROM transactions AS txn
WHERE value > (
SELECT AVG(salary) FROM items AS lne
WHERE lne.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_02919 | train | T1 |
v3 | Schema:
accounts (alias: acct)(id, value, date, code)
services(code, id, date, status)
Task: Find name from accounts where salary exceeds the average amount from services for the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE salary > (
SELECT SUM(amount) FROM services AS srvc
WHERE srvc.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "services",
"outer_alias": "acct",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_02920 | train | T1 |
v3 | Schema:
items (alias: lne)(amount, date, status, type)
orders(type, status, code, level)
Task: Find amount from items where value exceeds the average amount from orders for the same code.
SQL: | SELECT amount FROM items AS lne
WHERE value > (
SELECT AVG(amount) FROM orders AS ord
WHERE ord.code = lne.code
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_02921 | train | T2 |
v2 | Schema:
orders (alias: ord)(salary, date, level, code)
sales(id, value, code, level)
Task: Retrieve id from orders that have at least one corresponding entry in sales sharing the same status.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_02922 | train | T1 |
v3 | Schema:
invoices (alias: inv)(id, name, code, status)
shipments(value, level, id, amount)
Task: Retrieve id from invoices with value above the MIN(salary) of shipments rows sharing the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE value > (
SELECT MIN(salary) FROM shipments AS shp
WHERE shp.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_02923 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(code, name, id, salary)
managers(salary, status, amount, id)
Task: Retrieve id from warehouses with salary above the SUM(amount) of managers rows sharing the same id.
SQL: | SELECT id FROM warehouses AS whs
WHERE salary > (
SELECT SUM(amount) FROM managers AS mgr
WHERE mgr.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "managers",
"outer_alias": "whs",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_02924 | train | T2 |
v1 | Schema:
transactions (alias: txn)(name, type, date, amount)
products(id, level, code, value)
Task: Select name from transactions where level exists in products for the same status.
SQL: | SELECT name FROM transactions AS txn
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_02925 | train | T1 |
v2 | Schema:
employees (alias: emp)(level, type, salary, code)
managers(code, date, id, name)
Task: Find salary from employees where a matching record exists in managers with the same id.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_02926 | train | T1 |
v2 | Schema:
items (alias: lne)(amount, name, id, value)
products(level, amount, id, code)
Task: Find name from items where a matching record exists in products with the same level.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = lne.level
); | {
"outer_table": "items",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_02927 | train | T2 |
v1 | Schema:
categories (alias: catg)(code, date, type, level)
items(type, date, salary, level)
Task: Select code from categories where level exists in items for the same code.
SQL: | SELECT code FROM categories AS catg
WHERE level IN (
SELECT level 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": "level",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_02928 | train | T2 |
v1 | Schema:
staff (alias: empl)(level, name, date, amount)
categories(id, name, salary, type)
Task: Find name from staff where level appears in categories entries with matching id.
SQL: | SELECT name FROM staff AS empl
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_02929 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(name, salary, code, date)
customers(level, name, date, status)
Task: Find salary from warehouses where salary exceeds the average salary from customers for the same type.
SQL: | SELECT salary FROM warehouses AS whs
WHERE salary > (
SELECT COUNT(salary) FROM customers AS cust
WHERE cust.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "customers",
"outer_alias": "whs",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_02930 | train | T2 |
v3 | Schema:
requests (alias: ordr)(name, date, id, type)
managers(name, type, date, level)
Task: Retrieve salary from requests with amount above the SUM(salary) of managers rows sharing the same code.
SQL: | SELECT salary FROM requests AS ordr
WHERE amount > (
SELECT SUM(salary) FROM managers AS mgr
WHERE mgr.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_02931 | train | T2 |
v2 | Schema:
categories (alias: catg)(salary, status, value, amount)
transactions(salary, id, type, date)
Task: Retrieve salary from categories that have at least one corresponding entry in transactions sharing the same code.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_02932 | train | T2 |
v3 | Schema:
managers (alias: mgr)(code, name, value, status)
employees(amount, code, date, status)
Task: Find value from managers where amount exceeds the average salary from employees for the same status.
SQL: | SELECT value FROM managers AS mgr
WHERE amount > (
SELECT SUM(salary) FROM employees AS emp
WHERE emp.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_02933 | train | T1 |
v3 | Schema:
staff (alias: empl)(amount, id, type, date)
regions(name, amount, salary, type)
Task: Find code from staff where amount exceeds the average value from regions for the same code.
SQL: | SELECT code FROM staff AS empl
WHERE amount > (
SELECT MIN(value) FROM regions AS rgn
WHERE rgn.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_02934 | train | T2 |
v1 | Schema:
employees (alias: emp)(level, amount, id, date)
sales(code, date, status, level)
Task: Find name from employees where id appears in sales entries with matching level.
SQL: | SELECT name FROM employees AS emp
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_02935 | train | T1 |
v2 | Schema:
services (alias: srvc)(amount, salary, date, level)
sales(name, code, amount, level)
Task: Retrieve value from services that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT value 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": "value",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_02936 | train | T2 |
v2 | Schema:
categories (alias: catg)(amount, date, status, name)
orders(salary, amount, level, status)
Task: Retrieve name from categories that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_02937 | train | T2 |
v1 | Schema:
shipments (alias: shp)(code, name, date, type)
categories(level, date, type, salary)
Task: Retrieve code from shipments whose type is found in categories rows where id matches the outer record.
SQL: | SELECT code FROM shipments AS shp
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_02938 | train | T2 |
v3 | Schema:
services (alias: srvc)(code, salary, type, id)
departments(amount, value, status, name)
Task: Retrieve amount from services with salary above the MIN(amount) of departments rows sharing the same id.
SQL: | SELECT amount FROM services AS srvc
WHERE salary > (
SELECT MIN(amount) FROM departments AS dept
WHERE dept.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "departments",
"outer_alias": "srvc",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_02939 | train | T2 |
v2 | Schema:
sales (alias: sale)(salary, status, id, code)
managers(value, amount, name, code)
Task: Find value from sales where a matching record exists in managers with the same code.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_02940 | train | T1 |
v1 | Schema:
accounts (alias: acct)(level, date, value, code)
services(salary, name, date, type)
Task: Find code from accounts where level appears in services entries with matching code.
SQL: | SELECT code FROM accounts AS acct
WHERE level IN (
SELECT level FROM services AS srvc
WHERE srvc.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "services",
"outer_alias": "acct",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_02941 | train | T1 |
v1 | Schema:
shipments (alias: shp)(name, type, status, amount)
orders(code, salary, status, id)
Task: Retrieve value from shipments whose level is found in orders rows where level matches the outer record.
SQL: | SELECT value FROM shipments AS shp
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_02942 | train | T2 |
v1 | Schema:
budgets (alias: budg)(value, status, id, salary)
accounts(value, status, level, type)
Task: Select amount from budgets where code exists in accounts for the same level.
SQL: | SELECT amount FROM budgets AS budg
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "accounts",
"outer_alias": "budg",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_02943 | train | T2 |
v2 | Schema:
budgets (alias: budg)(date, name, code, type)
accounts(value, id, level, code)
Task: Retrieve id from budgets that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT id FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "accounts",
"outer_alias": "budg",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_02944 | train | T2 |
v1 | Schema:
categories (alias: catg)(name, type, code, level)
managers(name, level, date, value)
Task: Select id from categories where type exists in managers for the same status.
SQL: | SELECT id FROM categories AS catg
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_02945 | train | T2 |
v2 | Schema:
invoices (alias: inv)(status, name, id, level)
departments(date, salary, type, id)
Task: Find name from invoices where a matching record exists in departments with the same code.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_02946 | train | T1 |
v2 | Schema:
employees (alias: emp)(salary, name, value, code)
regions(date, code, salary, value)
Task: Find id from employees where a matching record exists in regions with the same status.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_02947 | train | T1 |
v2 | Schema:
staff (alias: empl)(code, status, value, id)
invoices(status, level, date, salary)
Task: Find name from staff where a matching record exists in invoices with the same code.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_02948 | train | T2 |
v3 | Schema:
services (alias: srvc)(id, amount, status, level)
products(value, date, name, salary)
Task: Retrieve id from services with salary above the MIN(value) of products rows sharing the same code.
SQL: | SELECT id FROM services AS srvc
WHERE salary > (
SELECT MIN(value) FROM products AS prod
WHERE prod.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "products",
"outer_alias": "srvc",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_02949 | train | T2 |
v3 | Schema:
departments (alias: dept)(value, id, salary, level)
employees(salary, value, name, level)
Task: Find code from departments where salary exceeds the average value from employees for the same code.
SQL: | SELECT code 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": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_02950 | train | T1 |
v1 | Schema:
categories (alias: catg)(type, level, status, date)
employees(date, salary, value, level)
Task: Retrieve salary from categories whose type is found in employees rows where level matches the outer record.
SQL: | SELECT salary FROM categories AS catg
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_02951 | train | T2 |
v2 | Schema:
items (alias: lne)(date, salary, amount, name)
budgets(type, name, level, salary)
Task: Find salary from items where a matching record exists in budgets with the same id.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.id = lne.id
); | {
"outer_table": "items",
"inner_table": "budgets",
"outer_alias": "lne",
"inner_alias": "budg",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_02952 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(status, amount, name, salary)
categories(code, type, level, status)
Task: Retrieve salary from warehouses that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT salary FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "categories",
"outer_alias": "whs",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_02953 | train | T2 |
v2 | Schema:
budgets (alias: budg)(id, amount, code, status)
staff(type, level, date, status)
Task: Retrieve code from budgets that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT code FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "staff",
"outer_alias": "budg",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_02954 | train | T2 |
v1 | Schema:
managers (alias: mgr)(type, date, level, code)
shipments(id, amount, name, value)
Task: Find code from managers where level appears in shipments entries with matching type.
SQL: | SELECT code FROM managers AS mgr
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_02955 | train | T1 |
v3 | Schema:
shipments (alias: shp)(salary, status, value, name)
categories(level, salary, value, code)
Task: Find name from shipments where salary exceeds the average amount from categories for the same code.
SQL: | SELECT name FROM shipments AS shp
WHERE salary > (
SELECT SUM(amount) FROM categories AS catg
WHERE catg.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_02956 | train | T2 |
v3 | Schema:
orders (alias: ord)(value, amount, salary, date)
shipments(date, level, status, amount)
Task: Find salary from orders where amount exceeds the average value from shipments for the same id.
SQL: | SELECT salary FROM orders AS ord
WHERE amount > (
SELECT SUM(value) FROM shipments AS shp
WHERE shp.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_02957 | train | T1 |
v2 | Schema:
shipments (alias: shp)(code, status, name, date)
departments(name, status, level, id)
Task: Find name from shipments where a matching record exists in departments with the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_02958 | train | T2 |
v2 | Schema:
sales (alias: sale)(name, status, date, salary)
employees(name, code, status, id)
Task: Retrieve amount from sales that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_02959 | train | T1 |
v1 | Schema:
employees (alias: emp)(value, code, salary, amount)
orders(level, salary, name, type)
Task: Find code from employees where type appears in orders entries with matching code.
SQL: | SELECT code FROM employees AS emp
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_02960 | train | T1 |
v2 | Schema:
managers (alias: mgr)(id, value, type, salary)
transactions(status, amount, date, name)
Task: Find id from managers where a matching record exists in transactions with the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_02961 | train | T1 |
v3 | Schema:
requests (alias: ordr)(type, amount, status, code)
sales(amount, name, value, salary)
Task: Find name from requests where value exceeds the average salary from sales for the same type.
SQL: | SELECT name FROM requests AS ordr
WHERE value > (
SELECT COUNT(salary) FROM sales AS sale
WHERE sale.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_02962 | train | T2 |
v1 | Schema:
items (alias: lne)(amount, value, id, date)
customers(amount, salary, level, id)
Task: Select value from items where level exists in customers for the same type.
SQL: | SELECT value FROM items AS lne
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.type = lne.type
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_02963 | train | T2 |
v1 | Schema:
managers (alias: mgr)(amount, code, status, name)
accounts(status, date, id, amount)
Task: Retrieve id from managers whose level is found in accounts rows where level matches the outer record.
SQL: | SELECT id FROM managers AS mgr
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_02964 | train | T1 |
v1 | Schema:
items (alias: lne)(value, code, name, date)
categories(status, date, salary, id)
Task: Find amount from items where code appears in categories entries with matching level.
SQL: | SELECT amount FROM items AS lne
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.level = lne.level
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_02965 | train | T2 |
v1 | Schema:
invoices (alias: inv)(type, salary, level, amount)
categories(value, date, amount, type)
Task: Select name from invoices where code exists in categories for the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_02966 | train | T1 |
v1 | Schema:
shipments (alias: shp)(type, value, level, name)
staff(level, value, date, id)
Task: Find amount from shipments where type appears in staff entries with matching type.
SQL: | SELECT amount FROM shipments AS shp
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_02967 | train | T2 |
v1 | Schema:
managers (alias: mgr)(id, salary, amount, name)
categories(level, name, salary, type)
Task: Retrieve id from managers whose status is found in categories rows where type matches the outer record.
SQL: | SELECT id FROM managers AS mgr
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_02968 | train | T1 |
v3 | Schema:
regions (alias: rgn)(salary, name, status, date)
products(amount, id, type, status)
Task: Find salary from regions where value exceeds the average salary from products for the same id.
SQL: | SELECT salary FROM regions AS rgn
WHERE value > (
SELECT MAX(salary) FROM products AS prod
WHERE prod.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_02969 | train | T2 |
v2 | Schema:
customers (alias: cust)(level, code, status, salary)
schedules(code, date, status, level)
Task: Retrieve name from customers that have at least one corresponding entry in schedules sharing the same status.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_02970 | train | T1 |
v2 | Schema:
invoices (alias: inv)(date, code, status, level)
budgets(id, level, date, status)
Task: Find id from invoices where a matching record exists in budgets with the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "budgets",
"outer_alias": "inv",
"inner_alias": "budg",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_02971 | train | T1 |
v1 | Schema:
budgets (alias: budg)(date, id, amount, type)
employees(value, name, level, amount)
Task: Retrieve value from budgets whose type is found in employees rows where status matches the outer record.
SQL: | SELECT value FROM budgets AS budg
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "employees",
"outer_alias": "budg",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_02972 | train | T2 |
v1 | Schema:
invoices (alias: inv)(date, amount, status, type)
regions(level, date, status, code)
Task: Find salary from invoices where level appears in regions entries with matching level.
SQL: | SELECT salary FROM invoices AS inv
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_02973 | train | T1 |
v1 | Schema:
customers (alias: cust)(level, value, amount, salary)
accounts(status, name, level, salary)
Task: Find amount from customers where level appears in accounts entries with matching status.
SQL: | SELECT amount FROM customers AS cust
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_02974 | train | T1 |
v2 | Schema:
employees (alias: emp)(type, status, salary, date)
categories(value, date, type, level)
Task: Find value from employees where a matching record exists in categories with the same type.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_02975 | train | T1 |
v1 | Schema:
managers (alias: mgr)(name, date, value, level)
services(value, status, type, name)
Task: Retrieve code from managers whose status is found in services rows where status matches the outer record.
SQL: | SELECT code FROM managers AS mgr
WHERE status IN (
SELECT status FROM services AS srvc
WHERE srvc.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "services",
"outer_alias": "mgr",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_02976 | train | T1 |
v3 | Schema:
requests (alias: ordr)(value, amount, code, id)
regions(amount, name, value, date)
Task: Retrieve code from requests with amount above the MAX(amount) of regions rows sharing the same type.
SQL: | SELECT code FROM requests AS ordr
WHERE amount > (
SELECT MAX(amount) FROM regions AS rgn
WHERE rgn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_02977 | train | T2 |
v2 | Schema:
items (alias: lne)(level, status, salary, code)
regions(id, type, code, status)
Task: Find value from items where a matching record exists in regions with the same level.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_02978 | train | T2 |
v3 | Schema:
customers (alias: cust)(name, id, salary, date)
schedules(status, code, salary, amount)
Task: Find value from customers where salary exceeds the average amount from schedules for the same code.
SQL: | SELECT value FROM customers AS cust
WHERE salary > (
SELECT MIN(amount) FROM schedules AS schd
WHERE schd.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_02979 | train | T1 |
v1 | Schema:
invoices (alias: inv)(amount, type, date, status)
requests(salary, amount, code, value)
Task: Retrieve amount from invoices whose status is found in requests rows where code matches the outer record.
SQL: | SELECT amount FROM invoices AS inv
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_02980 | train | T1 |
v1 | Schema:
budgets (alias: budg)(status, level, salary, code)
categories(level, name, date, salary)
Task: Retrieve id from budgets whose code is found in categories rows where status matches the outer record.
SQL: | SELECT id FROM budgets AS budg
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "categories",
"outer_alias": "budg",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_02981 | train | T2 |
v2 | Schema:
departments (alias: dept)(salary, code, value, level)
requests(value, code, id, amount)
Task: Retrieve code from departments that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_02982 | train | T1 |
v1 | Schema:
shipments (alias: shp)(name, level, code, type)
products(id, code, date, status)
Task: Find code from shipments where level appears in products entries with matching type.
SQL: | SELECT code FROM shipments AS shp
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_02983 | train | T2 |
v2 | Schema:
staff (alias: empl)(value, level, date, salary)
products(name, code, salary, status)
Task: Retrieve value from staff that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_02984 | train | T2 |
v1 | Schema:
transactions (alias: txn)(id, amount, level, salary)
accounts(id, salary, code, amount)
Task: Select name from transactions where status exists in accounts for the same level.
SQL: | SELECT name FROM transactions AS txn
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_02985 | train | T1 |
v2 | Schema:
managers (alias: mgr)(id, type, code, amount)
requests(status, date, id, amount)
Task: Find amount from managers where a matching record exists in requests with the same code.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_02986 | train | T1 |
v2 | Schema:
categories (alias: catg)(name, level, amount, id)
staff(amount, status, id, salary)
Task: Find amount from categories where a matching record exists in staff with the same level.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_02987 | train | T2 |
v2 | Schema:
regions (alias: rgn)(amount, value, status, code)
managers(name, code, amount, id)
Task: Retrieve name from regions that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_02988 | train | T2 |
v2 | Schema:
categories (alias: catg)(type, salary, id, status)
budgets(amount, id, value, date)
Task: Retrieve code from categories that have at least one corresponding entry in budgets sharing the same code.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "budgets",
"outer_alias": "catg",
"inner_alias": "budg",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_02989 | train | T2 |
v1 | Schema:
budgets (alias: budg)(amount, status, name, id)
sales(id, status, value, name)
Task: Find id from budgets where status appears in sales entries with matching type.
SQL: | SELECT id FROM budgets AS budg
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "sales",
"outer_alias": "budg",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_02990 | train | T2 |
v1 | Schema:
schedules (alias: schd)(date, level, id, value)
transactions(type, name, amount, value)
Task: Retrieve value from schedules whose type is found in transactions rows where id matches the outer record.
SQL: | SELECT value FROM schedules AS schd
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_02991 | train | T2 |
v3 | Schema:
budgets (alias: budg)(status, name, level, type)
services(level, status, id, name)
Task: Find value from budgets where amount exceeds the average amount from services for the same type.
SQL: | SELECT value FROM budgets AS budg
WHERE amount > (
SELECT COUNT(amount) FROM services AS srvc
WHERE srvc.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "services",
"outer_alias": "budg",
"inner_alias": "srvc",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_02992 | train | T2 |
v1 | Schema:
requests (alias: ordr)(name, status, type, amount)
categories(code, id, value, amount)
Task: Select amount from requests where level exists in categories for the same status.
SQL: | SELECT amount FROM requests AS ordr
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_02993 | train | T2 |
v3 | Schema:
accounts (alias: acct)(status, salary, level, date)
transactions(salary, code, amount, value)
Task: Retrieve name from accounts with salary above the COUNT(value) of transactions rows sharing the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE salary > (
SELECT COUNT(value) FROM transactions AS txn
WHERE txn.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_02994 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(date, code, amount, value)
transactions(date, name, value, id)
Task: Find amount from warehouses where amount exceeds the average salary from transactions for the same id.
SQL: | SELECT amount FROM warehouses AS whs
WHERE amount > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "transactions",
"outer_alias": "whs",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_02995 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(amount, type, date, id)
transactions(code, name, level, salary)
Task: Retrieve id from warehouses that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT id FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "transactions",
"outer_alias": "whs",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_02996 | train | T2 |
v2 | Schema:
regions (alias: rgn)(id, amount, status, date)
sales(salary, id, name, status)
Task: Find id from regions where a matching record exists in sales with the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_02997 | train | T2 |
v3 | Schema:
staff (alias: empl)(type, value, id, level)
sales(amount, type, salary, status)
Task: Retrieve value from staff with amount above the MIN(value) of sales rows sharing the same status.
SQL: | SELECT value FROM staff AS empl
WHERE amount > (
SELECT MIN(value) FROM sales AS sale
WHERE sale.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_02998 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(amount, code, type, date)
employees(type, code, salary, amount)
Task: Retrieve code from warehouses with salary above the MAX(salary) of employees rows sharing the same status.
SQL: | SELECT code FROM warehouses AS whs
WHERE salary > (
SELECT MAX(salary) FROM employees AS emp
WHERE emp.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "employees",
"outer_alias": "whs",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_02999 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.