variant stringclasses 3
values | prompt stringlengths 163 237 | sql stringlengths 103 143 | metadata unknown | id stringlengths 21 21 | split stringclasses 1
value | token_group stringclasses 2
values |
|---|---|---|---|---|---|---|
v2 | Schema:
departments (alias: dept)(code, name, status, date)
orders(amount, id, name, date)
Task: Find name from departments where a matching record exists in orders with the same status.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_10900 | train | T1 |
v3 | Schema:
items (alias: lne)(name, code, date, value)
customers(amount, code, value, id)
Task: Find name from items where amount exceeds the average amount from customers for the same id.
SQL: | SELECT name FROM items AS lne
WHERE amount > (
SELECT AVG(amount) FROM customers AS cust
WHERE cust.id = lne.id
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_10901 | train | T2 |
v3 | Schema:
departments (alias: dept)(code, amount, name, level)
transactions(id, date, name, level)
Task: Retrieve code from departments with amount above the MIN(salary) of transactions rows sharing the same level.
SQL: | SELECT code FROM departments AS dept
WHERE amount > (
SELECT MIN(salary) FROM transactions AS txn
WHERE txn.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_10902 | train | T1 |
v2 | Schema:
items (alias: lne)(code, id, status, date)
customers(type, id, code, name)
Task: Find salary from items where a matching record exists in customers with the same id.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = lne.id
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_10903 | train | T2 |
v1 | Schema:
orders (alias: ord)(status, amount, code, level)
schedules(name, date, level, id)
Task: Retrieve id from orders whose type is found in schedules rows where code matches the outer record.
SQL: | SELECT id FROM orders AS ord
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_10904 | train | T1 |
v3 | Schema:
budgets (alias: budg)(amount, code, id, name)
managers(name, id, salary, amount)
Task: Find name from budgets where value exceeds the average salary from managers for the same status.
SQL: | SELECT name FROM budgets AS budg
WHERE value > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "managers",
"outer_alias": "budg",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_10905 | train | T2 |
v1 | Schema:
managers (alias: mgr)(amount, id, salary, level)
services(name, status, date, code)
Task: Retrieve id from managers whose level is found in services rows where code matches the outer record.
SQL: | SELECT id FROM managers AS mgr
WHERE level IN (
SELECT level FROM services AS srvc
WHERE srvc.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "services",
"outer_alias": "mgr",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_10906 | train | T1 |
v2 | Schema:
regions (alias: rgn)(name, status, amount, code)
services(name, date, status, value)
Task: Find salary from regions where a matching record exists in services with the same type.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "services",
"outer_alias": "rgn",
"inner_alias": "srvc",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_10907 | train | T2 |
v1 | Schema:
managers (alias: mgr)(level, salary, value, name)
shipments(status, amount, type, name)
Task: Find code from managers where status appears in shipments entries with matching type.
SQL: | SELECT code FROM managers AS mgr
WHERE status IN (
SELECT status 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": "status",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_10908 | train | T1 |
v2 | Schema:
services (alias: srvc)(date, amount, name, salary)
warehouses(type, date, value, amount)
Task: Retrieve value from services that have at least one corresponding entry in warehouses sharing the same level.
SQL: | SELECT value FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "warehouses",
"outer_alias": "srvc",
"inner_alias": "whs",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_10909 | train | T2 |
v2 | Schema:
transactions (alias: txn)(status, amount, code, type)
categories(type, status, name, value)
Task: Retrieve salary from transactions that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_10910 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(salary, status, level, date)
orders(type, salary, status, id)
Task: Find id from warehouses where status appears in orders entries with matching code.
SQL: | SELECT id FROM warehouses AS whs
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "orders",
"outer_alias": "whs",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_10911 | train | T2 |
v1 | Schema:
requests (alias: ordr)(salary, type, value, id)
employees(salary, date, level, id)
Task: Retrieve name from requests whose id is found in employees rows where id matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_10912 | train | T2 |
v2 | Schema:
employees (alias: emp)(amount, date, level, salary)
items(date, name, status, amount)
Task: Retrieve id from employees that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_10913 | train | T1 |
v1 | Schema:
requests (alias: ordr)(type, date, amount, id)
items(value, name, amount, status)
Task: Select amount from requests where status exists in items for the same code.
SQL: | SELECT amount FROM requests AS ordr
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_10914 | train | T2 |
v2 | Schema:
accounts (alias: acct)(type, id, name, salary)
requests(level, amount, code, id)
Task: Find id from accounts where a matching record exists in requests with the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_10915 | train | T1 |
v1 | Schema:
orders (alias: ord)(name, id, code, date)
services(code, value, date, type)
Task: Find amount from orders where status appears in services entries with matching status.
SQL: | SELECT amount FROM orders AS ord
WHERE status IN (
SELECT status FROM services AS srvc
WHERE srvc.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "services",
"outer_alias": "ord",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_10916 | train | T1 |
v2 | Schema:
customers (alias: cust)(level, salary, value, id)
departments(value, type, salary, date)
Task: Retrieve id from customers that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_10917 | train | T1 |
v2 | Schema:
categories (alias: catg)(date, value, level, amount)
budgets(status, name, amount, value)
Task: Find amount from categories where a matching record exists in budgets with the same status.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "budgets",
"outer_alias": "catg",
"inner_alias": "budg",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_10918 | train | T2 |
v1 | Schema:
budgets (alias: budg)(code, type, status, salary)
shipments(name, type, status, code)
Task: Select code from budgets where type exists in shipments for the same code.
SQL: | SELECT code FROM budgets AS budg
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "shipments",
"outer_alias": "budg",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_10919 | train | T2 |
v3 | Schema:
employees (alias: emp)(salary, id, type, amount)
orders(value, name, code, amount)
Task: Retrieve amount from employees with salary above the SUM(amount) of orders rows sharing the same level.
SQL: | SELECT amount FROM employees AS emp
WHERE salary > (
SELECT SUM(amount) FROM orders AS ord
WHERE ord.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_10920 | train | T1 |
v1 | Schema:
managers (alias: mgr)(type, value, code, date)
transactions(name, id, date, amount)
Task: Find salary from managers where level appears in transactions entries with matching status.
SQL: | SELECT salary FROM managers AS mgr
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_10921 | train | T1 |
v1 | Schema:
items (alias: lne)(salary, code, id, value)
schedules(amount, id, salary, date)
Task: Retrieve amount from items whose level is found in schedules rows where code matches the outer record.
SQL: | SELECT amount FROM items AS lne
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.code = lne.code
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_10922 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(date, amount, type, status)
sales(salary, level, id, date)
Task: Find id from warehouses where value exceeds the average value from sales for the same level.
SQL: | SELECT id FROM warehouses AS whs
WHERE value > (
SELECT MIN(value) FROM sales AS sale
WHERE sale.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "sales",
"outer_alias": "whs",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_10923 | train | T2 |
v3 | Schema:
departments (alias: dept)(amount, code, value, status)
products(name, salary, level, status)
Task: Find salary from departments where salary exceeds the average value from products for the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE salary > (
SELECT COUNT(value) FROM products AS prod
WHERE prod.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_10924 | train | T1 |
v2 | Schema:
managers (alias: mgr)(salary, level, name, code)
schedules(type, status, amount, date)
Task: Retrieve id from managers that have at least one corresponding entry in schedules sharing the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_10925 | train | T1 |
v3 | Schema:
staff (alias: empl)(level, amount, type, status)
transactions(amount, salary, name, code)
Task: Find code from staff where amount exceeds the average value from transactions for the same id.
SQL: | SELECT code FROM staff AS empl
WHERE amount > (
SELECT COUNT(value) FROM transactions AS txn
WHERE txn.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_10926 | train | T2 |
v1 | Schema:
departments (alias: dept)(status, id, amount, name)
transactions(date, value, salary, amount)
Task: Find code from departments where status appears in transactions entries with matching type.
SQL: | SELECT code FROM departments AS dept
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_10927 | train | T1 |
v1 | Schema:
services (alias: srvc)(code, level, status, name)
warehouses(amount, salary, level, name)
Task: Find salary from services where level appears in warehouses entries with matching status.
SQL: | SELECT salary FROM services AS srvc
WHERE level IN (
SELECT level FROM warehouses AS whs
WHERE whs.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "warehouses",
"outer_alias": "srvc",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_10928 | train | T2 |
v2 | Schema:
invoices (alias: inv)(name, level, type, value)
managers(level, date, id, status)
Task: Retrieve code from invoices that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_10929 | train | T1 |
v1 | Schema:
regions (alias: rgn)(amount, date, level, status)
schedules(status, name, code, level)
Task: Retrieve salary from regions whose type is found in schedules rows where code matches the outer record.
SQL: | SELECT salary FROM regions AS rgn
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_10930 | train | T2 |
v1 | Schema:
budgets (alias: budg)(salary, code, value, type)
invoices(type, salary, id, value)
Task: Find value from budgets where code appears in invoices entries with matching status.
SQL: | SELECT value FROM budgets AS budg
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "invoices",
"outer_alias": "budg",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_10931 | train | T2 |
v2 | Schema:
items (alias: lne)(salary, level, type, name)
schedules(type, amount, date, status)
Task: Find amount from items where a matching record exists in schedules with the same code.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = lne.code
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_10932 | train | T2 |
v1 | Schema:
budgets (alias: budg)(status, amount, name, id)
managers(level, name, id, code)
Task: Find value from budgets where id appears in managers entries with matching id.
SQL: | SELECT value FROM budgets AS budg
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "managers",
"outer_alias": "budg",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_10933 | train | T2 |
v3 | Schema:
sales (alias: sale)(status, amount, code, salary)
shipments(value, name, type, salary)
Task: Find amount from sales where salary exceeds the average salary from shipments for the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE salary > (
SELECT MIN(salary) FROM shipments AS shp
WHERE shp.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_10934 | train | T1 |
v1 | Schema:
staff (alias: empl)(amount, name, value, date)
categories(status, salary, level, amount)
Task: Find amount from staff where level appears in categories entries with matching id.
SQL: | SELECT amount 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": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_10935 | train | T2 |
v1 | Schema:
products (alias: prod)(salary, status, level, amount)
budgets(code, status, amount, value)
Task: Find code from products where type appears in budgets entries with matching code.
SQL: | SELECT code FROM products AS prod
WHERE type IN (
SELECT type FROM budgets AS budg
WHERE budg.code = prod.code
); | {
"outer_table": "products",
"inner_table": "budgets",
"outer_alias": "prod",
"inner_alias": "budg",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_10936 | train | T1 |
v2 | Schema:
invoices (alias: inv)(amount, level, code, name)
items(status, type, name, code)
Task: Retrieve value from invoices that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_10937 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(status, date, amount, value)
budgets(status, code, value, level)
Task: Select name from warehouses where id exists in budgets for the same status.
SQL: | SELECT name FROM warehouses AS whs
WHERE id IN (
SELECT id FROM budgets AS budg
WHERE budg.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "budgets",
"outer_alias": "whs",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_10938 | train | T2 |
v2 | Schema:
regions (alias: rgn)(type, status, amount, date)
accounts(name, amount, salary, level)
Task: Retrieve salary from regions that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_10939 | train | T2 |
v3 | Schema:
staff (alias: empl)(name, salary, value, code)
sales(date, code, level, value)
Task: Find value from staff where amount exceeds the average amount from sales for the same type.
SQL: | SELECT value FROM staff AS empl
WHERE amount > (
SELECT SUM(amount) FROM sales AS sale
WHERE sale.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_10940 | train | T2 |
v3 | Schema:
budgets (alias: budg)(code, salary, level, amount)
shipments(id, status, salary, level)
Task: Find salary from budgets where value exceeds the average salary from shipments for the same type.
SQL: | SELECT salary FROM budgets AS budg
WHERE value > (
SELECT AVG(salary) FROM shipments AS shp
WHERE shp.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "shipments",
"outer_alias": "budg",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_10941 | train | T2 |
v1 | Schema:
employees (alias: emp)(type, amount, code, value)
products(amount, status, id, type)
Task: Find amount from employees where id appears in products entries with matching code.
SQL: | SELECT amount FROM employees AS emp
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_10942 | train | T1 |
v1 | Schema:
staff (alias: empl)(value, level, id, date)
sales(id, date, status, name)
Task: Select code from staff where code exists in sales for the same level.
SQL: | SELECT code FROM staff AS empl
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_10943 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(type, name, code, amount)
orders(date, salary, amount, value)
Task: Select code from warehouses where status exists in orders for the same level.
SQL: | SELECT code FROM warehouses AS whs
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "orders",
"outer_alias": "whs",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_10944 | train | T2 |
v1 | Schema:
managers (alias: mgr)(amount, code, date, id)
requests(id, type, name, status)
Task: Select amount from managers where status exists in requests for the same level.
SQL: | SELECT amount FROM managers AS mgr
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_10945 | train | T1 |
v3 | Schema:
accounts (alias: acct)(id, date, amount, status)
categories(value, salary, id, name)
Task: Find id from accounts where amount exceeds the average amount from categories for the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE amount > (
SELECT MIN(amount) FROM categories AS catg
WHERE catg.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_10946 | train | T1 |
v3 | Schema:
customers (alias: cust)(id, salary, name, level)
services(id, date, code, name)
Task: Retrieve value from customers with amount above the MAX(value) of services rows sharing the same code.
SQL: | SELECT value FROM customers AS cust
WHERE amount > (
SELECT MAX(value) FROM services AS srvc
WHERE srvc.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "services",
"outer_alias": "cust",
"inner_alias": "srvc",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_10947 | train | T1 |
v2 | Schema:
accounts (alias: acct)(type, name, salary, code)
transactions(type, value, name, amount)
Task: Find value from accounts where a matching record exists in transactions with the same code.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_10948 | train | T1 |
v2 | Schema:
transactions (alias: txn)(value, amount, status, id)
orders(type, status, id, amount)
Task: Find id from transactions where a matching record exists in orders with the same status.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_10949 | train | T1 |
v2 | Schema:
regions (alias: rgn)(status, value, code, amount)
staff(status, salary, value, name)
Task: Find code from regions where a matching record exists in staff with the same id.
SQL: | SELECT code 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": "code",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_10950 | train | T2 |
v1 | Schema:
invoices (alias: inv)(code, type, level, salary)
budgets(salary, level, name, date)
Task: Select id from invoices where id exists in budgets for the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE id IN (
SELECT id FROM budgets AS budg
WHERE budg.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "budgets",
"outer_alias": "inv",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_10951 | train | T1 |
v1 | Schema:
requests (alias: ordr)(id, salary, status, amount)
transactions(name, amount, level, salary)
Task: Retrieve salary from requests whose status is found in transactions rows where status matches the outer record.
SQL: | SELECT salary FROM requests AS ordr
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_10952 | train | T2 |
v3 | Schema:
shipments (alias: shp)(id, type, status, name)
invoices(amount, id, salary, name)
Task: Retrieve code from shipments with amount above the AVG(amount) of invoices rows sharing the same id.
SQL: | SELECT code FROM shipments AS shp
WHERE amount > (
SELECT AVG(amount) FROM invoices AS inv
WHERE inv.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_10953 | train | T2 |
v1 | Schema:
schedules (alias: schd)(amount, level, status, type)
staff(name, status, amount, level)
Task: Retrieve amount from schedules whose code is found in staff rows where type matches the outer record.
SQL: | SELECT amount FROM schedules AS schd
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_10954 | train | T2 |
v3 | Schema:
departments (alias: dept)(code, level, status, id)
invoices(value, id, name, code)
Task: Find code from departments where value exceeds the average amount from invoices for the same type.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT SUM(amount) FROM invoices AS inv
WHERE inv.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "invoices",
"outer_alias": "dept",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_10955 | train | T1 |
v2 | Schema:
items (alias: lne)(date, code, type, id)
transactions(code, type, value, date)
Task: Find salary from items where a matching record exists in transactions with the same status.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_10956 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(level, id, name, salary)
requests(salary, name, code, status)
Task: Retrieve id from warehouses whose code is found in requests rows where code matches the outer record.
SQL: | SELECT id FROM warehouses AS whs
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "requests",
"outer_alias": "whs",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_10957 | train | T2 |
v1 | Schema:
sales (alias: sale)(salary, level, value, id)
regions(level, id, type, status)
Task: Retrieve code from sales whose status is found in regions rows where code matches the outer record.
SQL: | SELECT code FROM sales AS sale
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_10958 | train | T1 |
v2 | Schema:
orders (alias: ord)(value, level, date, type)
accounts(amount, value, level, salary)
Task: Find salary from orders where a matching record exists in accounts with the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_10959 | train | T1 |
v3 | Schema:
transactions (alias: txn)(level, amount, name, status)
invoices(amount, name, code, value)
Task: Retrieve salary from transactions with salary above the MAX(value) of invoices rows sharing the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE salary > (
SELECT MAX(value) FROM invoices AS inv
WHERE inv.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_10960 | train | T1 |
v3 | Schema:
accounts (alias: acct)(type, amount, date, level)
products(salary, type, code, status)
Task: Retrieve amount from accounts with value above the SUM(value) of products rows sharing the same code.
SQL: | SELECT amount FROM accounts AS acct
WHERE value > (
SELECT SUM(value) FROM products AS prod
WHERE prod.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_10961 | train | T1 |
v1 | Schema:
sales (alias: sale)(name, type, salary, value)
requests(type, level, name, status)
Task: Retrieve name from sales whose id is found in requests rows where level matches the outer record.
SQL: | SELECT name FROM sales AS sale
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_10962 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(id, name, amount, type)
sales(salary, name, id, code)
Task: Select value from warehouses where code exists in sales for the same level.
SQL: | SELECT value FROM warehouses AS whs
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "sales",
"outer_alias": "whs",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_10963 | train | T2 |
v2 | Schema:
sales (alias: sale)(status, salary, id, code)
accounts(status, date, type, code)
Task: Find salary from sales where a matching record exists in accounts with the same code.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_10964 | train | T1 |
v3 | Schema:
regions (alias: rgn)(value, status, date, code)
sales(value, type, date, id)
Task: Retrieve code from regions with value above the AVG(salary) of sales rows sharing the same status.
SQL: | SELECT code FROM regions AS rgn
WHERE value > (
SELECT AVG(salary) FROM sales AS sale
WHERE sale.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_10965 | train | T2 |
v2 | Schema:
transactions (alias: txn)(level, code, id, value)
employees(amount, name, level, code)
Task: Retrieve value from transactions that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_10966 | train | T1 |
v2 | Schema:
schedules (alias: schd)(name, level, code, date)
orders(status, type, salary, id)
Task: Retrieve salary from schedules that have at least one corresponding entry in orders sharing the same status.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_10967 | train | T2 |
v2 | Schema:
budgets (alias: budg)(name, value, amount, date)
shipments(salary, name, value, id)
Task: Find name from budgets where a matching record exists in shipments with the same level.
SQL: | SELECT name FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "shipments",
"outer_alias": "budg",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_10968 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(level, name, code, value)
sales(name, value, level, status)
Task: Find name from warehouses where salary exceeds the average amount from sales for the same id.
SQL: | SELECT name FROM warehouses AS whs
WHERE salary > (
SELECT MAX(amount) FROM sales AS sale
WHERE sale.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "sales",
"outer_alias": "whs",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_10969 | train | T2 |
v3 | Schema:
requests (alias: ordr)(date, amount, level, value)
categories(salary, date, level, type)
Task: Find salary from requests where value exceeds the average value from categories for the same level.
SQL: | SELECT salary FROM requests AS ordr
WHERE value > (
SELECT SUM(value) FROM categories AS catg
WHERE catg.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_10970 | train | T2 |
v3 | Schema:
orders (alias: ord)(salary, status, name, date)
employees(name, level, amount, status)
Task: Retrieve amount from orders with amount above the SUM(amount) of employees rows sharing the same status.
SQL: | SELECT amount FROM orders AS ord
WHERE amount > (
SELECT SUM(amount) FROM employees AS emp
WHERE emp.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_10971 | train | T1 |
v3 | Schema:
services (alias: srvc)(amount, value, type, id)
employees(id, date, salary, value)
Task: Retrieve salary from services with value above the SUM(value) of employees rows sharing the same code.
SQL: | SELECT salary FROM services AS srvc
WHERE value > (
SELECT SUM(value) FROM employees AS emp
WHERE emp.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "employees",
"outer_alias": "srvc",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_10972 | train | T2 |
v1 | Schema:
regions (alias: rgn)(id, name, level, code)
customers(amount, date, level, id)
Task: Select amount from regions where code exists in customers for the same level.
SQL: | SELECT amount FROM regions AS rgn
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_10973 | train | T2 |
v3 | Schema:
budgets (alias: budg)(date, salary, value, id)
items(date, value, name, level)
Task: Retrieve code from budgets with amount above the AVG(amount) of items rows sharing the same type.
SQL: | SELECT code FROM budgets AS budg
WHERE amount > (
SELECT AVG(amount) FROM items AS lne
WHERE lne.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "items",
"outer_alias": "budg",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_10974 | train | T2 |
v1 | Schema:
staff (alias: empl)(amount, type, id, code)
items(value, amount, id, date)
Task: Select amount from staff where level exists in items for the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_10975 | train | T2 |
v3 | Schema:
regions (alias: rgn)(amount, status, value, salary)
requests(value, level, amount, salary)
Task: Retrieve id from regions with salary above the SUM(amount) of requests rows sharing the same code.
SQL: | SELECT id FROM regions AS rgn
WHERE salary > (
SELECT SUM(amount) FROM requests AS ordr
WHERE ordr.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_10976 | train | T2 |
v3 | Schema:
orders (alias: ord)(level, salary, code, value)
invoices(value, code, level, amount)
Task: Retrieve value from orders with amount above the MIN(value) of invoices rows sharing the same type.
SQL: | SELECT value FROM orders AS ord
WHERE amount > (
SELECT MIN(value) FROM invoices AS inv
WHERE inv.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_10977 | train | T1 |
v3 | Schema:
schedules (alias: schd)(salary, type, name, level)
regions(level, status, amount, id)
Task: Retrieve value from schedules with salary above the MIN(salary) of regions rows sharing the same status.
SQL: | SELECT value FROM schedules AS schd
WHERE salary > (
SELECT MIN(salary) FROM regions AS rgn
WHERE rgn.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_10978 | train | T2 |
v3 | Schema:
requests (alias: ordr)(name, amount, type, status)
schedules(level, date, value, type)
Task: Find salary from requests where amount exceeds the average salary from schedules for the same id.
SQL: | SELECT salary FROM requests AS ordr
WHERE amount > (
SELECT COUNT(salary) FROM schedules AS schd
WHERE schd.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_10979 | train | T2 |
v2 | Schema:
departments (alias: dept)(id, salary, type, amount)
requests(amount, level, salary, id)
Task: Retrieve value from departments that have at least one corresponding entry in requests sharing the same id.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_10980 | train | T1 |
v2 | Schema:
employees (alias: emp)(type, name, code, id)
warehouses(type, code, salary, id)
Task: Retrieve name from employees that have at least one corresponding entry in warehouses sharing the same type.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "warehouses",
"outer_alias": "emp",
"inner_alias": "whs",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_10981 | train | T1 |
v1 | Schema:
categories (alias: catg)(amount, code, date, type)
requests(salary, name, status, date)
Task: Select code from categories where id exists in requests for the same id.
SQL: | SELECT code FROM categories AS catg
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_10982 | train | T2 |
v3 | Schema:
requests (alias: ordr)(status, level, type, date)
warehouses(status, value, amount, type)
Task: Find salary from requests where value exceeds the average salary from warehouses for the same code.
SQL: | SELECT salary FROM requests AS ordr
WHERE value > (
SELECT MIN(salary) FROM warehouses AS whs
WHERE whs.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "warehouses",
"outer_alias": "ordr",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_10983 | train | T2 |
v2 | Schema:
services (alias: srvc)(amount, date, name, type)
shipments(date, value, name, salary)
Task: Retrieve salary from services that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT salary FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "shipments",
"outer_alias": "srvc",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_10984 | train | T2 |
v2 | Schema:
transactions (alias: txn)(name, salary, id, value)
accounts(amount, code, type, salary)
Task: Find value from transactions where a matching record exists in accounts with the same id.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_10985 | train | T1 |
v3 | Schema:
employees (alias: emp)(name, level, amount, value)
managers(name, code, value, id)
Task: Retrieve id from employees with value above the SUM(value) of managers rows sharing the same type.
SQL: | SELECT id FROM employees AS emp
WHERE value > (
SELECT SUM(value) FROM managers AS mgr
WHERE mgr.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_10986 | train | T1 |
v3 | Schema:
customers (alias: cust)(amount, date, name, type)
accounts(code, id, name, salary)
Task: Find salary from customers where value exceeds the average amount from accounts for the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE value > (
SELECT COUNT(amount) FROM accounts AS acct
WHERE acct.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_10987 | train | T1 |
v3 | Schema:
services (alias: srvc)(level, type, value, salary)
products(id, type, level, status)
Task: Retrieve id from services with value above the COUNT(value) of products rows sharing the same status.
SQL: | SELECT id FROM services AS srvc
WHERE value > (
SELECT COUNT(value) FROM products AS prod
WHERE prod.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "products",
"outer_alias": "srvc",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_10988 | train | T2 |
v2 | Schema:
schedules (alias: schd)(type, name, value, amount)
warehouses(salary, name, id, level)
Task: Find amount from schedules where a matching record exists in warehouses with the same code.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "warehouses",
"outer_alias": "schd",
"inner_alias": "whs",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_10989 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(amount, salary, id, date)
requests(code, status, id, amount)
Task: Retrieve id from warehouses with value above the SUM(amount) of requests rows sharing the same id.
SQL: | SELECT id FROM warehouses AS whs
WHERE value > (
SELECT SUM(amount) FROM requests AS ordr
WHERE ordr.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "requests",
"outer_alias": "whs",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_10990 | train | T2 |
v1 | Schema:
services (alias: srvc)(id, date, name, status)
schedules(code, name, salary, amount)
Task: Select salary from services where status exists in schedules for the same status.
SQL: | SELECT salary FROM services AS srvc
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "schedules",
"outer_alias": "srvc",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_10991 | train | T2 |
v1 | Schema:
categories (alias: catg)(value, salary, type, level)
departments(date, value, status, salary)
Task: Find amount from categories where code appears in departments entries with matching level.
SQL: | SELECT amount FROM categories AS catg
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_10992 | train | T2 |
v1 | Schema:
transactions (alias: txn)(level, value, type, name)
budgets(code, value, name, type)
Task: Select amount from transactions where code exists in budgets for the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE code IN (
SELECT code FROM budgets AS budg
WHERE budg.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "budgets",
"outer_alias": "txn",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_10993 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(status, amount, type, value)
services(value, salary, code, id)
Task: Retrieve id from warehouses with amount above the SUM(amount) of services rows sharing the same level.
SQL: | SELECT id FROM warehouses AS whs
WHERE amount > (
SELECT SUM(amount) FROM services AS srvc
WHERE srvc.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "services",
"outer_alias": "whs",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_10994 | train | T2 |
v2 | Schema:
items (alias: lne)(date, status, type, name)
services(amount, name, code, salary)
Task: Retrieve value from items that have at least one corresponding entry in services sharing the same id.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.id = lne.id
); | {
"outer_table": "items",
"inner_table": "services",
"outer_alias": "lne",
"inner_alias": "srvc",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_10995 | train | T2 |
v3 | Schema:
staff (alias: empl)(id, code, type, name)
warehouses(salary, id, value, type)
Task: Retrieve value from staff with value above the AVG(amount) of warehouses rows sharing the same code.
SQL: | SELECT value FROM staff AS empl
WHERE value > (
SELECT AVG(amount) FROM warehouses AS whs
WHERE whs.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "warehouses",
"outer_alias": "empl",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_10996 | train | T2 |
v2 | Schema:
items (alias: lne)(value, id, code, name)
managers(status, code, date, name)
Task: Retrieve amount from items that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_10997 | train | T2 |
v2 | Schema:
departments (alias: dept)(id, salary, code, value)
requests(id, salary, type, date)
Task: Find value from departments where a matching record exists in requests with the same type.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_10998 | train | T1 |
v3 | Schema:
shipments (alias: shp)(code, level, name, date)
staff(amount, date, name, id)
Task: Retrieve id from shipments with amount above the MAX(amount) of staff rows sharing the same status.
SQL: | SELECT id FROM shipments AS shp
WHERE amount > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_10999 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.