variant stringclasses 3
values | prompt stringlengths 163 237 | sql stringlengths 103 143 | metadata unknown | id stringlengths 21 21 | split stringclasses 1
value | token_group stringclasses 2
values |
|---|---|---|---|---|---|---|
v3 | Schema:
budgets (alias: budg)(id, status, type, code)
items(type, name, level, value)
Task: Retrieve amount from budgets with amount above the SUM(value) of items rows sharing the same code.
SQL: | SELECT amount FROM budgets AS budg
WHERE amount > (
SELECT SUM(value) FROM items AS lne
WHERE lne.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "items",
"outer_alias": "budg",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_07100 | train | T2 |
v1 | Schema:
managers (alias: mgr)(amount, type, status, level)
sales(salary, amount, id, code)
Task: Retrieve salary from managers whose status is found in sales rows where id matches the outer record.
SQL: | SELECT salary FROM managers AS mgr
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_07101 | train | T1 |
v3 | Schema:
orders (alias: ord)(level, code, name, id)
schedules(name, salary, level, value)
Task: Retrieve code from orders with amount above the MAX(amount) of schedules rows sharing the same status.
SQL: | SELECT code FROM orders AS ord
WHERE amount > (
SELECT MAX(amount) FROM schedules AS schd
WHERE schd.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_07102 | train | T1 |
v2 | Schema:
budgets (alias: budg)(name, value, amount, status)
regions(status, id, date, code)
Task: Retrieve id from budgets that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT id 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": "id",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_07103 | train | T2 |
v2 | Schema:
regions (alias: rgn)(status, code, name, level)
invoices(value, level, type, date)
Task: Find amount from regions where a matching record exists in invoices with the same id.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_07104 | train | T2 |
v3 | Schema:
staff (alias: empl)(type, status, name, level)
items(value, id, status, name)
Task: Find id from staff where value exceeds the average value from items for the same status.
SQL: | SELECT id FROM staff AS empl
WHERE value > (
SELECT SUM(value) FROM items AS lne
WHERE lne.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_07105 | train | T2 |
v2 | Schema:
departments (alias: dept)(amount, salary, id, status)
shipments(type, code, value, amount)
Task: Retrieve id from departments that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_07106 | train | T1 |
v3 | Schema:
products (alias: prod)(salary, value, level, date)
schedules(name, date, value, code)
Task: Find id from products where value exceeds the average amount from schedules for the same code.
SQL: | SELECT id FROM products AS prod
WHERE value > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.code = prod.code
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_07107 | train | T1 |
v2 | Schema:
regions (alias: rgn)(value, amount, id, date)
requests(value, date, type, id)
Task: Find value from regions where a matching record exists in requests with the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_07108 | train | T2 |
v3 | Schema:
customers (alias: cust)(status, value, code, id)
orders(salary, code, name, amount)
Task: Find salary from customers where amount exceeds the average value from orders for the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE amount > (
SELECT MIN(value) FROM orders AS ord
WHERE ord.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_07109 | train | T1 |
v3 | Schema:
shipments (alias: shp)(value, salary, level, amount)
orders(status, type, level, id)
Task: Find name from shipments where value exceeds the average amount from orders for the same code.
SQL: | SELECT name FROM shipments AS shp
WHERE value > (
SELECT MIN(amount) FROM orders AS ord
WHERE ord.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_07110 | train | T2 |
v3 | Schema:
employees (alias: emp)(id, salary, status, type)
regions(code, level, id, status)
Task: Find salary from employees where value exceeds the average amount from regions for the same level.
SQL: | SELECT salary FROM employees AS emp
WHERE value > (
SELECT COUNT(amount) FROM regions AS rgn
WHERE rgn.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_07111 | train | T1 |
v2 | Schema:
categories (alias: catg)(amount, name, id, status)
products(salary, code, status, type)
Task: Retrieve id from categories that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_07112 | train | T2 |
v1 | Schema:
staff (alias: empl)(name, id, salary, code)
warehouses(code, status, amount, id)
Task: Find id from staff where code appears in warehouses entries with matching level.
SQL: | SELECT id FROM staff AS empl
WHERE code IN (
SELECT code FROM warehouses AS whs
WHERE whs.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "warehouses",
"outer_alias": "empl",
"inner_alias": "whs",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_07113 | train | T2 |
v2 | Schema:
budgets (alias: budg)(value, id, code, status)
shipments(id, level, code, status)
Task: Retrieve id from budgets that have at least one corresponding entry in shipments sharing the same level.
SQL: | SELECT id FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "shipments",
"outer_alias": "budg",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_07114 | train | T2 |
v3 | Schema:
services (alias: srvc)(salary, code, amount, date)
schedules(id, type, salary, amount)
Task: Retrieve value from services with amount above the MAX(value) of schedules rows sharing the same type.
SQL: | SELECT value FROM services AS srvc
WHERE amount > (
SELECT MAX(value) FROM schedules AS schd
WHERE schd.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "schedules",
"outer_alias": "srvc",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_07115 | train | T2 |
v2 | Schema:
orders (alias: ord)(id, level, salary, code)
regions(type, salary, value, status)
Task: Retrieve name from orders that have at least one corresponding entry in regions sharing the same code.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_07116 | train | T1 |
v2 | Schema:
sales (alias: sale)(salary, code, type, id)
staff(type, value, code, level)
Task: Retrieve name from sales that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_07117 | train | T1 |
v3 | Schema:
shipments (alias: shp)(id, status, level, name)
schedules(name, value, level, id)
Task: Find amount from shipments where value exceeds the average amount from schedules for the same code.
SQL: | SELECT amount FROM shipments AS shp
WHERE value > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"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_07118 | train | T2 |
v3 | Schema:
employees (alias: emp)(amount, code, value, salary)
managers(level, name, id, code)
Task: Retrieve name from employees with salary above the MIN(salary) of managers rows sharing the same type.
SQL: | SELECT name FROM employees AS emp
WHERE salary > (
SELECT MIN(salary) FROM managers AS mgr
WHERE mgr.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_07119 | train | T1 |
v3 | Schema:
orders (alias: ord)(level, code, salary, status)
staff(status, name, amount, value)
Task: Find amount from orders where amount exceeds the average salary from staff for the same id.
SQL: | SELECT amount FROM orders AS ord
WHERE amount > (
SELECT MIN(salary) FROM staff AS empl
WHERE empl.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_07120 | train | T1 |
v3 | Schema:
services (alias: srvc)(amount, salary, code, value)
categories(id, type, name, date)
Task: Retrieve value from services with amount above the SUM(amount) of categories rows sharing the same status.
SQL: | SELECT value FROM services AS srvc
WHERE amount > (
SELECT SUM(amount) FROM categories AS catg
WHERE catg.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "categories",
"outer_alias": "srvc",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_07121 | train | T2 |
v3 | Schema:
departments (alias: dept)(amount, id, type, date)
schedules(status, id, value, amount)
Task: Retrieve salary from departments with value above the AVG(amount) of schedules rows sharing the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE value > (
SELECT AVG(amount) FROM schedules AS schd
WHERE schd.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_07122 | train | T1 |
v3 | Schema:
shipments (alias: shp)(value, status, amount, date)
orders(value, salary, code, id)
Task: Retrieve value from shipments with amount above the AVG(salary) of orders rows sharing the same status.
SQL: | SELECT value FROM shipments AS shp
WHERE amount > (
SELECT AVG(salary) FROM orders AS ord
WHERE ord.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_07123 | train | T2 |
v3 | Schema:
customers (alias: cust)(id, status, date, level)
sales(date, level, status, type)
Task: Find amount from customers where salary exceeds the average value from sales for the same level.
SQL: | SELECT amount FROM customers AS cust
WHERE salary > (
SELECT MAX(value) FROM sales AS sale
WHERE sale.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_07124 | train | T1 |
v1 | Schema:
orders (alias: ord)(id, code, name, value)
warehouses(status, date, value, name)
Task: Select code from orders where code exists in warehouses for the same level.
SQL: | SELECT code FROM orders AS ord
WHERE code IN (
SELECT code 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": "code",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_07125 | train | T1 |
v3 | Schema:
regions (alias: rgn)(amount, level, type, code)
items(level, id, status, salary)
Task: Retrieve amount from regions with value above the COUNT(salary) of items rows sharing the same type.
SQL: | SELECT amount FROM regions AS rgn
WHERE value > (
SELECT COUNT(salary) FROM items AS lne
WHERE lne.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_07126 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(salary, level, name, type)
orders(code, level, name, amount)
Task: Retrieve salary from warehouses that have at least one corresponding entry in orders sharing the same status.
SQL: | SELECT salary FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "orders",
"outer_alias": "whs",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_07127 | train | T2 |
v2 | Schema:
accounts (alias: acct)(id, value, type, status)
departments(amount, name, salary, code)
Task: Find code from accounts where a matching record exists in departments with the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_07128 | train | T1 |
v2 | Schema:
categories (alias: catg)(date, name, level, amount)
requests(type, level, salary, date)
Task: Find code from categories where a matching record exists in requests with the same code.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_07129 | train | T2 |
v2 | Schema:
staff (alias: empl)(date, name, level, status)
shipments(salary, value, date, amount)
Task: Find code from staff where a matching record exists in shipments with the same type.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_07130 | train | T2 |
v3 | Schema:
employees (alias: emp)(value, id, amount, level)
customers(level, name, code, value)
Task: Find id from employees where salary exceeds the average amount from customers for the same code.
SQL: | SELECT id FROM employees AS emp
WHERE salary > (
SELECT MAX(amount) FROM customers AS cust
WHERE cust.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_07131 | train | T1 |
v3 | Schema:
services (alias: srvc)(status, type, level, name)
warehouses(date, level, type, amount)
Task: Retrieve value from services with salary above the MAX(amount) of warehouses rows sharing the same type.
SQL: | SELECT value FROM services AS srvc
WHERE salary > (
SELECT MAX(amount) FROM warehouses AS whs
WHERE whs.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "warehouses",
"outer_alias": "srvc",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_07132 | train | T2 |
v2 | Schema:
orders (alias: ord)(value, date, status, code)
budgets(salary, name, code, date)
Task: Retrieve name from orders that have at least one corresponding entry in budgets sharing the same code.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "budgets",
"outer_alias": "ord",
"inner_alias": "budg",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_07133 | train | T1 |
v2 | Schema:
categories (alias: catg)(date, status, type, level)
products(code, name, id, amount)
Task: Find id from categories where a matching record exists in products with the same type.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_07134 | train | T2 |
v2 | Schema:
employees (alias: emp)(status, date, salary, id)
services(level, status, type, salary)
Task: Find salary from employees where a matching record exists in services with the same id.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "services",
"outer_alias": "emp",
"inner_alias": "srvc",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_07135 | train | T1 |
v1 | Schema:
transactions (alias: txn)(date, level, amount, status)
shipments(level, salary, amount, type)
Task: Select salary from transactions where status exists in shipments for the same type.
SQL: | SELECT salary FROM transactions AS txn
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_07136 | train | T1 |
v3 | Schema:
categories (alias: catg)(id, status, type, level)
sales(level, type, name, salary)
Task: Retrieve salary from categories with salary above the AVG(amount) of sales rows sharing the same status.
SQL: | SELECT salary FROM categories AS catg
WHERE salary > (
SELECT AVG(amount) FROM sales AS sale
WHERE sale.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_07137 | train | T2 |
v2 | Schema:
customers (alias: cust)(name, level, id, salary)
staff(amount, status, name, id)
Task: Retrieve value from customers that have at least one corresponding entry in staff sharing the same type.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_07138 | train | T1 |
v2 | Schema:
orders (alias: ord)(name, date, level, id)
schedules(type, level, value, name)
Task: Retrieve amount from orders that have at least one corresponding entry in schedules sharing the same id.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_07139 | train | T1 |
v3 | Schema:
budgets (alias: budg)(name, status, date, level)
staff(salary, amount, code, type)
Task: Find name from budgets where salary exceeds the average salary from staff for the same id.
SQL: | SELECT name FROM budgets AS budg
WHERE salary > (
SELECT SUM(salary) FROM staff AS empl
WHERE empl.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "staff",
"outer_alias": "budg",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_07140 | train | T2 |
v2 | Schema:
managers (alias: mgr)(type, code, id, salary)
schedules(level, value, type, id)
Task: Retrieve name from managers that have at least one corresponding entry in schedules sharing the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_07141 | train | T1 |
v2 | Schema:
services (alias: srvc)(value, type, code, salary)
shipments(salary, code, value, id)
Task: Find code from services where a matching record exists in shipments with the same level.
SQL: | SELECT code FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "shipments",
"outer_alias": "srvc",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_07142 | train | T2 |
v3 | Schema:
departments (alias: dept)(id, status, date, name)
budgets(id, type, code, status)
Task: Find value from departments where salary exceeds the average salary from budgets for the same level.
SQL: | SELECT value FROM departments AS dept
WHERE salary > (
SELECT AVG(salary) FROM budgets AS budg
WHERE budg.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "budgets",
"outer_alias": "dept",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_07143 | train | T1 |
v1 | Schema:
regions (alias: rgn)(code, value, status, name)
transactions(date, salary, code, value)
Task: Select code from regions where id exists in transactions for the same level.
SQL: | SELECT code FROM regions AS rgn
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_07144 | train | T2 |
v3 | Schema:
invoices (alias: inv)(status, type, code, name)
shipments(date, level, salary, type)
Task: Find code from invoices where value exceeds the average amount from shipments for the same status.
SQL: | SELECT code FROM invoices AS inv
WHERE value > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_07145 | train | T1 |
v2 | Schema:
managers (alias: mgr)(code, date, name, value)
categories(amount, code, name, type)
Task: Find code from managers where a matching record exists in categories with the same level.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_07146 | train | T1 |
v2 | Schema:
departments (alias: dept)(id, type, name, level)
schedules(id, name, amount, code)
Task: Find id from departments where a matching record exists in schedules with the same type.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_07147 | train | T1 |
v3 | Schema:
services (alias: srvc)(code, level, salary, id)
invoices(code, value, type, level)
Task: Find salary from services where amount exceeds the average salary from invoices for the same status.
SQL: | SELECT salary FROM services AS srvc
WHERE amount > (
SELECT AVG(salary) FROM invoices AS inv
WHERE inv.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "invoices",
"outer_alias": "srvc",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_07148 | train | T2 |
v2 | Schema:
services (alias: srvc)(type, name, amount, salary)
accounts(amount, level, name, salary)
Task: Find salary from services where a matching record exists in accounts with the same type.
SQL: | SELECT salary FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "accounts",
"outer_alias": "srvc",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_07149 | train | T2 |
v2 | Schema:
employees (alias: emp)(id, name, amount, level)
items(type, status, date, level)
Task: Find value from employees where a matching record exists in items with the same code.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_07150 | train | T1 |
v3 | Schema:
staff (alias: empl)(type, salary, code, id)
items(code, value, name, status)
Task: Find value from staff where amount exceeds the average amount from items for the same type.
SQL: | SELECT value FROM staff AS empl
WHERE amount > (
SELECT COUNT(amount) FROM items AS lne
WHERE lne.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_07151 | train | T2 |
v2 | Schema:
schedules (alias: schd)(type, date, id, value)
items(value, status, type, name)
Task: Retrieve amount from schedules that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_07152 | train | T2 |
v1 | Schema:
departments (alias: dept)(code, amount, id, salary)
shipments(code, name, status, salary)
Task: Find amount from departments where id appears in shipments entries with matching level.
SQL: | SELECT amount FROM departments AS dept
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_07153 | train | T1 |
v3 | Schema:
requests (alias: ordr)(amount, status, salary, name)
products(name, id, level, date)
Task: Retrieve code from requests with value above the SUM(value) of products rows sharing the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE value > (
SELECT SUM(value) FROM products AS prod
WHERE prod.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_07154 | train | T2 |
v1 | Schema:
services (alias: srvc)(date, amount, status, name)
budgets(id, status, name, amount)
Task: Retrieve value from services whose id is found in budgets rows where code matches the outer record.
SQL: | SELECT value FROM services AS srvc
WHERE id IN (
SELECT id FROM budgets AS budg
WHERE budg.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "budgets",
"outer_alias": "srvc",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_07155 | train | T2 |
v2 | Schema:
requests (alias: ordr)(value, salary, name, code)
customers(date, type, value, name)
Task: Find id from requests where a matching record exists in customers with the same level.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_07156 | train | T2 |
v1 | Schema:
invoices (alias: inv)(value, code, salary, type)
items(status, type, amount, name)
Task: Select id from invoices where level exists in items for the same code.
SQL: | SELECT id FROM invoices AS inv
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_07157 | train | T1 |
v1 | Schema:
sales (alias: sale)(amount, value, code, date)
services(name, date, status, type)
Task: Select code from sales where type exists in services for the same code.
SQL: | SELECT code FROM sales AS sale
WHERE type IN (
SELECT type FROM services AS srvc
WHERE srvc.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "services",
"outer_alias": "sale",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_07158 | train | T1 |
v3 | Schema:
items (alias: lne)(salary, id, type, value)
services(date, amount, salary, id)
Task: Retrieve amount from items with amount above the MIN(value) of services rows sharing the same status.
SQL: | SELECT amount FROM items AS lne
WHERE amount > (
SELECT MIN(value) FROM services AS srvc
WHERE srvc.status = lne.status
); | {
"outer_table": "items",
"inner_table": "services",
"outer_alias": "lne",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_07159 | train | T2 |
v1 | Schema:
customers (alias: cust)(date, code, value, name)
warehouses(salary, level, date, value)
Task: Find id from customers where id appears in warehouses entries with matching type.
SQL: | SELECT id FROM customers AS cust
WHERE id IN (
SELECT id FROM warehouses AS whs
WHERE whs.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "warehouses",
"outer_alias": "cust",
"inner_alias": "whs",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_07160 | train | T1 |
v1 | Schema:
regions (alias: rgn)(status, date, salary, id)
customers(salary, amount, type, id)
Task: Select salary from regions where type exists in customers for the same code.
SQL: | SELECT salary FROM regions AS rgn
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_07161 | train | T2 |
v2 | Schema:
transactions (alias: txn)(level, value, status, amount)
invoices(salary, amount, name, id)
Task: Find salary from transactions where a matching record exists in invoices with the same level.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_07162 | train | T1 |
v3 | Schema:
sales (alias: sale)(amount, status, date, code)
orders(level, value, type, amount)
Task: Find name from sales where salary exceeds the average amount from orders for the same code.
SQL: | SELECT name FROM sales AS sale
WHERE salary > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_07163 | train | T1 |
v3 | Schema:
items (alias: lne)(type, level, date, status)
customers(level, id, value, salary)
Task: Find salary from items where value exceeds the average salary from customers for the same status.
SQL: | SELECT salary FROM items AS lne
WHERE value > (
SELECT MAX(salary) FROM customers AS cust
WHERE cust.status = lne.status
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_07164 | train | T2 |
v3 | Schema:
transactions (alias: txn)(date, amount, id, status)
categories(salary, id, value, name)
Task: Find id from transactions where value exceeds the average amount from categories for the same code.
SQL: | SELECT id FROM transactions AS txn
WHERE value > (
SELECT AVG(amount) FROM categories AS catg
WHERE catg.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"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_07165 | train | T1 |
v2 | Schema:
staff (alias: empl)(salary, status, value, id)
budgets(amount, status, date, code)
Task: Retrieve code from staff that have at least one corresponding entry in budgets sharing the same level.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "budgets",
"outer_alias": "empl",
"inner_alias": "budg",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_07166 | train | T2 |
v1 | Schema:
services (alias: srvc)(date, name, salary, level)
sales(type, value, status, level)
Task: Retrieve id from services whose id is found in sales rows where id matches the outer record.
SQL: | SELECT id FROM services AS srvc
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "sales",
"outer_alias": "srvc",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_07167 | train | T2 |
v2 | Schema:
budgets (alias: budg)(type, code, status, salary)
warehouses(id, date, code, type)
Task: Find id from budgets where a matching record exists in warehouses with the same id.
SQL: | SELECT id FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "warehouses",
"outer_alias": "budg",
"inner_alias": "whs",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_07168 | train | T2 |
v2 | Schema:
schedules (alias: schd)(value, type, status, name)
orders(type, status, amount, salary)
Task: Retrieve id from schedules that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_07169 | train | T2 |
v1 | Schema:
shipments (alias: shp)(name, code, date, level)
items(name, id, salary, level)
Task: Find value from shipments where level appears in items entries with matching code.
SQL: | SELECT value FROM shipments AS shp
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_07170 | train | T2 |
v1 | Schema:
categories (alias: catg)(amount, status, name, value)
budgets(id, amount, name, salary)
Task: Retrieve name from categories whose id is found in budgets rows where id matches the outer record.
SQL: | SELECT name FROM categories AS catg
WHERE id IN (
SELECT id FROM budgets AS budg
WHERE budg.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "budgets",
"outer_alias": "catg",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_07171 | train | T2 |
v3 | Schema:
accounts (alias: acct)(level, type, name, id)
staff(value, id, status, code)
Task: Find value from accounts where salary exceeds the average salary from staff for the same type.
SQL: | SELECT value FROM accounts AS acct
WHERE salary > (
SELECT COUNT(salary) FROM staff AS empl
WHERE empl.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_07172 | train | T1 |
v3 | Schema:
requests (alias: ordr)(value, salary, date, id)
services(code, id, amount, level)
Task: Retrieve value from requests with amount above the AVG(value) of services rows sharing the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE amount > (
SELECT AVG(value) FROM services AS srvc
WHERE srvc.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "services",
"outer_alias": "ordr",
"inner_alias": "srvc",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_07173 | train | T2 |
v3 | Schema:
services (alias: srvc)(value, name, id, level)
regions(value, type, amount, salary)
Task: Find id from services where amount exceeds the average salary from regions for the same status.
SQL: | SELECT id FROM services AS srvc
WHERE amount > (
SELECT MAX(salary) FROM regions AS rgn
WHERE rgn.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "regions",
"outer_alias": "srvc",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_07174 | train | T2 |
v2 | Schema:
accounts (alias: acct)(salary, status, type, level)
items(date, level, type, value)
Task: Retrieve id from accounts that have at least one corresponding entry in items sharing the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_07175 | train | T1 |
v2 | Schema:
staff (alias: empl)(code, amount, value, salary)
managers(status, value, date, amount)
Task: Retrieve salary from staff that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_07176 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(amount, code, name, level)
products(salary, code, level, value)
Task: Find salary from warehouses where code appears in products entries with matching code.
SQL: | SELECT salary FROM warehouses AS whs
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "products",
"outer_alias": "whs",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_07177 | train | T2 |
v2 | Schema:
items (alias: lne)(type, amount, date, level)
warehouses(name, status, type, id)
Task: Find id from items where a matching record exists in warehouses with the same level.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.level = lne.level
); | {
"outer_table": "items",
"inner_table": "warehouses",
"outer_alias": "lne",
"inner_alias": "whs",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_07178 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(amount, code, salary, status)
managers(date, amount, type, code)
Task: Retrieve code from warehouses with amount above the AVG(value) of managers rows sharing the same id.
SQL: | SELECT code FROM warehouses AS whs
WHERE amount > (
SELECT AVG(value) FROM managers AS mgr
WHERE mgr.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "managers",
"outer_alias": "whs",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_07179 | train | T2 |
v2 | Schema:
budgets (alias: budg)(code, amount, date, name)
regions(id, status, code, date)
Task: Find value from budgets where a matching record exists in regions with the same code.
SQL: | SELECT value FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "regions",
"outer_alias": "budg",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_07180 | train | T2 |
v3 | Schema:
categories (alias: catg)(type, date, id, name)
warehouses(salary, amount, date, status)
Task: Retrieve value from categories with value above the MAX(amount) of warehouses rows sharing the same type.
SQL: | SELECT value FROM categories AS catg
WHERE value > (
SELECT MAX(amount) FROM warehouses AS whs
WHERE whs.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "warehouses",
"outer_alias": "catg",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_07181 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(amount, level, value, code)
customers(id, type, date, salary)
Task: Retrieve name from warehouses with value above the MAX(value) of customers rows sharing the same code.
SQL: | SELECT name FROM warehouses AS whs
WHERE value > (
SELECT MAX(value) FROM customers AS cust
WHERE cust.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "customers",
"outer_alias": "whs",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_07182 | train | T2 |
v1 | Schema:
budgets (alias: budg)(salary, value, status, type)
invoices(salary, code, type, name)
Task: Select amount from budgets where code exists in invoices for the same type.
SQL: | SELECT amount FROM budgets AS budg
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "invoices",
"outer_alias": "budg",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_07183 | train | T2 |
v3 | Schema:
transactions (alias: txn)(status, id, name, type)
employees(date, status, salary, type)
Task: Retrieve salary from transactions with amount above the COUNT(value) of employees rows sharing the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE amount > (
SELECT COUNT(value) FROM employees AS emp
WHERE emp.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_07184 | train | T1 |
v2 | Schema:
managers (alias: mgr)(code, value, salary, id)
invoices(level, date, status, name)
Task: Find amount from managers where a matching record exists in invoices with the same code.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_07185 | train | T1 |
v3 | Schema:
budgets (alias: budg)(name, amount, date, code)
regions(level, type, date, id)
Task: Find code from budgets where salary exceeds the average value from regions for the same type.
SQL: | SELECT code FROM budgets AS budg
WHERE salary > (
SELECT AVG(value) FROM regions AS rgn
WHERE rgn.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "regions",
"outer_alias": "budg",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_07186 | train | T2 |
v3 | Schema:
services (alias: srvc)(salary, code, id, amount)
requests(name, level, amount, id)
Task: Find salary from services where salary exceeds the average value from requests for the same status.
SQL: | SELECT salary FROM services AS srvc
WHERE salary > (
SELECT MAX(value) FROM requests AS ordr
WHERE ordr.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "requests",
"outer_alias": "srvc",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_07187 | train | T2 |
v1 | Schema:
requests (alias: ordr)(amount, date, id, status)
items(value, type, status, id)
Task: Find name from requests where id appears in items entries with matching level.
SQL: | SELECT name FROM requests AS ordr
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_07188 | train | T2 |
v2 | Schema:
departments (alias: dept)(value, amount, level, type)
budgets(value, code, id, type)
Task: Find name from departments where a matching record exists in budgets with the same level.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "budgets",
"outer_alias": "dept",
"inner_alias": "budg",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_07189 | train | T1 |
v3 | Schema:
budgets (alias: budg)(level, type, status, amount)
shipments(code, level, name, status)
Task: Retrieve code from budgets with amount above the AVG(salary) of shipments rows sharing the same type.
SQL: | SELECT code FROM budgets AS budg
WHERE amount > (
SELECT AVG(salary) FROM shipments AS shp
WHERE shp.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "shipments",
"outer_alias": "budg",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_07190 | train | T2 |
v2 | Schema:
sales (alias: sale)(value, salary, type, amount)
orders(amount, name, type, level)
Task: Find amount from sales where a matching record exists in orders with the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_07191 | train | T1 |
v1 | Schema:
items (alias: lne)(amount, status, id, name)
categories(salary, id, amount, level)
Task: Find value from items where level appears in categories entries with matching status.
SQL: | SELECT value FROM items AS lne
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.status = lne.status
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_07192 | train | T2 |
v3 | Schema:
products (alias: prod)(date, salary, id, amount)
categories(amount, type, name, date)
Task: Retrieve name from products with salary above the COUNT(value) of categories rows sharing the same code.
SQL: | SELECT name FROM products AS prod
WHERE salary > (
SELECT COUNT(value) FROM categories AS catg
WHERE catg.code = prod.code
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_07193 | train | T1 |
v1 | Schema:
products (alias: prod)(id, type, amount, name)
shipments(salary, amount, value, date)
Task: Retrieve value from products whose type is found in shipments rows where status matches the outer record.
SQL: | SELECT value FROM products AS prod
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.status = prod.status
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_07194 | train | T1 |
v1 | Schema:
categories (alias: catg)(name, code, date, type)
warehouses(status, name, code, type)
Task: Find id from categories where id appears in warehouses entries with matching id.
SQL: | SELECT id FROM categories AS catg
WHERE id IN (
SELECT id FROM warehouses AS whs
WHERE whs.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "warehouses",
"outer_alias": "catg",
"inner_alias": "whs",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_07195 | train | T2 |
v2 | Schema:
employees (alias: emp)(code, type, date, name)
products(name, id, type, code)
Task: Find salary from employees where a matching record exists in products with the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_07196 | train | T1 |
v1 | Schema:
requests (alias: ordr)(type, id, status, date)
products(value, salary, level, type)
Task: Retrieve amount from requests whose type is found in products rows where status matches the outer record.
SQL: | SELECT amount FROM requests AS ordr
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_07197 | train | T2 |
v2 | Schema:
sales (alias: sale)(value, name, type, status)
staff(salary, amount, date, value)
Task: Find value from sales where a matching record exists in staff with the same status.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_07198 | train | T1 |
v3 | Schema:
managers (alias: mgr)(salary, amount, code, date)
budgets(level, code, name, id)
Task: Find value from managers where value exceeds the average value from budgets for the same code.
SQL: | SELECT value FROM managers AS mgr
WHERE value > (
SELECT MAX(value) FROM budgets AS budg
WHERE budg.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "budgets",
"outer_alias": "mgr",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_07199 | train | T1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.