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:
shipments (alias: shp)(type, status, level, value)
employees(salary, level, type, date)
Task: Retrieve name from shipments with value above the AVG(salary) of employees rows sharing the same type.
SQL: | SELECT name FROM shipments AS shp
WHERE value > (
SELECT AVG(salary) FROM employees AS emp
WHERE emp.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_00900 | train | T2 |
v1 | Schema:
managers (alias: mgr)(id, date, code, level)
employees(code, status, value, amount)
Task: Find value from managers where status appears in employees entries with matching id.
SQL: | SELECT value FROM managers AS mgr
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_00901 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(name, level, salary, type)
orders(type, value, name, date)
Task: Retrieve amount from warehouses with value above the COUNT(salary) of orders rows sharing the same level.
SQL: | SELECT amount FROM warehouses AS whs
WHERE value > (
SELECT COUNT(salary) FROM orders AS ord
WHERE ord.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "orders",
"outer_alias": "whs",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_00902 | train | T2 |
v3 | Schema:
transactions (alias: txn)(status, code, date, value)
products(type, code, status, value)
Task: Retrieve code from transactions with salary above the COUNT(salary) of products rows sharing the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE salary > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_00903 | train | T1 |
v2 | Schema:
services (alias: srvc)(status, date, code, name)
transactions(amount, date, code, type)
Task: Retrieve name from services that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT name FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "transactions",
"outer_alias": "srvc",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_00904 | train | T2 |
v1 | Schema:
invoices (alias: inv)(code, date, type, name)
sales(salary, date, amount, status)
Task: Select name from invoices where code exists in sales for the same level.
SQL: | SELECT name FROM invoices AS inv
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_00905 | train | T1 |
v1 | Schema:
products (alias: prod)(amount, type, date, status)
warehouses(code, type, status, date)
Task: Find salary from products where status appears in warehouses entries with matching code.
SQL: | SELECT salary FROM products AS prod
WHERE status IN (
SELECT status FROM warehouses AS whs
WHERE whs.code = prod.code
); | {
"outer_table": "products",
"inner_table": "warehouses",
"outer_alias": "prod",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_00906 | train | T1 |
v1 | Schema:
accounts (alias: acct)(id, amount, name, date)
shipments(date, id, code, status)
Task: Select amount from accounts where level exists in shipments for the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_00907 | train | T1 |
v2 | Schema:
products (alias: prod)(salary, type, code, amount)
departments(code, type, date, id)
Task: Find value from products where a matching record exists in departments with the same status.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = prod.status
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_00908 | train | T1 |
v1 | Schema:
budgets (alias: budg)(salary, name, status, type)
invoices(code, date, amount, id)
Task: Retrieve id from budgets whose type is found in invoices rows where level matches the outer record.
SQL: | SELECT id FROM budgets AS budg
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "invoices",
"outer_alias": "budg",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_00909 | train | T2 |
v2 | Schema:
items (alias: lne)(code, date, name, value)
transactions(status, code, date, level)
Task: Retrieve salary from items that have at least one corresponding entry in transactions sharing the same type.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = lne.type
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_00910 | train | T2 |
v1 | Schema:
invoices (alias: inv)(salary, amount, status, value)
orders(amount, type, value, name)
Task: Find id from invoices where id appears in orders entries with matching status.
SQL: | SELECT id FROM invoices AS inv
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_00911 | train | T1 |
v3 | Schema:
managers (alias: mgr)(name, level, code, type)
categories(code, type, status, level)
Task: Retrieve name from managers with value above the MAX(value) of categories rows sharing the same level.
SQL: | SELECT name FROM managers AS mgr
WHERE value > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_00912 | train | T1 |
v2 | Schema:
shipments (alias: shp)(date, name, id, level)
accounts(value, status, type, level)
Task: Retrieve code from shipments that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_00913 | train | T2 |
v2 | Schema:
staff (alias: empl)(name, value, id, status)
services(code, salary, type, status)
Task: Retrieve code from staff that have at least one corresponding entry in services sharing the same type.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "services",
"outer_alias": "empl",
"inner_alias": "srvc",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_00914 | train | T2 |
v1 | Schema:
categories (alias: catg)(date, salary, value, status)
services(code, date, status, type)
Task: Retrieve value from categories whose type is found in services rows where level matches the outer record.
SQL: | SELECT value FROM categories AS catg
WHERE type IN (
SELECT type FROM services AS srvc
WHERE srvc.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "services",
"outer_alias": "catg",
"inner_alias": "srvc",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_00915 | train | T2 |
v1 | Schema:
regions (alias: rgn)(date, code, amount, value)
transactions(level, salary, amount, type)
Task: Select amount from regions where code exists in transactions for the same id.
SQL: | SELECT amount FROM regions AS rgn
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_00916 | train | T2 |
v1 | Schema:
departments (alias: dept)(salary, amount, type, status)
budgets(date, name, salary, value)
Task: Retrieve name from departments whose type is found in budgets rows where code matches the outer record.
SQL: | SELECT name FROM departments AS dept
WHERE type IN (
SELECT type FROM budgets AS budg
WHERE budg.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "budgets",
"outer_alias": "dept",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_00917 | train | T1 |
v2 | Schema:
schedules (alias: schd)(name, id, value, code)
categories(code, date, salary, status)
Task: Find id from schedules where a matching record exists in categories with the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_00918 | train | T2 |
v1 | Schema:
regions (alias: rgn)(salary, date, level, name)
shipments(name, value, type, amount)
Task: Select amount from regions where status exists in shipments for the same id.
SQL: | SELECT amount FROM regions AS rgn
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_00919 | train | T2 |
v1 | Schema:
managers (alias: mgr)(id, status, name, date)
customers(amount, level, salary, value)
Task: Find amount from managers where level appears in customers entries with matching status.
SQL: | SELECT amount FROM managers AS mgr
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_00920 | train | T1 |
v2 | Schema:
departments (alias: dept)(name, value, salary, type)
shipments(id, amount, value, level)
Task: Retrieve code from departments that have at least one corresponding entry in shipments sharing the same status.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_00921 | train | T1 |
v1 | Schema:
orders (alias: ord)(code, type, name, value)
regions(salary, amount, status, level)
Task: Retrieve value from orders whose type is found in regions rows where code matches the outer record.
SQL: | SELECT value FROM orders AS ord
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_00922 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(status, date, value, id)
regions(status, amount, code, type)
Task: Retrieve amount from warehouses whose level is found in regions rows where status matches the outer record.
SQL: | SELECT amount FROM warehouses AS whs
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "regions",
"outer_alias": "whs",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_00923 | train | T2 |
v3 | Schema:
schedules (alias: schd)(date, type, status, value)
warehouses(name, type, value, code)
Task: Find salary from schedules where value exceeds the average value from warehouses for the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE value > (
SELECT MAX(value) FROM warehouses AS whs
WHERE whs.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "warehouses",
"outer_alias": "schd",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_00924 | train | T2 |
v3 | Schema:
sales (alias: sale)(level, salary, status, name)
managers(code, value, date, salary)
Task: Find amount from sales where salary exceeds the average amount from managers for the same level.
SQL: | SELECT amount FROM sales AS sale
WHERE salary > (
SELECT SUM(amount) FROM managers AS mgr
WHERE mgr.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_00925 | train | T1 |
v2 | Schema:
managers (alias: mgr)(type, code, id, name)
categories(id, code, amount, type)
Task: Find id from managers where a matching record exists in categories with the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_00926 | train | T1 |
v1 | Schema:
budgets (alias: budg)(type, date, name, level)
staff(date, name, type, code)
Task: Retrieve name from budgets whose id is found in staff rows where id matches the outer record.
SQL: | SELECT name FROM budgets AS budg
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "staff",
"outer_alias": "budg",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_00927 | train | T2 |
v3 | Schema:
managers (alias: mgr)(value, code, salary, status)
requests(date, value, amount, type)
Task: Retrieve code from managers with salary above the AVG(salary) of requests rows sharing the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE salary > (
SELECT AVG(salary) FROM requests AS ordr
WHERE ordr.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_00928 | train | T1 |
v1 | Schema:
departments (alias: dept)(id, salary, amount, type)
warehouses(date, code, name, amount)
Task: Select value from departments where id exists in warehouses for the same id.
SQL: | SELECT value FROM departments AS dept
WHERE id IN (
SELECT id FROM warehouses AS whs
WHERE whs.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "warehouses",
"outer_alias": "dept",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_00929 | train | T1 |
v1 | Schema:
shipments (alias: shp)(salary, amount, value, status)
products(name, id, code, amount)
Task: Retrieve code from shipments whose code is found in products rows where code matches the outer record.
SQL: | SELECT code FROM shipments AS shp
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_00930 | train | T2 |
v3 | Schema:
regions (alias: rgn)(level, status, amount, type)
sales(value, date, code, id)
Task: Find value from regions where salary exceeds the average amount from sales for the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE salary > (
SELECT MIN(amount) FROM sales AS sale
WHERE sale.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_00931 | train | T2 |
v3 | Schema:
services (alias: srvc)(name, id, code, level)
staff(status, id, name, type)
Task: Retrieve salary from services with value above the MIN(value) of staff rows sharing the same level.
SQL: | SELECT salary FROM services AS srvc
WHERE value > (
SELECT MIN(value) FROM staff AS empl
WHERE empl.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "staff",
"outer_alias": "srvc",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_00932 | train | T2 |
v3 | Schema:
regions (alias: rgn)(salary, code, amount, id)
budgets(code, salary, status, date)
Task: Find amount from regions where value exceeds the average salary from budgets for the same type.
SQL: | SELECT amount FROM regions AS rgn
WHERE value > (
SELECT SUM(salary) FROM budgets AS budg
WHERE budg.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "budgets",
"outer_alias": "rgn",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_00933 | train | T2 |
v1 | Schema:
regions (alias: rgn)(salary, id, code, date)
warehouses(status, level, id, date)
Task: Retrieve amount from regions whose id is found in warehouses rows where level matches the outer record.
SQL: | SELECT amount FROM regions AS rgn
WHERE id IN (
SELECT id FROM warehouses AS whs
WHERE whs.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "warehouses",
"outer_alias": "rgn",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_00934 | train | T2 |
v3 | Schema:
sales (alias: sale)(value, amount, id, code)
invoices(level, date, type, amount)
Task: Find value from sales where value exceeds the average salary from invoices for the same status.
SQL: | SELECT value FROM sales AS sale
WHERE value > (
SELECT MAX(salary) FROM invoices AS inv
WHERE inv.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_00935 | train | T1 |
v3 | Schema:
budgets (alias: budg)(code, amount, date, level)
staff(amount, type, value, code)
Task: Retrieve id from budgets with value above the MAX(value) of staff rows sharing the same status.
SQL: | SELECT id FROM budgets AS budg
WHERE value > (
SELECT MAX(value) FROM staff AS empl
WHERE empl.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "staff",
"outer_alias": "budg",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_00936 | train | T2 |
v3 | Schema:
sales (alias: sale)(name, amount, value, date)
accounts(value, salary, amount, date)
Task: Retrieve amount from sales with salary above the MAX(salary) of accounts rows sharing the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE salary > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_00937 | train | T1 |
v2 | Schema:
orders (alias: ord)(name, value, code, level)
managers(type, salary, status, value)
Task: Find value from orders where a matching record exists in managers with the same type.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_00938 | train | T1 |
v3 | Schema:
invoices (alias: inv)(amount, salary, value, id)
warehouses(code, type, salary, date)
Task: Retrieve salary from invoices with amount above the COUNT(salary) of warehouses rows sharing the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE amount > (
SELECT COUNT(salary) FROM warehouses AS whs
WHERE whs.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "warehouses",
"outer_alias": "inv",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_00939 | train | T1 |
v1 | Schema:
categories (alias: catg)(id, level, name, amount)
budgets(name, type, id, level)
Task: Find amount from categories where code appears in budgets entries with matching status.
SQL: | SELECT amount FROM categories AS catg
WHERE code IN (
SELECT code FROM budgets AS budg
WHERE budg.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "budgets",
"outer_alias": "catg",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_00940 | train | T2 |
v2 | Schema:
staff (alias: empl)(value, amount, type, salary)
schedules(amount, value, id, type)
Task: Find code from staff where a matching record exists in schedules with the same status.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_00941 | train | T2 |
v1 | Schema:
shipments (alias: shp)(level, salary, id, name)
services(level, status, amount, salary)
Task: Select id from shipments where type exists in services for the same type.
SQL: | SELECT id FROM shipments AS shp
WHERE type IN (
SELECT type FROM services AS srvc
WHERE srvc.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "services",
"outer_alias": "shp",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_00942 | train | T2 |
v2 | Schema:
requests (alias: ordr)(code, value, level, salary)
transactions(name, level, status, type)
Task: Find value from requests where a matching record exists in transactions with the same status.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_00943 | train | T2 |
v1 | Schema:
services (alias: srvc)(value, code, name, salary)
budgets(status, amount, salary, date)
Task: Find id from services where id appears in budgets entries with matching type.
SQL: | SELECT id FROM services AS srvc
WHERE id IN (
SELECT id FROM budgets AS budg
WHERE budg.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "budgets",
"outer_alias": "srvc",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_00944 | train | T2 |
v1 | Schema:
managers (alias: mgr)(name, code, level, amount)
requests(date, amount, type, status)
Task: Retrieve salary from managers whose code is found in requests rows where level matches the outer record.
SQL: | SELECT salary FROM managers AS mgr
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_00945 | train | T1 |
v1 | Schema:
departments (alias: dept)(code, amount, id, status)
invoices(level, value, date, amount)
Task: Select value from departments where type exists in invoices for the same code.
SQL: | SELECT value FROM departments AS dept
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "invoices",
"outer_alias": "dept",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_00946 | train | T1 |
v2 | Schema:
items (alias: lne)(status, level, amount, date)
regions(name, id, code, amount)
Task: Retrieve name from items that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = lne.type
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_00947 | train | T2 |
v2 | Schema:
sales (alias: sale)(id, level, value, status)
employees(salary, value, type, name)
Task: Find salary from sales where a matching record exists in employees with the same id.
SQL: | SELECT salary 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": "salary",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_00948 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(salary, level, id, status)
sales(code, status, value, type)
Task: Select id from warehouses where status exists in sales for the same type.
SQL: | SELECT id FROM warehouses AS whs
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "sales",
"outer_alias": "whs",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_00949 | train | T2 |
v2 | Schema:
employees (alias: emp)(code, type, status, salary)
orders(name, value, level, amount)
Task: Retrieve name from employees that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_00950 | train | T1 |
v3 | Schema:
requests (alias: ordr)(code, amount, salary, date)
shipments(status, date, level, code)
Task: Retrieve id from requests with amount above the AVG(salary) of shipments rows sharing the same level.
SQL: | SELECT id FROM requests AS ordr
WHERE amount > (
SELECT AVG(salary) FROM shipments AS shp
WHERE shp.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_00951 | train | T2 |
v2 | Schema:
orders (alias: ord)(value, name, id, type)
budgets(amount, id, status, salary)
Task: Retrieve amount from orders that have at least one corresponding entry in budgets sharing the same id.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "budgets",
"outer_alias": "ord",
"inner_alias": "budg",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_00952 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(type, date, level, name)
services(name, amount, value, date)
Task: Retrieve id from warehouses whose type is found in services rows where type matches the outer record.
SQL: | SELECT id FROM warehouses AS whs
WHERE type IN (
SELECT type FROM services AS srvc
WHERE srvc.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "services",
"outer_alias": "whs",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_00953 | train | T2 |
v3 | Schema:
orders (alias: ord)(name, status, amount, value)
employees(code, date, name, salary)
Task: Find name from orders where value exceeds the average salary from employees for the same level.
SQL: | SELECT name FROM orders AS ord
WHERE value > (
SELECT COUNT(salary) FROM employees AS emp
WHERE emp.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_00954 | train | T1 |
v1 | Schema:
schedules (alias: schd)(status, level, salary, date)
orders(level, salary, amount, id)
Task: Find name from schedules where code appears in orders entries with matching id.
SQL: | SELECT name FROM schedules AS schd
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_00955 | train | T2 |
v3 | Schema:
products (alias: prod)(status, level, code, salary)
staff(level, salary, id, date)
Task: Find code from products where salary exceeds the average amount from staff for the same type.
SQL: | SELECT code FROM products AS prod
WHERE salary > (
SELECT AVG(amount) FROM staff AS empl
WHERE empl.type = prod.type
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_00956 | train | T1 |
v3 | Schema:
customers (alias: cust)(date, value, type, status)
invoices(type, status, name, level)
Task: Retrieve code from customers with amount above the MAX(salary) of invoices rows sharing the same type.
SQL: | SELECT code FROM customers AS cust
WHERE amount > (
SELECT MAX(salary) FROM invoices AS inv
WHERE inv.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_00957 | train | T1 |
v3 | Schema:
regions (alias: rgn)(code, value, status, type)
orders(value, code, amount, level)
Task: Find code from regions where amount exceeds the average amount from orders for the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE amount > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_00958 | train | T2 |
v3 | Schema:
transactions (alias: txn)(value, code, amount, level)
accounts(value, id, level, salary)
Task: Find salary from transactions where amount exceeds the average salary from accounts for the same level.
SQL: | SELECT salary FROM transactions AS txn
WHERE amount > (
SELECT COUNT(salary) FROM accounts AS acct
WHERE acct.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_00959 | train | T1 |
v1 | Schema:
budgets (alias: budg)(name, id, value, type)
services(status, level, name, id)
Task: Retrieve amount from budgets whose level is found in services rows where type matches the outer record.
SQL: | SELECT amount FROM budgets AS budg
WHERE level IN (
SELECT level FROM services AS srvc
WHERE srvc.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "services",
"outer_alias": "budg",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_00960 | train | T2 |
v3 | Schema:
employees (alias: emp)(value, type, date, status)
customers(id, name, type, level)
Task: Retrieve value from employees with salary above the MIN(value) of customers rows sharing the same level.
SQL: | SELECT value FROM employees AS emp
WHERE salary > (
SELECT MIN(value) FROM customers AS cust
WHERE cust.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_00961 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(id, date, type, name)
customers(level, code, amount, salary)
Task: Find value from warehouses where code appears in customers entries with matching status.
SQL: | SELECT value FROM warehouses AS whs
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "customers",
"outer_alias": "whs",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_00962 | train | T2 |
v3 | Schema:
requests (alias: ordr)(status, code, level, type)
employees(date, level, salary, value)
Task: Find value from requests where value exceeds the average amount from employees for the same code.
SQL: | SELECT value FROM requests AS ordr
WHERE value > (
SELECT MAX(amount) FROM employees AS emp
WHERE emp.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_00963 | train | T2 |
v1 | Schema:
services (alias: srvc)(value, name, date, level)
sales(name, salary, value, id)
Task: Select code from services where type exists in sales for the same id.
SQL: | SELECT code FROM services AS srvc
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "sales",
"outer_alias": "srvc",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_00964 | train | T2 |
v2 | Schema:
orders (alias: ord)(status, name, date, salary)
shipments(id, amount, status, name)
Task: Retrieve amount from orders that have at least one corresponding entry in shipments sharing the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_00965 | train | T1 |
v1 | Schema:
staff (alias: empl)(status, amount, date, value)
orders(value, date, type, salary)
Task: Select id from staff where level exists in orders for the same type.
SQL: | SELECT id FROM staff AS empl
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_00966 | train | T2 |
v1 | Schema:
accounts (alias: acct)(date, type, code, salary)
invoices(status, name, id, salary)
Task: Select code from accounts where id exists in invoices for the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_00967 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(name, id, type, status)
regions(code, status, salary, value)
Task: Retrieve name from warehouses with salary above the MAX(value) of regions rows sharing the same type.
SQL: | SELECT name FROM warehouses AS whs
WHERE salary > (
SELECT MAX(value) FROM regions AS rgn
WHERE rgn.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "regions",
"outer_alias": "whs",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_00968 | train | T2 |
v2 | Schema:
transactions (alias: txn)(type, name, level, date)
customers(salary, name, status, code)
Task: Find code from transactions where a matching record exists in customers with the same type.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_00969 | train | T1 |
v1 | Schema:
schedules (alias: schd)(code, type, name, value)
budgets(code, salary, type, value)
Task: Select name from schedules where id exists in budgets for the same status.
SQL: | SELECT name FROM schedules AS schd
WHERE id IN (
SELECT id FROM budgets AS budg
WHERE budg.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "budgets",
"outer_alias": "schd",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_00970 | train | T2 |
v1 | Schema:
departments (alias: dept)(type, status, salary, amount)
requests(value, type, status, salary)
Task: Find value from departments where status appears in requests entries with matching level.
SQL: | SELECT value FROM departments AS dept
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_00971 | train | T1 |
v1 | Schema:
services (alias: srvc)(code, salary, type, id)
employees(code, value, level, status)
Task: Select name from services where level exists in employees for the same code.
SQL: | SELECT name FROM services AS srvc
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "employees",
"outer_alias": "srvc",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_00972 | train | T2 |
v3 | Schema:
staff (alias: empl)(type, value, name, level)
managers(level, id, type, date)
Task: Retrieve name from staff with salary above the AVG(amount) of managers rows sharing the same type.
SQL: | SELECT name FROM staff AS empl
WHERE salary > (
SELECT AVG(amount) FROM managers AS mgr
WHERE mgr.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_00973 | train | T2 |
v1 | Schema:
sales (alias: sale)(amount, salary, type, level)
accounts(amount, id, date, status)
Task: Retrieve id from sales whose type is found in accounts rows where id matches the outer record.
SQL: | SELECT id FROM sales AS sale
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_00974 | train | T1 |
v3 | Schema:
budgets (alias: budg)(status, type, amount, date)
managers(status, code, id, value)
Task: Find name from budgets where amount exceeds the average amount from managers for the same id.
SQL: | SELECT name FROM budgets AS budg
WHERE amount > (
SELECT MIN(amount) FROM managers AS mgr
WHERE mgr.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "managers",
"outer_alias": "budg",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_00975 | train | T2 |
v2 | Schema:
accounts (alias: acct)(salary, level, id, status)
orders(code, id, level, type)
Task: Retrieve id from accounts that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_00976 | train | T1 |
v2 | Schema:
categories (alias: catg)(date, level, code, salary)
items(code, date, amount, id)
Task: Find value from categories where a matching record exists in items with the same status.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_00977 | train | T2 |
v2 | Schema:
sales (alias: sale)(type, date, id, code)
orders(name, type, salary, id)
Task: Retrieve value from sales that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_00978 | train | T1 |
v2 | Schema:
categories (alias: catg)(value, status, name, salary)
items(amount, level, code, name)
Task: Find value from categories where a matching record exists in items with the same status.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_00979 | train | T2 |
v2 | Schema:
orders (alias: ord)(status, id, name, salary)
requests(level, value, code, id)
Task: Retrieve id from orders that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_00980 | train | T1 |
v3 | Schema:
invoices (alias: inv)(date, code, level, value)
staff(value, salary, id, name)
Task: Retrieve name from invoices with salary above the SUM(value) of staff rows sharing the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE salary > (
SELECT SUM(value) FROM staff AS empl
WHERE empl.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_00981 | train | T1 |
v3 | Schema:
accounts (alias: acct)(id, salary, value, status)
categories(date, salary, code, id)
Task: Find id from accounts where amount exceeds the average amount from categories for the same type.
SQL: | SELECT id FROM accounts AS acct
WHERE amount > (
SELECT SUM(amount) FROM categories AS catg
WHERE catg.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_00982 | train | T1 |
v2 | Schema:
managers (alias: mgr)(value, salary, code, id)
accounts(date, level, name, status)
Task: Retrieve id from managers that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_00983 | train | T1 |
v1 | Schema:
invoices (alias: inv)(amount, id, status, name)
products(type, date, amount, id)
Task: Select value from invoices where status exists in products for the same level.
SQL: | SELECT value FROM invoices AS inv
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_00984 | train | T1 |
v1 | Schema:
employees (alias: emp)(id, salary, value, level)
budgets(level, amount, type, name)
Task: Retrieve name from employees whose type is found in budgets rows where type matches the outer record.
SQL: | SELECT name FROM employees AS emp
WHERE type IN (
SELECT type FROM budgets AS budg
WHERE budg.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "budgets",
"outer_alias": "emp",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_00985 | train | T1 |
v2 | Schema:
regions (alias: rgn)(type, amount, value, level)
staff(id, name, salary, level)
Task: Find value from regions where a matching record exists in staff with the same level.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_00986 | train | T2 |
v3 | Schema:
customers (alias: cust)(name, id, amount, salary)
invoices(code, salary, status, amount)
Task: Find name from customers where amount exceeds the average value from invoices for the same level.
SQL: | SELECT name FROM customers AS cust
WHERE amount > (
SELECT COUNT(value) FROM invoices AS inv
WHERE inv.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_00987 | train | T1 |
v2 | Schema:
budgets (alias: budg)(name, code, id, amount)
invoices(code, level, type, name)
Task: Find id from budgets where a matching record exists in invoices with the same id.
SQL: | SELECT id FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "invoices",
"outer_alias": "budg",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_00988 | train | T2 |
v1 | Schema:
managers (alias: mgr)(status, level, id, salary)
sales(date, salary, id, value)
Task: Retrieve salary from managers whose level is found in sales rows where status matches the outer record.
SQL: | SELECT salary FROM managers AS mgr
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_00989 | train | T1 |
v2 | Schema:
sales (alias: sale)(value, code, id, level)
customers(type, level, code, name)
Task: Retrieve salary from sales that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_00990 | train | T1 |
v1 | Schema:
orders (alias: ord)(date, status, level, code)
departments(type, salary, status, id)
Task: Retrieve name from orders whose level is found in departments rows where type matches the outer record.
SQL: | SELECT name FROM orders AS ord
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_00991 | train | T1 |
v1 | Schema:
products (alias: prod)(level, name, amount, date)
budgets(status, type, level, id)
Task: Find value from products where status appears in budgets entries with matching status.
SQL: | SELECT value FROM products AS prod
WHERE status IN (
SELECT status FROM budgets AS budg
WHERE budg.status = prod.status
); | {
"outer_table": "products",
"inner_table": "budgets",
"outer_alias": "prod",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_00992 | train | T1 |
v2 | Schema:
products (alias: prod)(date, type, id, name)
regions(name, code, level, salary)
Task: Find name from products where a matching record exists in regions with the same status.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = prod.status
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_00993 | train | T1 |
v1 | Schema:
managers (alias: mgr)(id, code, salary, type)
schedules(type, value, code, date)
Task: Select code from managers where type exists in schedules for the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_00994 | train | T1 |
v3 | Schema:
employees (alias: emp)(id, value, type, level)
sales(name, value, amount, salary)
Task: Find id from employees where amount exceeds the average value from sales for the same level.
SQL: | SELECT id FROM employees AS emp
WHERE amount > (
SELECT COUNT(value) FROM sales AS sale
WHERE sale.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_00995 | train | T1 |
v2 | Schema:
shipments (alias: shp)(name, status, date, amount)
orders(date, value, amount, salary)
Task: Find id from shipments where a matching record exists in orders with the same level.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_00996 | train | T2 |
v1 | Schema:
staff (alias: empl)(value, code, salary, date)
shipments(code, name, level, status)
Task: Retrieve code from staff whose code is found in shipments rows where type matches the outer record.
SQL: | SELECT code FROM staff AS empl
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_00997 | train | T2 |
v1 | Schema:
customers (alias: cust)(type, level, id, date)
managers(id, salary, value, type)
Task: Select amount from customers where level exists in managers for the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_00998 | train | T1 |
v1 | Schema:
services (alias: srvc)(salary, type, code, value)
departments(value, status, name, amount)
Task: Select value from services where type exists in departments for the same status.
SQL: | SELECT value FROM services AS srvc
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "departments",
"outer_alias": "srvc",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_00999 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.