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 |
|---|---|---|---|---|---|---|
v1 | Schema:
items (alias: lne)(code, amount, salary, date)
invoices(name, status, level, id)
Task: Select id from items where id exists in invoices for the same code.
SQL: | SELECT id FROM items AS lne
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.code = lne.code
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_03900 | train | T2 |
v1 | Schema:
customers (alias: cust)(status, amount, name, type)
warehouses(value, type, date, level)
Task: Select salary from customers where status exists in warehouses for the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE status IN (
SELECT status FROM warehouses AS whs
WHERE whs.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "warehouses",
"outer_alias": "cust",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_03901 | train | T1 |
v1 | Schema:
transactions (alias: txn)(status, id, type, code)
categories(amount, status, date, name)
Task: Retrieve code from transactions whose code is found in categories rows where code matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_03902 | train | T1 |
v3 | Schema:
transactions (alias: txn)(type, value, code, name)
employees(date, salary, id, amount)
Task: Retrieve salary from transactions with amount above the AVG(salary) of employees rows sharing the same type.
SQL: | SELECT salary FROM transactions AS txn
WHERE amount > (
SELECT AVG(salary) FROM employees AS emp
WHERE emp.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_03903 | train | T1 |
v1 | Schema:
managers (alias: mgr)(level, date, status, name)
sales(name, salary, code, status)
Task: Select id from managers where type exists in sales for the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_03904 | train | T1 |
v1 | Schema:
categories (alias: catg)(salary, value, date, name)
requests(code, type, date, salary)
Task: Retrieve code from categories whose code is found in requests rows where id matches the outer record.
SQL: | SELECT code FROM categories AS catg
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_03905 | train | T2 |
v1 | Schema:
sales (alias: sale)(status, id, level, value)
staff(id, amount, type, value)
Task: Find id from sales where type appears in staff entries with matching id.
SQL: | SELECT id FROM sales AS sale
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_03906 | train | T1 |
v3 | Schema:
invoices (alias: inv)(date, type, id, amount)
budgets(value, code, salary, date)
Task: Retrieve id from invoices with amount above the MIN(amount) of budgets rows sharing the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE amount > (
SELECT MIN(amount) FROM budgets AS budg
WHERE budg.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "budgets",
"outer_alias": "inv",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_03907 | train | T1 |
v2 | Schema:
managers (alias: mgr)(level, value, status, amount)
customers(salary, code, level, value)
Task: Find id from managers where a matching record exists in customers with the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_03908 | train | T1 |
v1 | Schema:
categories (alias: catg)(type, id, level, date)
sales(date, type, amount, name)
Task: Retrieve id from categories whose level is found in sales rows where code matches the outer record.
SQL: | SELECT id FROM categories AS catg
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_03909 | train | T2 |
v1 | Schema:
services (alias: srvc)(value, code, id, date)
warehouses(status, value, name, code)
Task: Select salary from services where code exists in warehouses for the same code.
SQL: | SELECT salary FROM services AS srvc
WHERE code IN (
SELECT code FROM warehouses AS whs
WHERE whs.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "warehouses",
"outer_alias": "srvc",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_03910 | train | T2 |
v3 | Schema:
requests (alias: ordr)(type, name, id, salary)
managers(amount, type, salary, id)
Task: Find amount from requests where value exceeds the average value from managers for the same code.
SQL: | SELECT amount FROM requests AS ordr
WHERE value > (
SELECT SUM(value) FROM managers AS mgr
WHERE mgr.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_03911 | train | T2 |
v3 | Schema:
customers (alias: cust)(id, value, code, level)
schedules(type, amount, date, level)
Task: Retrieve code from customers with salary above the SUM(amount) of schedules rows sharing the same id.
SQL: | SELECT code FROM customers AS cust
WHERE salary > (
SELECT SUM(amount) FROM schedules AS schd
WHERE schd.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_03912 | train | T1 |
v3 | Schema:
services (alias: srvc)(status, level, code, amount)
orders(type, amount, id, value)
Task: Find salary from services where amount exceeds the average salary from orders for the same type.
SQL: | SELECT salary FROM services AS srvc
WHERE amount > (
SELECT MAX(salary) FROM orders AS ord
WHERE ord.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "orders",
"outer_alias": "srvc",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_03913 | train | T2 |
v2 | Schema:
staff (alias: empl)(date, id, code, value)
shipments(salary, amount, type, id)
Task: Find salary from staff where a matching record exists in shipments with the same status.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_03914 | train | T2 |
v2 | Schema:
schedules (alias: schd)(amount, status, type, value)
employees(level, name, value, salary)
Task: Find id from schedules where a matching record exists in employees with the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_03915 | train | T2 |
v3 | Schema:
regions (alias: rgn)(value, status, code, date)
categories(name, amount, level, id)
Task: Find code from regions where amount exceeds the average value from categories for the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE amount > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_03916 | train | T2 |
v3 | Schema:
requests (alias: ordr)(level, value, code, type)
products(id, type, code, date)
Task: Find amount from requests where salary exceeds the average value from products for the same id.
SQL: | SELECT amount FROM requests AS ordr
WHERE salary > (
SELECT COUNT(value) FROM products AS prod
WHERE prod.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_03917 | train | T2 |
v1 | Schema:
shipments (alias: shp)(amount, status, id, value)
regions(value, type, level, name)
Task: Find name from shipments where id appears in regions entries with matching code.
SQL: | SELECT name FROM shipments AS shp
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_03918 | train | T2 |
v3 | Schema:
staff (alias: empl)(status, level, salary, value)
items(amount, salary, name, code)
Task: Find value from staff where salary exceeds the average value from items for the same code.
SQL: | SELECT value FROM staff AS empl
WHERE salary > (
SELECT AVG(value) FROM items AS lne
WHERE lne.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_03919 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(level, date, status, id)
customers(status, amount, type, salary)
Task: Retrieve value from warehouses whose level is found in customers rows where id matches the outer record.
SQL: | SELECT value FROM warehouses AS whs
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "customers",
"outer_alias": "whs",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_03920 | train | T2 |
v3 | Schema:
staff (alias: empl)(name, level, date, type)
sales(value, amount, salary, id)
Task: Find value from staff where value exceeds the average value from sales for the same id.
SQL: | SELECT value FROM staff AS empl
WHERE value > (
SELECT AVG(value) FROM sales AS sale
WHERE sale.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_03921 | train | T2 |
v3 | Schema:
budgets (alias: budg)(status, amount, type, value)
transactions(level, status, salary, value)
Task: Retrieve value from budgets with amount above the AVG(value) of transactions rows sharing the same status.
SQL: | SELECT value FROM budgets AS budg
WHERE amount > (
SELECT AVG(value) FROM transactions AS txn
WHERE txn.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "transactions",
"outer_alias": "budg",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_03922 | train | T2 |
v2 | Schema:
products (alias: prod)(type, amount, date, id)
transactions(code, type, date, name)
Task: Retrieve value from products that have at least one corresponding entry in transactions sharing the same code.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = prod.code
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_03923 | train | T1 |
v3 | Schema:
orders (alias: ord)(name, date, value, status)
budgets(date, code, name, amount)
Task: Retrieve value from orders with amount above the MIN(amount) of budgets rows sharing the same code.
SQL: | SELECT value FROM orders AS ord
WHERE amount > (
SELECT MIN(amount) FROM budgets AS budg
WHERE budg.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "budgets",
"outer_alias": "ord",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_03924 | train | T1 |
v3 | Schema:
products (alias: prod)(date, amount, code, type)
sales(status, date, salary, code)
Task: Retrieve amount from products with salary above the COUNT(amount) of sales rows sharing the same level.
SQL: | SELECT amount FROM products AS prod
WHERE salary > (
SELECT COUNT(amount) FROM sales AS sale
WHERE sale.level = prod.level
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_03925 | train | T1 |
v1 | Schema:
accounts (alias: acct)(salary, status, amount, value)
items(name, date, id, salary)
Task: Select salary from accounts where level exists in items for the same type.
SQL: | SELECT salary FROM accounts AS acct
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_03926 | train | T1 |
v3 | Schema:
staff (alias: empl)(status, amount, level, name)
categories(level, value, amount, name)
Task: Find name from staff where amount exceeds the average amount from categories for the same status.
SQL: | SELECT name FROM staff AS empl
WHERE amount > (
SELECT MIN(amount) FROM categories AS catg
WHERE catg.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_03927 | train | T2 |
v3 | Schema:
products (alias: prod)(salary, id, name, code)
employees(amount, name, code, type)
Task: Retrieve value from products with amount above the AVG(salary) of employees rows sharing the same status.
SQL: | SELECT value FROM products AS prod
WHERE amount > (
SELECT AVG(salary) FROM employees AS emp
WHERE emp.status = prod.status
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_03928 | train | T1 |
v1 | Schema:
schedules (alias: schd)(date, status, type, code)
products(value, id, name, amount)
Task: Retrieve salary from schedules whose id is found in products rows where status matches the outer record.
SQL: | SELECT salary FROM schedules AS schd
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_03929 | train | T2 |
v2 | Schema:
categories (alias: catg)(status, type, salary, level)
shipments(name, code, date, level)
Task: Find salary from categories where a matching record exists in shipments with the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_03930 | train | T2 |
v3 | Schema:
staff (alias: empl)(type, status, level, date)
budgets(amount, value, id, level)
Task: Find id from staff where salary exceeds the average salary from budgets for the same type.
SQL: | SELECT id FROM staff AS empl
WHERE salary > (
SELECT MAX(salary) FROM budgets AS budg
WHERE budg.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "budgets",
"outer_alias": "empl",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_03931 | train | T2 |
v1 | Schema:
categories (alias: catg)(level, value, salary, code)
transactions(id, date, level, status)
Task: Select salary from categories where status exists in transactions for the same id.
SQL: | SELECT salary FROM categories AS catg
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_03932 | train | T2 |
v2 | Schema:
accounts (alias: acct)(status, level, amount, name)
schedules(date, type, salary, status)
Task: Find id from accounts where a matching record exists in schedules with the same level.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_03933 | train | T1 |
v3 | Schema:
customers (alias: cust)(code, type, status, salary)
sales(id, level, name, value)
Task: Retrieve name from customers with amount above the SUM(amount) of sales rows sharing the same id.
SQL: | SELECT name FROM customers AS cust
WHERE amount > (
SELECT SUM(amount) FROM sales AS sale
WHERE sale.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_03934 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(id, value, level, status)
schedules(date, status, name, amount)
Task: Retrieve salary from warehouses whose id is found in schedules rows where id matches the outer record.
SQL: | SELECT salary FROM warehouses AS whs
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "schedules",
"outer_alias": "whs",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_03935 | train | T2 |
v3 | Schema:
services (alias: srvc)(date, value, id, type)
accounts(date, id, type, amount)
Task: Find code from services where salary exceeds the average value from accounts for the same code.
SQL: | SELECT code FROM services AS srvc
WHERE salary > (
SELECT MIN(value) FROM accounts AS acct
WHERE acct.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "accounts",
"outer_alias": "srvc",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_03936 | train | T2 |
v2 | Schema:
customers (alias: cust)(value, salary, date, level)
regions(date, id, name, code)
Task: Find name from customers where a matching record exists in regions with the same level.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_03937 | train | T1 |
v2 | Schema:
services (alias: srvc)(salary, value, code, amount)
employees(status, level, date, value)
Task: Find id from services where a matching record exists in employees with the same type.
SQL: | SELECT id FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "employees",
"outer_alias": "srvc",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_03938 | train | T2 |
v3 | Schema:
budgets (alias: budg)(date, name, type, value)
sales(date, name, code, status)
Task: Find code from budgets where salary exceeds the average value from sales for the same id.
SQL: | SELECT code FROM budgets AS budg
WHERE salary > (
SELECT SUM(value) FROM sales AS sale
WHERE sale.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "sales",
"outer_alias": "budg",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_03939 | train | T2 |
v1 | Schema:
schedules (alias: schd)(id, salary, date, level)
requests(amount, level, id, salary)
Task: Select value from schedules where id exists in requests for the same code.
SQL: | SELECT value FROM schedules AS schd
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_03940 | train | T2 |
v2 | Schema:
employees (alias: emp)(code, salary, type, level)
transactions(id, code, salary, type)
Task: Retrieve salary from employees that have at least one corresponding entry in transactions sharing the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_03941 | train | T1 |
v2 | Schema:
customers (alias: cust)(name, salary, value, id)
warehouses(salary, status, type, value)
Task: Find name from customers where a matching record exists in warehouses with the same level.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "warehouses",
"outer_alias": "cust",
"inner_alias": "whs",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_03942 | train | T1 |
v2 | Schema:
orders (alias: ord)(level, date, id, type)
staff(salary, date, level, code)
Task: Retrieve salary from orders that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_03943 | train | T1 |
v2 | Schema:
managers (alias: mgr)(code, status, type, date)
shipments(type, date, amount, code)
Task: Retrieve salary from managers that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_03944 | train | T1 |
v1 | Schema:
sales (alias: sale)(amount, type, status, code)
departments(level, value, amount, code)
Task: Find name from sales where code appears in departments entries with matching code.
SQL: | SELECT name FROM sales AS sale
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_03945 | train | T1 |
v1 | Schema:
departments (alias: dept)(date, level, salary, type)
budgets(code, date, salary, amount)
Task: Find id from departments where level appears in budgets entries with matching level.
SQL: | SELECT id FROM departments AS dept
WHERE level IN (
SELECT level FROM budgets AS budg
WHERE budg.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "budgets",
"outer_alias": "dept",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_03946 | train | T1 |
v1 | Schema:
staff (alias: empl)(status, salary, value, name)
budgets(code, id, amount, salary)
Task: Select value from staff where code exists in budgets for the same type.
SQL: | SELECT value FROM staff AS empl
WHERE code IN (
SELECT code FROM budgets AS budg
WHERE budg.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "budgets",
"outer_alias": "empl",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_03947 | train | T2 |
v1 | Schema:
shipments (alias: shp)(type, amount, code, name)
budgets(level, salary, type, id)
Task: Retrieve value from shipments whose status is found in budgets rows where status matches the outer record.
SQL: | SELECT value FROM shipments AS shp
WHERE status IN (
SELECT status FROM budgets AS budg
WHERE budg.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "budgets",
"outer_alias": "shp",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_03948 | train | T2 |
v3 | Schema:
schedules (alias: schd)(name, salary, value, date)
sales(salary, type, code, level)
Task: Retrieve code from schedules with amount above the COUNT(value) of sales rows sharing the same type.
SQL: | SELECT code FROM schedules AS schd
WHERE amount > (
SELECT COUNT(value) FROM sales AS sale
WHERE sale.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_03949 | train | T2 |
v3 | Schema:
departments (alias: dept)(status, amount, type, date)
products(value, date, salary, status)
Task: Retrieve salary from departments with salary above the AVG(value) of products rows sharing the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE salary > (
SELECT AVG(value) FROM products AS prod
WHERE prod.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_03950 | train | T1 |
v1 | Schema:
accounts (alias: acct)(id, salary, value, type)
budgets(date, salary, code, value)
Task: Select id from accounts where status exists in budgets for the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE status IN (
SELECT status FROM budgets AS budg
WHERE budg.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "budgets",
"outer_alias": "acct",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_03951 | train | T1 |
v2 | Schema:
staff (alias: empl)(date, type, status, salary)
orders(name, type, amount, level)
Task: Retrieve code from staff that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_03952 | train | T2 |
v1 | Schema:
budgets (alias: budg)(level, code, name, value)
accounts(id, amount, type, code)
Task: Find id from budgets where level appears in accounts entries with matching id.
SQL: | SELECT id FROM budgets AS budg
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "accounts",
"outer_alias": "budg",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_03953 | train | T2 |
v1 | Schema:
shipments (alias: shp)(id, type, code, amount)
warehouses(salary, value, code, amount)
Task: Find code from shipments where level appears in warehouses entries with matching level.
SQL: | SELECT code FROM shipments AS shp
WHERE level IN (
SELECT level FROM warehouses AS whs
WHERE whs.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "warehouses",
"outer_alias": "shp",
"inner_alias": "whs",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_03954 | train | T2 |
v2 | Schema:
employees (alias: emp)(type, date, salary, value)
warehouses(id, code, salary, level)
Task: Find salary from employees where a matching record exists in warehouses with the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "warehouses",
"outer_alias": "emp",
"inner_alias": "whs",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_03955 | train | T1 |
v1 | Schema:
invoices (alias: inv)(date, id, amount, level)
items(salary, value, amount, date)
Task: Find id from invoices where level appears in items entries with matching level.
SQL: | SELECT id FROM invoices AS inv
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_03956 | train | T1 |
v3 | Schema:
sales (alias: sale)(amount, level, date, name)
items(status, amount, level, name)
Task: Retrieve value from sales with salary above the AVG(value) of items rows sharing the same level.
SQL: | SELECT value FROM sales AS sale
WHERE salary > (
SELECT AVG(value) FROM items AS lne
WHERE lne.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_03957 | train | T1 |
v2 | Schema:
accounts (alias: acct)(amount, name, date, id)
products(type, date, id, status)
Task: Retrieve code from accounts that have at least one corresponding entry in products sharing the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_03958 | train | T1 |
v3 | Schema:
orders (alias: ord)(date, amount, level, status)
employees(salary, type, level, amount)
Task: Find id from orders where amount exceeds the average salary from employees for the same status.
SQL: | SELECT id FROM orders AS ord
WHERE amount > (
SELECT COUNT(salary) FROM employees AS emp
WHERE emp.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_03959 | train | T1 |
v3 | Schema:
products (alias: prod)(type, salary, amount, id)
categories(salary, level, name, amount)
Task: Find value from products where value exceeds the average salary from categories for the same status.
SQL: | SELECT value FROM products AS prod
WHERE value > (
SELECT SUM(salary) FROM categories AS catg
WHERE catg.status = prod.status
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_03960 | train | T1 |
v1 | Schema:
managers (alias: mgr)(date, type, name, value)
invoices(salary, status, id, value)
Task: Find value from managers where code appears in invoices entries with matching type.
SQL: | SELECT value FROM managers AS mgr
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_03961 | train | T1 |
v3 | Schema:
accounts (alias: acct)(value, salary, id, amount)
transactions(type, name, level, value)
Task: Retrieve value from accounts with value above the MAX(value) of transactions rows sharing the same status.
SQL: | SELECT value FROM accounts AS acct
WHERE value > (
SELECT MAX(value) FROM transactions AS txn
WHERE txn.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_03962 | train | T1 |
v3 | Schema:
employees (alias: emp)(value, code, salary, type)
schedules(id, date, level, code)
Task: Find value from employees where value exceeds the average value from schedules for the same id.
SQL: | SELECT value FROM employees AS emp
WHERE value > (
SELECT MAX(value) FROM schedules AS schd
WHERE schd.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_03963 | train | T1 |
v2 | Schema:
employees (alias: emp)(id, date, type, status)
services(code, date, type, name)
Task: Retrieve salary from employees that have at least one corresponding entry in services sharing the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "services",
"outer_alias": "emp",
"inner_alias": "srvc",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_03964 | train | T1 |
v1 | Schema:
categories (alias: catg)(status, value, date, name)
shipments(status, amount, level, code)
Task: Find name from categories where status appears in shipments entries with matching status.
SQL: | SELECT name FROM categories AS catg
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_03965 | train | T2 |
v1 | Schema:
invoices (alias: inv)(value, date, name, id)
warehouses(status, level, amount, type)
Task: Retrieve value from invoices whose id is found in warehouses rows where type matches the outer record.
SQL: | SELECT value FROM invoices AS inv
WHERE id IN (
SELECT id FROM warehouses AS whs
WHERE whs.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "warehouses",
"outer_alias": "inv",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_03966 | train | T1 |
v2 | Schema:
sales (alias: sale)(date, name, status, code)
shipments(salary, level, code, name)
Task: Find value from sales where a matching record exists in shipments with the same id.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_03967 | train | T1 |
v3 | Schema:
products (alias: prod)(type, id, salary, amount)
requests(date, salary, type, id)
Task: Find salary from products where salary exceeds the average amount from requests for the same type.
SQL: | SELECT salary FROM products AS prod
WHERE salary > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.type = prod.type
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_03968 | train | T1 |
v1 | Schema:
employees (alias: emp)(name, amount, value, type)
managers(id, salary, amount, status)
Task: Find id from employees where code appears in managers entries with matching id.
SQL: | SELECT id FROM employees AS emp
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_03969 | train | T1 |
v3 | Schema:
schedules (alias: schd)(status, value, type, date)
budgets(type, id, value, salary)
Task: Find id from schedules where value exceeds the average salary from budgets for the same type.
SQL: | SELECT id FROM schedules AS schd
WHERE value > (
SELECT SUM(salary) FROM budgets AS budg
WHERE budg.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "budgets",
"outer_alias": "schd",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_03970 | train | T2 |
v1 | Schema:
products (alias: prod)(type, amount, name, id)
managers(type, value, id, amount)
Task: Retrieve name from products whose status is found in managers rows where id matches the outer record.
SQL: | SELECT name FROM products AS prod
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.id = prod.id
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_03971 | train | T1 |
v2 | Schema:
sales (alias: sale)(id, salary, code, value)
transactions(amount, level, salary, name)
Task: Retrieve amount from sales that have at least one corresponding entry in transactions sharing the same code.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_03972 | train | T1 |
v3 | Schema:
sales (alias: sale)(value, code, type, level)
managers(type, code, status, name)
Task: Retrieve id from sales with salary above the AVG(value) of managers rows sharing the same level.
SQL: | SELECT id FROM sales AS sale
WHERE salary > (
SELECT AVG(value) FROM managers AS mgr
WHERE mgr.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_03973 | train | T1 |
v3 | Schema:
budgets (alias: budg)(type, status, code, date)
sales(date, amount, value, level)
Task: Find id from budgets where salary exceeds the average amount from sales for the same level.
SQL: | SELECT id FROM budgets AS budg
WHERE salary > (
SELECT AVG(amount) FROM sales AS sale
WHERE sale.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "sales",
"outer_alias": "budg",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_03974 | train | T2 |
v2 | Schema:
products (alias: prod)(amount, level, code, name)
transactions(salary, amount, value, level)
Task: Find name from products where a matching record exists in transactions with the same id.
SQL: | SELECT name 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": "name",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_03975 | train | T1 |
v3 | Schema:
orders (alias: ord)(date, status, name, value)
accounts(date, amount, name, code)
Task: Retrieve amount from orders with salary above the SUM(amount) of accounts rows sharing the same type.
SQL: | SELECT amount FROM orders AS ord
WHERE salary > (
SELECT SUM(amount) FROM accounts AS acct
WHERE acct.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_03976 | train | T1 |
v2 | Schema:
items (alias: lne)(salary, name, id, status)
employees(level, code, name, id)
Task: Retrieve amount from items that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = lne.code
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_03977 | train | T2 |
v3 | Schema:
orders (alias: ord)(level, status, value, code)
transactions(value, salary, date, level)
Task: Retrieve id from orders with salary above the AVG(salary) of transactions rows sharing the same id.
SQL: | SELECT id FROM orders AS ord
WHERE salary > (
SELECT AVG(salary) FROM transactions AS txn
WHERE txn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_03978 | train | T1 |
v1 | Schema:
orders (alias: ord)(code, amount, type, level)
warehouses(id, amount, salary, level)
Task: Retrieve code from orders whose type is found in warehouses rows where level matches the outer record.
SQL: | SELECT code FROM orders AS ord
WHERE type IN (
SELECT type FROM warehouses AS whs
WHERE whs.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "warehouses",
"outer_alias": "ord",
"inner_alias": "whs",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_03979 | train | T1 |
v3 | Schema:
regions (alias: rgn)(code, level, name, date)
orders(status, amount, type, salary)
Task: Retrieve id from regions with value above the SUM(amount) of orders rows sharing the same code.
SQL: | SELECT id FROM regions AS rgn
WHERE value > (
SELECT SUM(amount) FROM orders AS ord
WHERE ord.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_03980 | train | T2 |
v3 | Schema:
sales (alias: sale)(type, value, id, level)
categories(code, name, id, type)
Task: Retrieve code from sales with amount above the MAX(amount) of categories rows sharing the same level.
SQL: | SELECT code FROM sales AS sale
WHERE amount > (
SELECT MAX(amount) FROM categories AS catg
WHERE catg.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_03981 | train | T1 |
v2 | Schema:
budgets (alias: budg)(level, name, amount, value)
sales(name, salary, type, status)
Task: Retrieve code from budgets that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT code FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "sales",
"outer_alias": "budg",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_03982 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(date, code, amount, name)
regions(amount, type, status, id)
Task: Find name from warehouses where value exceeds the average value from regions for the same status.
SQL: | SELECT name FROM warehouses AS whs
WHERE value > (
SELECT SUM(value) FROM regions AS rgn
WHERE rgn.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "regions",
"outer_alias": "whs",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_03983 | train | T2 |
v3 | Schema:
services (alias: srvc)(status, name, id, code)
accounts(status, type, salary, id)
Task: Retrieve code from services with value above the MAX(value) of accounts rows sharing the same code.
SQL: | SELECT code FROM services AS srvc
WHERE value > (
SELECT MAX(value) FROM accounts AS acct
WHERE acct.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "accounts",
"outer_alias": "srvc",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_03984 | train | T2 |
v1 | Schema:
regions (alias: rgn)(value, name, amount, code)
warehouses(name, level, date, amount)
Task: Find code from regions where status appears in warehouses entries with matching status.
SQL: | SELECT code FROM regions AS rgn
WHERE status IN (
SELECT status FROM warehouses AS whs
WHERE whs.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "warehouses",
"outer_alias": "rgn",
"inner_alias": "whs",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_03985 | train | T2 |
v2 | Schema:
requests (alias: ordr)(type, level, date, salary)
items(status, value, amount, level)
Task: Find code from requests where a matching record exists in items with the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_03986 | train | T2 |
v3 | Schema:
staff (alias: empl)(value, date, status, amount)
items(amount, value, type, status)
Task: Retrieve amount from staff with value above the MIN(value) of items rows sharing the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE value > (
SELECT MIN(value) FROM items AS lne
WHERE lne.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_03987 | train | T2 |
v1 | Schema:
orders (alias: ord)(type, id, value, date)
regions(date, value, type, id)
Task: Select id from orders where level exists in regions for the same id.
SQL: | SELECT id FROM orders AS ord
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_03988 | train | T1 |
v2 | Schema:
schedules (alias: schd)(level, name, date, status)
staff(code, value, type, salary)
Task: Find salary from schedules where a matching record exists in staff with the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_03989 | train | T2 |
v3 | Schema:
categories (alias: catg)(type, date, level, id)
departments(status, salary, code, id)
Task: Find code from categories where salary exceeds the average salary from departments for the same id.
SQL: | SELECT code FROM categories AS catg
WHERE salary > (
SELECT MIN(salary) FROM departments AS dept
WHERE dept.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_03990 | train | T2 |
v2 | Schema:
managers (alias: mgr)(value, amount, salary, code)
products(type, name, value, level)
Task: Find id from managers where a matching record exists in products with the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_03991 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(date, value, id, salary)
schedules(salary, type, id, date)
Task: Find salary from warehouses where a matching record exists in schedules with the same type.
SQL: | SELECT salary FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "schedules",
"outer_alias": "whs",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_03992 | train | T2 |
v1 | Schema:
products (alias: prod)(salary, code, type, date)
employees(name, salary, level, type)
Task: Find salary from products where status appears in employees entries with matching code.
SQL: | SELECT salary FROM products AS prod
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.code = prod.code
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_03993 | train | T1 |
v2 | Schema:
departments (alias: dept)(value, amount, status, level)
sales(code, amount, name, salary)
Task: Find name from departments where a matching record exists in sales with the same type.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_03994 | train | T1 |
v2 | Schema:
categories (alias: catg)(salary, amount, name, level)
invoices(type, name, value, amount)
Task: Find value from categories where a matching record exists in invoices with the same status.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_03995 | train | T2 |
v3 | Schema:
invoices (alias: inv)(name, level, type, status)
departments(date, type, value, level)
Task: Find name from invoices where amount exceeds the average salary from departments for the same level.
SQL: | SELECT name FROM invoices AS inv
WHERE amount > (
SELECT AVG(salary) FROM departments AS dept
WHERE dept.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_03996 | train | T1 |
v2 | Schema:
orders (alias: ord)(date, type, value, level)
items(level, salary, status, amount)
Task: Find salary from orders where a matching record exists in items with the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_03997 | train | T1 |
v1 | Schema:
shipments (alias: shp)(date, amount, type, id)
customers(type, status, date, salary)
Task: Select value from shipments where id exists in customers for the same code.
SQL: | SELECT value FROM shipments AS shp
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_03998 | train | T2 |
v1 | Schema:
regions (alias: rgn)(amount, status, code, value)
accounts(salary, type, id, value)
Task: Retrieve value from regions whose status is found in accounts rows where level matches the outer record.
SQL: | SELECT value FROM regions AS rgn
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_03999 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.