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:
transactions (alias: txn)(amount, id, value, salary)
warehouses(name, value, date, salary)
Task: Find code from transactions where a matching record exists in warehouses with the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "warehouses",
"outer_alias": "txn",
"inner_alias": "whs",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_09000 | train | T1 |
v1 | Schema:
items (alias: lne)(code, type, id, name)
requests(level, date, type, code)
Task: Find amount from items where id appears in requests entries with matching type.
SQL: | SELECT amount FROM items AS lne
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.type = lne.type
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_09001 | train | T2 |
v2 | Schema:
sales (alias: sale)(amount, date, value, name)
customers(id, code, date, status)
Task: Find code from sales where a matching record exists in customers with the same id.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_09002 | train | T1 |
v2 | Schema:
categories (alias: catg)(date, type, amount, code)
shipments(value, id, status, code)
Task: Retrieve name from categories that have at least one corresponding entry in shipments sharing the same status.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_09003 | train | T2 |
v1 | Schema:
requests (alias: ordr)(date, status, amount, salary)
regions(date, status, id, type)
Task: Find amount from requests where code appears in regions entries with matching id.
SQL: | SELECT amount FROM requests AS ordr
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_09004 | train | T2 |
v2 | Schema:
products (alias: prod)(salary, status, level, name)
schedules(status, salary, type, level)
Task: Retrieve id from products that have at least one corresponding entry in schedules sharing the same type.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = prod.type
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_09005 | train | T1 |
v1 | Schema:
schedules (alias: schd)(code, id, date, type)
regions(id, type, salary, level)
Task: Retrieve amount from schedules whose type is found in regions rows where code matches the outer record.
SQL: | SELECT amount FROM schedules AS schd
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_09006 | train | T2 |
v2 | Schema:
sales (alias: sale)(code, name, date, amount)
departments(salary, type, name, level)
Task: Find amount from sales where a matching record exists in departments with the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_09007 | train | T1 |
v2 | Schema:
accounts (alias: acct)(level, salary, name, id)
invoices(status, value, name, amount)
Task: Find name from accounts where a matching record exists in invoices with the same id.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_09008 | train | T1 |
v2 | Schema:
sales (alias: sale)(level, status, salary, name)
schedules(type, level, amount, date)
Task: Retrieve amount from sales that have at least one corresponding entry in schedules sharing the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_09009 | train | T1 |
v3 | Schema:
managers (alias: mgr)(code, salary, status, date)
transactions(id, date, type, status)
Task: Retrieve name from managers with amount above the MAX(salary) of transactions rows sharing the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE amount > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_09010 | train | T1 |
v1 | Schema:
managers (alias: mgr)(date, salary, status, id)
customers(type, id, level, amount)
Task: Select code from managers where level exists in customers for the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_09011 | train | T1 |
v2 | Schema:
transactions (alias: txn)(type, level, name, salary)
invoices(amount, value, date, level)
Task: Retrieve amount from transactions that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_09012 | train | T1 |
v2 | Schema:
budgets (alias: budg)(code, value, level, id)
regions(type, amount, name, status)
Task: Retrieve name from budgets that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT name FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "regions",
"outer_alias": "budg",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_09013 | train | T2 |
v1 | Schema:
accounts (alias: acct)(level, date, type, amount)
customers(level, value, salary, code)
Task: Retrieve amount from accounts whose status is found in customers rows where id matches the outer record.
SQL: | SELECT amount FROM accounts AS acct
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_09014 | train | T1 |
v3 | Schema:
transactions (alias: txn)(code, amount, name, type)
schedules(amount, status, date, name)
Task: Retrieve id from transactions with amount above the MAX(salary) of schedules rows sharing the same type.
SQL: | SELECT id FROM transactions AS txn
WHERE amount > (
SELECT MAX(salary) FROM schedules AS schd
WHERE schd.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_09015 | train | T1 |
v1 | Schema:
items (alias: lne)(date, level, type, value)
transactions(id, value, type, code)
Task: Select salary from items where code exists in transactions for the same type.
SQL: | SELECT salary FROM items AS lne
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.type = lne.type
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_09016 | train | T2 |
v3 | Schema:
employees (alias: emp)(amount, status, salary, type)
warehouses(id, level, date, salary)
Task: Retrieve value from employees with value above the AVG(amount) of warehouses rows sharing the same id.
SQL: | SELECT value FROM employees AS emp
WHERE value > (
SELECT AVG(amount) FROM warehouses AS whs
WHERE whs.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "warehouses",
"outer_alias": "emp",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_09017 | train | T1 |
v2 | Schema:
sales (alias: sale)(id, salary, value, code)
invoices(salary, amount, id, status)
Task: Retrieve amount from sales that have at least one corresponding entry in invoices sharing the same level.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_09018 | train | T1 |
v1 | Schema:
orders (alias: ord)(code, name, level, status)
shipments(date, salary, status, code)
Task: Retrieve value from orders whose status is found in shipments rows where status matches the outer record.
SQL: | SELECT value FROM orders AS ord
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_09019 | train | T1 |
v1 | Schema:
schedules (alias: schd)(id, amount, date, level)
transactions(status, amount, date, salary)
Task: Retrieve name from schedules whose status is found in transactions rows where status matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_09020 | train | T2 |
v2 | Schema:
categories (alias: catg)(id, value, code, amount)
schedules(salary, code, name, level)
Task: Retrieve salary from categories that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_09021 | train | T2 |
v3 | Schema:
shipments (alias: shp)(type, status, date, id)
services(level, code, date, amount)
Task: Find code from shipments where salary exceeds the average amount from services for the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE salary > (
SELECT AVG(amount) FROM services AS srvc
WHERE srvc.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "services",
"outer_alias": "shp",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_09022 | train | T2 |
v1 | Schema:
shipments (alias: shp)(level, status, value, amount)
staff(code, amount, type, value)
Task: Select value from shipments where type exists in staff for the same type.
SQL: | SELECT value FROM shipments AS shp
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_09023 | train | T2 |
v1 | Schema:
regions (alias: rgn)(type, name, level, value)
schedules(type, amount, status, code)
Task: Find salary from regions where code appears in schedules entries with matching level.
SQL: | SELECT salary FROM regions AS rgn
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_09024 | train | T2 |
v3 | Schema:
requests (alias: ordr)(value, type, salary, level)
departments(code, date, type, value)
Task: Retrieve value from requests with salary above the SUM(value) of departments rows sharing the same code.
SQL: | SELECT value FROM requests AS ordr
WHERE salary > (
SELECT SUM(value) FROM departments AS dept
WHERE dept.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_09025 | train | T2 |
v1 | Schema:
staff (alias: empl)(value, name, type, id)
invoices(status, amount, salary, date)
Task: Retrieve name from staff whose status is found in invoices rows where level matches the outer record.
SQL: | SELECT name FROM staff AS empl
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_09026 | train | T2 |
v3 | Schema:
items (alias: lne)(salary, id, value, amount)
employees(date, status, name, value)
Task: Find salary from items where value exceeds the average amount from employees for the same status.
SQL: | SELECT salary FROM items AS lne
WHERE value > (
SELECT SUM(amount) FROM employees AS emp
WHERE emp.status = lne.status
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_09027 | train | T2 |
v3 | Schema:
categories (alias: catg)(value, name, date, type)
transactions(code, name, status, value)
Task: Retrieve name from categories with amount above the SUM(amount) of transactions rows sharing the same status.
SQL: | SELECT name FROM categories AS catg
WHERE amount > (
SELECT SUM(amount) FROM transactions AS txn
WHERE txn.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_09028 | train | T2 |
v1 | Schema:
departments (alias: dept)(amount, type, salary, value)
customers(code, date, level, status)
Task: Find value from departments where level appears in customers entries with matching code.
SQL: | SELECT value FROM departments AS dept
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_09029 | train | T1 |
v2 | Schema:
requests (alias: ordr)(name, value, amount, status)
shipments(type, id, amount, status)
Task: Retrieve salary from requests that have at least one corresponding entry in shipments sharing the same level.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_09030 | train | T2 |
v1 | Schema:
employees (alias: emp)(name, date, type, salary)
shipments(status, amount, code, name)
Task: Retrieve value from employees whose id is found in shipments rows where type matches the outer record.
SQL: | SELECT value FROM employees AS emp
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_09031 | train | T1 |
v3 | Schema:
transactions (alias: txn)(id, type, date, code)
regions(level, status, type, value)
Task: Retrieve code from transactions with value above the SUM(salary) of regions rows sharing the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE value > (
SELECT SUM(salary) FROM regions AS rgn
WHERE rgn.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_09032 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(level, name, code, salary)
transactions(salary, date, type, amount)
Task: Retrieve id from warehouses with value above the MIN(value) of transactions rows sharing the same type.
SQL: | SELECT id FROM warehouses AS whs
WHERE value > (
SELECT MIN(value) FROM transactions AS txn
WHERE txn.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "transactions",
"outer_alias": "whs",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_09033 | train | T2 |
v1 | Schema:
sales (alias: sale)(type, value, name, code)
departments(amount, status, code, salary)
Task: Find name from sales where type appears in departments entries with matching type.
SQL: | SELECT name FROM sales AS sale
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_09034 | train | T1 |
v3 | Schema:
schedules (alias: schd)(level, salary, value, name)
services(type, name, value, salary)
Task: Retrieve value from schedules with salary above the MAX(salary) of services rows sharing the same id.
SQL: | SELECT value FROM schedules AS schd
WHERE salary > (
SELECT MAX(salary) FROM services AS srvc
WHERE srvc.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "services",
"outer_alias": "schd",
"inner_alias": "srvc",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_09035 | train | T2 |
v1 | Schema:
invoices (alias: inv)(id, name, status, code)
shipments(status, code, date, amount)
Task: Retrieve salary from invoices whose code is found in shipments rows where id matches the outer record.
SQL: | SELECT salary FROM invoices AS inv
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_09036 | train | T1 |
v1 | Schema:
schedules (alias: schd)(salary, type, date, value)
shipments(type, salary, status, name)
Task: Retrieve name from schedules whose id is found in shipments rows where code matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_09037 | train | T2 |
v3 | Schema:
sales (alias: sale)(date, code, type, level)
categories(name, status, salary, amount)
Task: Retrieve code from sales with salary above the COUNT(amount) of categories rows sharing the same status.
SQL: | SELECT code FROM sales AS sale
WHERE salary > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_09038 | train | T1 |
v2 | Schema:
categories (alias: catg)(salary, date, status, amount)
requests(type, name, date, status)
Task: Retrieve salary from categories that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_09039 | train | T2 |
v3 | Schema:
transactions (alias: txn)(code, name, date, status)
sales(code, status, amount, id)
Task: Find id from transactions where value exceeds the average amount from sales for the same code.
SQL: | SELECT id FROM transactions AS txn
WHERE value > (
SELECT AVG(amount) FROM sales AS sale
WHERE sale.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_09040 | train | T1 |
v1 | Schema:
transactions (alias: txn)(amount, code, name, salary)
managers(amount, name, date, value)
Task: Retrieve salary from transactions whose status is found in managers rows where status matches the outer record.
SQL: | SELECT salary FROM transactions AS txn
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_09041 | train | T1 |
v2 | Schema:
staff (alias: empl)(code, status, date, type)
budgets(value, date, status, amount)
Task: Retrieve amount from staff that have at least one corresponding entry in budgets sharing the same type.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "budgets",
"outer_alias": "empl",
"inner_alias": "budg",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_09042 | train | T2 |
v1 | Schema:
budgets (alias: budg)(name, code, amount, salary)
transactions(level, code, value, id)
Task: Find code from budgets where code appears in transactions entries with matching code.
SQL: | SELECT code FROM budgets AS budg
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "transactions",
"outer_alias": "budg",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_09043 | train | T2 |
v1 | Schema:
invoices (alias: inv)(level, code, status, date)
requests(id, name, code, date)
Task: Retrieve amount from invoices whose status is found in requests rows where id matches the outer record.
SQL: | SELECT amount FROM invoices AS inv
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_09044 | train | T1 |
v3 | Schema:
staff (alias: empl)(amount, status, code, type)
transactions(level, value, status, date)
Task: Retrieve code from staff with value above the COUNT(amount) of transactions rows sharing the same id.
SQL: | SELECT code FROM staff AS empl
WHERE value > (
SELECT COUNT(amount) 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": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_09045 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(level, id, value, status)
items(amount, status, name, code)
Task: Find salary from warehouses where a matching record exists in items with the same type.
SQL: | SELECT salary FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "items",
"outer_alias": "whs",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_09046 | train | T2 |
v3 | Schema:
items (alias: lne)(code, level, type, amount)
invoices(salary, status, id, type)
Task: Find amount from items where amount exceeds the average value from invoices for the same status.
SQL: | SELECT amount FROM items AS lne
WHERE amount > (
SELECT AVG(value) FROM invoices AS inv
WHERE inv.status = lne.status
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_09047 | train | T2 |
v2 | Schema:
staff (alias: empl)(value, id, salary, date)
categories(salary, level, name, value)
Task: Retrieve code from staff that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_09048 | train | T2 |
v2 | Schema:
budgets (alias: budg)(status, type, name, level)
orders(amount, type, level, value)
Task: Retrieve salary from budgets that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT salary FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "orders",
"outer_alias": "budg",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_09049 | train | T2 |
v1 | Schema:
items (alias: lne)(code, date, salary, status)
regions(salary, date, amount, status)
Task: Retrieve salary from items whose status is found in regions rows where id matches the outer record.
SQL: | SELECT salary FROM items AS lne
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.id = lne.id
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_09050 | train | T2 |
v1 | Schema:
regions (alias: rgn)(date, salary, level, type)
orders(type, date, id, code)
Task: Find name from regions where level appears in orders entries with matching level.
SQL: | SELECT name FROM regions AS rgn
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_09051 | train | T2 |
v1 | Schema:
transactions (alias: txn)(name, amount, status, id)
services(id, amount, code, type)
Task: Find code from transactions where id appears in services entries with matching level.
SQL: | SELECT code FROM transactions AS txn
WHERE id IN (
SELECT id FROM services AS srvc
WHERE srvc.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "services",
"outer_alias": "txn",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_09052 | train | T1 |
v1 | Schema:
shipments (alias: shp)(id, code, salary, name)
orders(date, name, status, type)
Task: Find amount from shipments where id appears in orders entries with matching id.
SQL: | SELECT amount FROM shipments AS shp
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_09053 | train | T2 |
v2 | Schema:
services (alias: srvc)(amount, date, name, status)
sales(level, amount, code, name)
Task: Retrieve name from services that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT name FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "sales",
"outer_alias": "srvc",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_09054 | train | T2 |
v1 | Schema:
orders (alias: ord)(date, id, amount, salary)
categories(id, level, amount, status)
Task: Find salary from orders where id appears in categories entries with matching level.
SQL: | SELECT salary FROM orders AS ord
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_09055 | train | T1 |
v3 | Schema:
customers (alias: cust)(type, status, id, date)
warehouses(level, date, value, type)
Task: Retrieve name from customers with salary above the MAX(amount) of warehouses rows sharing the same type.
SQL: | SELECT name FROM customers AS cust
WHERE salary > (
SELECT MAX(amount) FROM warehouses AS whs
WHERE whs.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "warehouses",
"outer_alias": "cust",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_09056 | train | T1 |
v2 | Schema:
customers (alias: cust)(code, name, amount, status)
managers(name, type, salary, id)
Task: Retrieve id from customers that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_09057 | train | T1 |
v2 | Schema:
categories (alias: catg)(name, code, date, value)
budgets(value, level, id, code)
Task: Find amount from categories where a matching record exists in budgets with the same id.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "budgets",
"outer_alias": "catg",
"inner_alias": "budg",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_09058 | train | T2 |
v3 | Schema:
managers (alias: mgr)(salary, id, date, status)
shipments(status, type, value, name)
Task: Retrieve id from managers with salary above the SUM(salary) of shipments rows sharing the same id.
SQL: | SELECT id FROM managers AS mgr
WHERE salary > (
SELECT SUM(salary) FROM shipments AS shp
WHERE shp.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_09059 | train | T1 |
v2 | Schema:
requests (alias: ordr)(value, level, type, id)
categories(status, id, salary, code)
Task: Find id from requests where a matching record exists in categories with the same status.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_09060 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(value, status, salary, level)
items(date, type, level, id)
Task: Retrieve salary from warehouses whose status is found in items rows where status matches the outer record.
SQL: | SELECT salary FROM warehouses AS whs
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "items",
"outer_alias": "whs",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_09061 | train | T2 |
v3 | Schema:
services (alias: srvc)(value, date, level, type)
orders(status, salary, date, amount)
Task: Retrieve code from services with value above the MIN(salary) of orders rows sharing the same id.
SQL: | SELECT code FROM services AS srvc
WHERE value > (
SELECT MIN(salary) FROM orders AS ord
WHERE ord.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "orders",
"outer_alias": "srvc",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_09062 | train | T2 |
v3 | Schema:
departments (alias: dept)(date, code, level, name)
schedules(value, status, name, id)
Task: Retrieve salary from departments with salary above the COUNT(value) of schedules rows sharing the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE salary > (
SELECT COUNT(value) FROM schedules AS schd
WHERE schd.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_09063 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(salary, name, type, code)
schedules(code, status, id, amount)
Task: Retrieve id from warehouses with amount above the SUM(salary) of schedules rows sharing the same level.
SQL: | SELECT id FROM warehouses AS whs
WHERE amount > (
SELECT SUM(salary) FROM schedules AS schd
WHERE schd.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "schedules",
"outer_alias": "whs",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_09064 | train | T2 |
v3 | Schema:
products (alias: prod)(salary, type, date, status)
invoices(date, level, id, type)
Task: Retrieve amount from products with amount above the AVG(amount) of invoices rows sharing the same code.
SQL: | SELECT amount FROM products AS prod
WHERE amount > (
SELECT AVG(amount) FROM invoices AS inv
WHERE inv.code = prod.code
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_09065 | train | T1 |
v2 | Schema:
regions (alias: rgn)(amount, salary, date, id)
transactions(status, salary, id, level)
Task: Retrieve code from regions that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_09066 | train | T2 |
v3 | Schema:
employees (alias: emp)(date, id, value, code)
warehouses(status, date, type, value)
Task: Find amount from employees where salary exceeds the average value from warehouses for the same type.
SQL: | SELECT amount FROM employees AS emp
WHERE salary > (
SELECT SUM(value) FROM warehouses AS whs
WHERE whs.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "warehouses",
"outer_alias": "emp",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_09067 | train | T1 |
v1 | Schema:
schedules (alias: schd)(status, value, id, type)
warehouses(code, value, name, date)
Task: Select code from schedules where id exists in warehouses for the same level.
SQL: | SELECT code FROM schedules AS schd
WHERE id IN (
SELECT id FROM warehouses AS whs
WHERE whs.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "warehouses",
"outer_alias": "schd",
"inner_alias": "whs",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_09068 | train | T2 |
v3 | Schema:
orders (alias: ord)(salary, amount, value, code)
managers(code, type, name, date)
Task: Find code from orders where salary exceeds the average value from managers for the same type.
SQL: | SELECT code FROM orders AS ord
WHERE salary > (
SELECT MAX(value) FROM managers AS mgr
WHERE mgr.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_09069 | train | T1 |
v3 | Schema:
staff (alias: empl)(value, salary, type, name)
accounts(code, date, status, level)
Task: Retrieve amount from staff with value above the AVG(value) of accounts rows sharing the same code.
SQL: | SELECT amount FROM staff AS empl
WHERE value > (
SELECT AVG(value) FROM accounts AS acct
WHERE acct.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_09070 | train | T2 |
v2 | Schema:
products (alias: prod)(code, level, value, id)
transactions(code, date, name, value)
Task: Find id from products where a matching record exists in transactions with the same id.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = prod.id
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_09071 | train | T1 |
v1 | Schema:
managers (alias: mgr)(code, level, value, date)
requests(amount, level, code, date)
Task: Find name from managers where level appears in requests entries with matching level.
SQL: | SELECT name FROM managers AS mgr
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_09072 | train | T1 |
v3 | Schema:
sales (alias: sale)(date, type, salary, level)
shipments(salary, value, id, level)
Task: Retrieve code from sales with salary above the SUM(salary) of shipments rows sharing the same level.
SQL: | SELECT code FROM sales AS sale
WHERE salary > (
SELECT SUM(salary) FROM shipments AS shp
WHERE shp.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_09073 | train | T1 |
v3 | Schema:
shipments (alias: shp)(code, id, level, salary)
categories(level, amount, name, value)
Task: Find amount from shipments where value exceeds the average amount from categories for the same code.
SQL: | SELECT amount FROM shipments AS shp
WHERE value > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_09074 | train | T2 |
v2 | Schema:
departments (alias: dept)(value, date, amount, salary)
customers(value, level, date, code)
Task: Retrieve code from departments that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_09075 | train | T1 |
v1 | Schema:
shipments (alias: shp)(type, code, level, date)
warehouses(name, date, amount, code)
Task: Find name from shipments where status appears in warehouses entries with matching type.
SQL: | SELECT name FROM shipments AS shp
WHERE status IN (
SELECT status FROM warehouses AS whs
WHERE whs.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "warehouses",
"outer_alias": "shp",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_09076 | train | T2 |
v3 | Schema:
accounts (alias: acct)(amount, salary, level, date)
transactions(level, salary, name, value)
Task: Retrieve code from accounts with salary above the MIN(value) of transactions rows sharing the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE salary > (
SELECT MIN(value) FROM transactions AS txn
WHERE txn.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_09077 | train | T1 |
v2 | Schema:
customers (alias: cust)(code, status, amount, id)
budgets(level, status, amount, date)
Task: Retrieve amount from customers that have at least one corresponding entry in budgets sharing the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "budgets",
"outer_alias": "cust",
"inner_alias": "budg",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_09078 | train | T1 |
v2 | Schema:
items (alias: lne)(code, type, name, salary)
regions(salary, status, type, code)
Task: Find amount from items where a matching record exists in regions with the same id.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = lne.id
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_09079 | train | T2 |
v3 | Schema:
departments (alias: dept)(date, code, level, status)
budgets(name, value, status, type)
Task: Retrieve id from departments with amount above the COUNT(amount) of budgets rows sharing the same code.
SQL: | SELECT id FROM departments AS dept
WHERE amount > (
SELECT COUNT(amount) FROM budgets AS budg
WHERE budg.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "budgets",
"outer_alias": "dept",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_09080 | train | T1 |
v2 | Schema:
categories (alias: catg)(amount, name, type, code)
regions(name, level, date, id)
Task: Retrieve amount from categories that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_09081 | train | T2 |
v3 | Schema:
categories (alias: catg)(code, name, date, amount)
transactions(code, level, id, amount)
Task: Retrieve id from categories with value above the AVG(value) of transactions rows sharing the same status.
SQL: | SELECT id FROM categories AS catg
WHERE value > (
SELECT AVG(value) FROM transactions AS txn
WHERE txn.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_09082 | train | T2 |
v3 | Schema:
orders (alias: ord)(amount, code, date, status)
services(type, amount, id, status)
Task: Find name from orders where value exceeds the average value from services for the same code.
SQL: | SELECT name FROM orders AS ord
WHERE value > (
SELECT MAX(value) FROM services AS srvc
WHERE srvc.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "services",
"outer_alias": "ord",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_09083 | train | T1 |
v2 | Schema:
services (alias: srvc)(level, value, name, type)
regions(name, salary, type, level)
Task: Find name from services where a matching record exists in regions with the same level.
SQL: | SELECT name FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "regions",
"outer_alias": "srvc",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_09084 | train | T2 |
v1 | Schema:
items (alias: lne)(salary, date, code, value)
transactions(code, id, value, amount)
Task: Find value from items where level appears in transactions entries with matching status.
SQL: | SELECT value FROM items AS lne
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_09085 | train | T2 |
v2 | Schema:
products (alias: prod)(amount, code, level, salary)
regions(amount, type, id, date)
Task: Find id from products where a matching record exists in regions with the same type.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = prod.type
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_09086 | train | T1 |
v2 | Schema:
schedules (alias: schd)(value, code, id, status)
warehouses(value, code, id, level)
Task: Find amount from schedules where a matching record exists in warehouses with the same level.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "warehouses",
"outer_alias": "schd",
"inner_alias": "whs",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_09087 | train | T2 |
v1 | Schema:
accounts (alias: acct)(status, id, date, level)
departments(code, status, level, amount)
Task: Find code from accounts where level appears in departments entries with matching status.
SQL: | SELECT code FROM accounts AS acct
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_09088 | train | T1 |
v3 | Schema:
managers (alias: mgr)(salary, name, value, code)
services(salary, id, value, code)
Task: Find amount from managers where amount exceeds the average salary from services for the same code.
SQL: | SELECT amount FROM managers AS mgr
WHERE amount > (
SELECT MAX(salary) FROM services AS srvc
WHERE srvc.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "services",
"outer_alias": "mgr",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_09089 | train | T1 |
v3 | Schema:
categories (alias: catg)(id, code, amount, type)
accounts(value, id, name, type)
Task: Find name from categories where value exceeds the average amount from accounts for the same type.
SQL: | SELECT name FROM categories AS catg
WHERE value > (
SELECT MAX(amount) FROM accounts AS acct
WHERE acct.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_09090 | train | T2 |
v1 | Schema:
sales (alias: sale)(code, amount, name, type)
employees(amount, status, date, id)
Task: Find amount from sales where level appears in employees entries with matching type.
SQL: | SELECT amount FROM sales AS sale
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_09091 | train | T1 |
v1 | Schema:
regions (alias: rgn)(date, name, value, type)
categories(level, type, name, id)
Task: Find amount from regions where type appears in categories entries with matching status.
SQL: | SELECT amount FROM regions AS rgn
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_09092 | train | T2 |
v3 | Schema:
accounts (alias: acct)(status, date, type, level)
requests(level, salary, value, code)
Task: Retrieve name from accounts with amount above the MIN(salary) of requests rows sharing the same level.
SQL: | SELECT name FROM accounts AS acct
WHERE amount > (
SELECT MIN(salary) FROM requests AS ordr
WHERE ordr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_09093 | train | T1 |
v3 | Schema:
services (alias: srvc)(type, status, value, code)
orders(name, level, status, code)
Task: Retrieve name from services with salary above the COUNT(amount) of orders rows sharing the same level.
SQL: | SELECT name FROM services AS srvc
WHERE salary > (
SELECT COUNT(amount) FROM orders AS ord
WHERE ord.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "orders",
"outer_alias": "srvc",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_09094 | train | T2 |
v1 | Schema:
sales (alias: sale)(date, name, level, salary)
customers(type, level, value, code)
Task: Select name from sales where status exists in customers for the same type.
SQL: | SELECT name FROM sales AS sale
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_09095 | train | T1 |
v3 | Schema:
shipments (alias: shp)(id, name, date, code)
regions(date, name, code, type)
Task: Find value from shipments where value exceeds the average value from regions for the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE value > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_09096 | train | T2 |
v1 | Schema:
employees (alias: emp)(value, amount, salary, name)
categories(date, name, level, salary)
Task: Retrieve amount from employees whose code is found in categories rows where type matches the outer record.
SQL: | SELECT amount FROM employees AS emp
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_09097 | train | T1 |
v1 | Schema:
accounts (alias: acct)(level, date, status, code)
schedules(code, status, date, amount)
Task: Retrieve code from accounts whose status is found in schedules rows where type matches the outer record.
SQL: | SELECT code FROM accounts AS acct
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_09098 | train | T1 |
v3 | Schema:
managers (alias: mgr)(salary, status, code, date)
staff(salary, date, type, name)
Task: Retrieve salary from managers with amount above the COUNT(salary) of staff rows sharing the same type.
SQL: | SELECT salary FROM managers AS mgr
WHERE amount > (
SELECT COUNT(salary) FROM staff AS empl
WHERE empl.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_09099 | train | T1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.