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:
warehouses (alias: whs)(type, salary, amount, id)
departments(name, code, status, amount)
Task: Retrieve code from warehouses whose status is found in departments rows where level matches the outer record.
SQL: | SELECT code FROM warehouses AS whs
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "departments",
"outer_alias": "whs",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_11300 | train | T2 |
v2 | Schema:
schedules (alias: schd)(date, id, amount, name)
requests(type, value, name, status)
Task: Find salary from schedules where a matching record exists in requests with the same level.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_11301 | train | T2 |
v1 | Schema:
schedules (alias: schd)(value, level, salary, id)
services(amount, salary, id, status)
Task: Select salary from schedules where level exists in services for the same code.
SQL: | SELECT salary FROM schedules AS schd
WHERE level IN (
SELECT level FROM services AS srvc
WHERE srvc.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "services",
"outer_alias": "schd",
"inner_alias": "srvc",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_11302 | train | T2 |
v1 | Schema:
sales (alias: sale)(salary, status, type, amount)
orders(salary, date, code, level)
Task: Find value from sales where id appears in orders entries with matching code.
SQL: | SELECT value FROM sales AS sale
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_11303 | train | T1 |
v2 | Schema:
shipments (alias: shp)(value, id, amount, type)
services(amount, code, date, salary)
Task: Retrieve id from shipments that have at least one corresponding entry in services sharing the same id.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "services",
"outer_alias": "shp",
"inner_alias": "srvc",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_11304 | train | T2 |
v3 | Schema:
employees (alias: emp)(id, level, date, status)
items(code, id, salary, name)
Task: Find salary from employees where value exceeds the average amount from items for the same id.
SQL: | SELECT salary FROM employees AS emp
WHERE value > (
SELECT AVG(amount) FROM items AS lne
WHERE lne.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_11305 | train | T1 |
v2 | Schema:
services (alias: srvc)(date, amount, status, level)
departments(amount, value, status, code)
Task: Retrieve id from services that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT id FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "departments",
"outer_alias": "srvc",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_11306 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(type, salary, id, name)
requests(level, type, amount, id)
Task: Find code from warehouses where value exceeds the average amount from requests for the same level.
SQL: | SELECT code FROM warehouses AS whs
WHERE value > (
SELECT SUM(amount) FROM requests AS ordr
WHERE ordr.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "requests",
"outer_alias": "whs",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_11307 | train | T2 |
v2 | Schema:
departments (alias: dept)(status, amount, level, date)
managers(id, type, code, salary)
Task: Find value from departments where a matching record exists in managers with the same id.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_11308 | train | T1 |
v3 | Schema:
products (alias: prod)(salary, level, code, value)
staff(date, amount, type, value)
Task: Retrieve amount from products with amount above the SUM(salary) of staff rows sharing the same level.
SQL: | SELECT amount FROM products AS prod
WHERE amount > (
SELECT SUM(salary) FROM staff AS empl
WHERE empl.level = prod.level
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_11309 | train | T1 |
v1 | Schema:
items (alias: lne)(amount, name, date, status)
invoices(amount, type, value, level)
Task: Find id from items where type appears in invoices entries with matching type.
SQL: | SELECT id FROM items AS lne
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.type = lne.type
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_11310 | train | T2 |
v1 | Schema:
customers (alias: cust)(value, date, amount, status)
warehouses(id, level, code, date)
Task: Retrieve salary from customers whose level is found in warehouses rows where code matches the outer record.
SQL: | SELECT salary FROM customers AS cust
WHERE level IN (
SELECT level 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": "level",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_11311 | train | T1 |
v2 | Schema:
categories (alias: catg)(salary, level, date, type)
employees(salary, id, date, level)
Task: Find id from categories where a matching record exists in employees with the same level.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_11312 | train | T2 |
v3 | Schema:
staff (alias: empl)(type, level, value, id)
employees(status, name, amount, code)
Task: Find name from staff where salary exceeds the average value from employees for the same id.
SQL: | SELECT name FROM staff AS empl
WHERE salary > (
SELECT AVG(value) FROM employees AS emp
WHERE emp.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_11313 | train | T2 |
v3 | Schema:
staff (alias: empl)(type, salary, name, value)
items(type, status, date, id)
Task: Find salary from staff where amount exceeds the average amount from items for the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE amount > (
SELECT AVG(amount) FROM items AS lne
WHERE lne.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_11314 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(status, salary, date, value)
shipments(date, status, salary, value)
Task: Find id from warehouses where a matching record exists in shipments with the same status.
SQL: | SELECT id FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "shipments",
"outer_alias": "whs",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_11315 | train | T2 |
v2 | Schema:
shipments (alias: shp)(type, code, id, level)
products(level, status, id, code)
Task: Find id from shipments where a matching record exists in products with the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_11316 | train | T2 |
v1 | Schema:
accounts (alias: acct)(level, name, date, amount)
services(id, code, value, salary)
Task: Find salary from accounts where id appears in services entries with matching code.
SQL: | SELECT salary FROM accounts AS acct
WHERE id IN (
SELECT id FROM services AS srvc
WHERE srvc.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "services",
"outer_alias": "acct",
"inner_alias": "srvc",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_11317 | train | T1 |
v2 | Schema:
sales (alias: sale)(amount, id, date, type)
products(amount, level, status, value)
Task: Find value from sales where a matching record exists in products with the same type.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_11318 | train | T1 |
v1 | Schema:
employees (alias: emp)(name, date, id, amount)
orders(value, type, level, amount)
Task: Find name from employees where code appears in orders entries with matching id.
SQL: | SELECT name FROM employees AS emp
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_11319 | train | T1 |
v1 | Schema:
items (alias: lne)(date, amount, id, status)
customers(type, id, name, code)
Task: Select code from items where level exists in customers for the same id.
SQL: | SELECT code FROM items AS lne
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.id = lne.id
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_11320 | train | T2 |
v2 | Schema:
shipments (alias: shp)(salary, level, value, code)
categories(salary, type, value, status)
Task: Find code from shipments where a matching record exists in categories with the same id.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_11321 | train | T2 |
v3 | Schema:
requests (alias: ordr)(type, amount, id, value)
regions(type, id, level, amount)
Task: Find amount from requests where salary exceeds the average value from regions for the same level.
SQL: | SELECT amount FROM requests AS ordr
WHERE salary > (
SELECT MAX(value) FROM regions AS rgn
WHERE rgn.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_11322 | train | T2 |
v2 | Schema:
employees (alias: emp)(salary, code, amount, type)
customers(date, value, code, salary)
Task: Retrieve id from employees that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_11323 | train | T1 |
v3 | Schema:
requests (alias: ordr)(id, type, date, name)
transactions(date, type, value, level)
Task: Retrieve value from requests with amount above the MIN(amount) of transactions rows sharing the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE amount > (
SELECT MIN(amount) FROM transactions AS txn
WHERE txn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_11324 | train | T2 |
v2 | Schema:
shipments (alias: shp)(date, type, code, salary)
employees(date, salary, name, level)
Task: Find salary from shipments where a matching record exists in employees with the same id.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_11325 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(type, level, status, date)
customers(status, name, amount, code)
Task: Find code from warehouses where a matching record exists in customers with the same code.
SQL: | SELECT code FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "customers",
"outer_alias": "whs",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_11326 | train | T2 |
v2 | Schema:
products (alias: prod)(salary, name, level, date)
sales(type, date, amount, id)
Task: Find value from products where a matching record exists in sales with the same code.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = prod.code
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_11327 | train | T1 |
v3 | Schema:
invoices (alias: inv)(value, date, level, name)
requests(salary, type, code, status)
Task: Retrieve amount from invoices with salary above the MAX(salary) of requests rows sharing the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE salary > (
SELECT MAX(salary) FROM requests AS ordr
WHERE ordr.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_11328 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(salary, type, level, value)
services(amount, id, status, date)
Task: Find salary from warehouses where a matching record exists in services with the same code.
SQL: | SELECT salary FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "services",
"outer_alias": "whs",
"inner_alias": "srvc",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_11329 | train | T2 |
v3 | Schema:
regions (alias: rgn)(amount, status, code, date)
services(value, level, id, code)
Task: Find code from regions where amount exceeds the average salary from services for the same status.
SQL: | SELECT code FROM regions AS rgn
WHERE amount > (
SELECT MIN(salary) FROM services AS srvc
WHERE srvc.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "services",
"outer_alias": "rgn",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_11330 | train | T2 |
v3 | Schema:
staff (alias: empl)(value, code, salary, level)
employees(value, date, type, level)
Task: Retrieve value from staff with salary above the MIN(salary) of employees rows sharing the same code.
SQL: | SELECT value FROM staff AS empl
WHERE salary > (
SELECT MIN(salary) FROM employees AS emp
WHERE emp.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_11331 | train | T2 |
v1 | Schema:
sales (alias: sale)(salary, type, name, date)
schedules(code, salary, level, value)
Task: Retrieve amount from sales whose level is found in schedules rows where type matches the outer record.
SQL: | SELECT amount FROM sales AS sale
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_11332 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(date, type, name, id)
budgets(name, date, level, code)
Task: Select name from warehouses where code exists in budgets for the same id.
SQL: | SELECT name FROM warehouses AS whs
WHERE code IN (
SELECT code FROM budgets AS budg
WHERE budg.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "budgets",
"outer_alias": "whs",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_11333 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(type, value, amount, salary)
orders(salary, type, level, date)
Task: Select id from warehouses where status exists in orders for the same type.
SQL: | SELECT id FROM warehouses AS whs
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "orders",
"outer_alias": "whs",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_11334 | train | T2 |
v3 | Schema:
invoices (alias: inv)(status, value, date, id)
regions(salary, amount, type, id)
Task: Retrieve amount from invoices with value above the MIN(salary) of regions rows sharing the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE value > (
SELECT MIN(salary) FROM regions AS rgn
WHERE rgn.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_11335 | train | T1 |
v3 | Schema:
products (alias: prod)(salary, date, id, amount)
staff(value, level, name, type)
Task: Retrieve code from products with salary above the MAX(salary) of staff rows sharing the same id.
SQL: | SELECT code FROM products AS prod
WHERE salary > (
SELECT MAX(salary) FROM staff AS empl
WHERE empl.id = prod.id
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_11336 | train | T1 |
v1 | Schema:
orders (alias: ord)(id, level, status, type)
invoices(id, date, code, level)
Task: Select id from orders where status exists in invoices for the same type.
SQL: | SELECT id FROM orders AS ord
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_11337 | train | T1 |
v2 | Schema:
shipments (alias: shp)(value, id, salary, status)
schedules(value, salary, status, level)
Task: Find salary from shipments where a matching record exists in schedules with the same status.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_11338 | train | T2 |
v1 | Schema:
customers (alias: cust)(value, type, code, date)
transactions(amount, value, code, id)
Task: Find id from customers where code appears in transactions entries with matching type.
SQL: | SELECT id FROM customers AS cust
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_11339 | train | T1 |
v1 | Schema:
orders (alias: ord)(amount, id, name, code)
regions(id, level, status, amount)
Task: Find id from orders where type appears in regions entries with matching code.
SQL: | SELECT id FROM orders AS ord
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_11340 | train | T1 |
v3 | Schema:
managers (alias: mgr)(status, value, salary, amount)
warehouses(name, code, id, type)
Task: Retrieve salary from managers with value above the MAX(amount) of warehouses rows sharing the same status.
SQL: | SELECT salary FROM managers AS mgr
WHERE value > (
SELECT MAX(amount) FROM warehouses AS whs
WHERE whs.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "warehouses",
"outer_alias": "mgr",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_11341 | train | T1 |
v1 | Schema:
transactions (alias: txn)(type, status, amount, id)
budgets(id, name, level, type)
Task: Find amount from transactions where type appears in budgets entries with matching code.
SQL: | SELECT amount FROM transactions AS txn
WHERE type IN (
SELECT type FROM budgets AS budg
WHERE budg.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "budgets",
"outer_alias": "txn",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_11342 | train | T1 |
v3 | Schema:
staff (alias: empl)(amount, name, type, code)
products(level, id, amount, status)
Task: Retrieve code from staff with salary above the COUNT(salary) of products rows sharing the same type.
SQL: | SELECT code FROM staff AS empl
WHERE salary > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_11343 | train | T2 |
v3 | Schema:
accounts (alias: acct)(code, salary, level, id)
requests(type, amount, level, id)
Task: Find id from accounts where salary exceeds the average salary from requests for the same id.
SQL: | SELECT id FROM accounts AS acct
WHERE salary > (
SELECT MIN(salary) FROM requests AS ordr
WHERE ordr.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_11344 | train | T1 |
v1 | Schema:
sales (alias: sale)(level, salary, value, code)
managers(value, name, amount, level)
Task: Find value from sales where code appears in managers entries with matching type.
SQL: | SELECT value FROM sales AS sale
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_11345 | train | T1 |
v2 | Schema:
departments (alias: dept)(status, salary, code, date)
employees(type, amount, salary, status)
Task: Retrieve id from departments that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_11346 | train | T1 |
v2 | Schema:
customers (alias: cust)(code, value, id, level)
orders(id, type, name, amount)
Task: Find salary from customers where a matching record exists in orders with the same id.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_11347 | train | T1 |
v3 | Schema:
departments (alias: dept)(status, date, code, amount)
budgets(level, salary, status, name)
Task: Retrieve name from departments with value above the SUM(value) of budgets rows sharing the same code.
SQL: | SELECT name FROM departments AS dept
WHERE value > (
SELECT SUM(value) FROM budgets AS budg
WHERE budg.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "budgets",
"outer_alias": "dept",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_11348 | train | T1 |
v1 | Schema:
transactions (alias: txn)(value, level, salary, id)
categories(value, status, name, level)
Task: Select id from transactions where id exists in categories for the same type.
SQL: | SELECT id FROM transactions AS txn
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_11349 | train | T1 |
v1 | Schema:
regions (alias: rgn)(status, salary, id, date)
shipments(date, code, amount, type)
Task: Select code from regions where type exists in shipments for the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_11350 | train | T2 |
v2 | Schema:
departments (alias: dept)(date, amount, salary, value)
budgets(level, salary, date, value)
Task: Find value from departments where a matching record exists in budgets with the same id.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "budgets",
"outer_alias": "dept",
"inner_alias": "budg",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_11351 | train | T1 |
v2 | Schema:
customers (alias: cust)(id, status, level, amount)
orders(level, type, amount, salary)
Task: Retrieve code from customers that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_11352 | train | T1 |
v1 | Schema:
budgets (alias: budg)(salary, name, amount, id)
regions(salary, amount, date, value)
Task: Retrieve code from budgets whose id is found in regions rows where status matches the outer record.
SQL: | SELECT code FROM budgets AS budg
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "regions",
"outer_alias": "budg",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_11353 | train | T2 |
v1 | Schema:
items (alias: lne)(amount, date, code, status)
customers(value, salary, type, name)
Task: Find id from items where type appears in customers entries with matching type.
SQL: | SELECT id FROM items AS lne
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.type = lne.type
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_11354 | train | T2 |
v1 | Schema:
staff (alias: empl)(salary, level, amount, id)
departments(level, salary, value, id)
Task: Retrieve salary from staff whose type is found in departments rows where status matches the outer record.
SQL: | SELECT salary FROM staff AS empl
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_11355 | train | T2 |
v2 | Schema:
departments (alias: dept)(value, name, type, code)
budgets(level, salary, type, amount)
Task: Find value from departments where a matching record exists in budgets with the same id.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "budgets",
"outer_alias": "dept",
"inner_alias": "budg",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_11356 | train | T1 |
v2 | Schema:
budgets (alias: budg)(amount, date, status, code)
transactions(name, status, type, value)
Task: Retrieve value from budgets that have at least one corresponding entry in transactions sharing the same type.
SQL: | SELECT value FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "transactions",
"outer_alias": "budg",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_11357 | train | T2 |
v3 | Schema:
customers (alias: cust)(code, type, id, amount)
staff(type, id, salary, code)
Task: Find id from customers where value exceeds the average value from staff for the same status.
SQL: | SELECT id FROM customers AS cust
WHERE value > (
SELECT MIN(value) FROM staff AS empl
WHERE empl.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_11358 | train | T1 |
v1 | Schema:
departments (alias: dept)(code, date, level, value)
invoices(status, name, value, code)
Task: Retrieve value from departments whose id is found in invoices rows where type matches the outer record.
SQL: | SELECT value FROM departments AS dept
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "invoices",
"outer_alias": "dept",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_11359 | train | T1 |
v1 | Schema:
regions (alias: rgn)(id, name, type, level)
shipments(type, level, amount, salary)
Task: Find amount from regions where level appears in shipments entries with matching id.
SQL: | SELECT amount FROM regions AS rgn
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_11360 | train | T2 |
v3 | Schema:
regions (alias: rgn)(value, code, name, status)
categories(value, name, level, amount)
Task: Find value from regions where amount exceeds the average salary from categories for the same type.
SQL: | SELECT value FROM regions AS rgn
WHERE amount > (
SELECT AVG(salary) FROM categories AS catg
WHERE catg.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_11361 | train | T2 |
v2 | Schema:
orders (alias: ord)(date, code, level, type)
managers(date, status, name, level)
Task: Retrieve value from orders that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_11362 | train | T1 |
v1 | Schema:
regions (alias: rgn)(amount, salary, level, type)
items(salary, status, id, level)
Task: Retrieve name from regions whose level is found in items rows where status matches the outer record.
SQL: | SELECT name FROM regions AS rgn
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_11363 | train | T2 |
v3 | Schema:
staff (alias: empl)(value, code, type, name)
products(value, type, id, salary)
Task: Retrieve amount from staff with value above the MAX(value) of products rows sharing the same level.
SQL: | SELECT amount FROM staff AS empl
WHERE value > (
SELECT MAX(value) FROM products AS prod
WHERE prod.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_11364 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(level, id, value, name)
shipments(value, salary, date, type)
Task: Find value from warehouses where a matching record exists in shipments with the same type.
SQL: | SELECT value FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "shipments",
"outer_alias": "whs",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_11365 | train | T2 |
v3 | Schema:
items (alias: lne)(name, amount, salary, id)
employees(date, amount, name, value)
Task: Find salary from items where value exceeds the average salary from employees for the same id.
SQL: | SELECT salary FROM items AS lne
WHERE value > (
SELECT MIN(salary) FROM employees AS emp
WHERE emp.id = lne.id
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_11366 | train | T2 |
v3 | Schema:
categories (alias: catg)(status, amount, id, code)
items(value, code, name, type)
Task: Find id from categories where salary exceeds the average value from items for the same level.
SQL: | SELECT id FROM categories AS catg
WHERE salary > (
SELECT MIN(value) FROM items AS lne
WHERE lne.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_11367 | train | T2 |
v1 | Schema:
regions (alias: rgn)(date, code, status, id)
customers(level, code, salary, amount)
Task: Find value from regions where id appears in customers entries with matching level.
SQL: | SELECT value FROM regions AS rgn
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_11368 | train | T2 |
v2 | Schema:
accounts (alias: acct)(name, status, salary, value)
shipments(amount, id, status, name)
Task: Retrieve amount from accounts that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_11369 | train | T1 |
v1 | Schema:
categories (alias: catg)(amount, level, name, id)
managers(value, level, type, code)
Task: Retrieve value from categories whose level is found in managers rows where code matches the outer record.
SQL: | SELECT value FROM categories AS catg
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_11370 | train | T2 |
v1 | Schema:
requests (alias: ordr)(level, amount, type, status)
invoices(salary, name, level, amount)
Task: Select amount from requests where status exists in invoices for the same status.
SQL: | SELECT amount FROM requests AS ordr
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_11371 | train | T2 |
v2 | Schema:
staff (alias: empl)(type, level, name, value)
managers(date, status, amount, value)
Task: Retrieve amount from staff that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_11372 | train | T2 |
v1 | Schema:
schedules (alias: schd)(value, salary, amount, id)
sales(value, id, level, code)
Task: Retrieve code from schedules whose status is found in sales rows where id matches the outer record.
SQL: | SELECT code FROM schedules AS schd
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_11373 | train | T2 |
v3 | Schema:
regions (alias: rgn)(status, type, value, level)
products(amount, type, name, status)
Task: Retrieve id from regions with value above the SUM(value) of products rows sharing the same code.
SQL: | SELECT id FROM regions AS rgn
WHERE value > (
SELECT SUM(value) FROM products AS prod
WHERE prod.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_11374 | train | T2 |
v2 | Schema:
managers (alias: mgr)(code, value, status, level)
departments(value, salary, id, code)
Task: Find value from managers where a matching record exists in departments with the same level.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_11375 | train | T1 |
v2 | Schema:
regions (alias: rgn)(code, amount, value, level)
sales(name, amount, status, type)
Task: Retrieve amount from regions that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_11376 | train | T2 |
v1 | Schema:
managers (alias: mgr)(name, amount, level, salary)
departments(salary, type, value, name)
Task: Retrieve id from managers whose type is found in departments rows where type matches the outer record.
SQL: | SELECT id FROM managers AS mgr
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_11377 | train | T1 |
v3 | Schema:
customers (alias: cust)(date, value, level, status)
items(id, date, level, status)
Task: Retrieve amount from customers with salary above the AVG(amount) of items rows sharing the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE salary > (
SELECT AVG(amount) FROM items AS lne
WHERE lne.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_11378 | train | T1 |
v1 | Schema:
requests (alias: ordr)(amount, salary, value, id)
shipments(value, type, level, name)
Task: Select id from requests where code exists in shipments for the same level.
SQL: | SELECT id FROM requests AS ordr
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_11379 | train | T2 |
v2 | Schema:
invoices (alias: inv)(salary, id, level, status)
schedules(level, status, salary, type)
Task: Find id from invoices where a matching record exists in schedules with the same type.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_11380 | train | T1 |
v3 | Schema:
regions (alias: rgn)(type, amount, level, name)
staff(amount, value, name, status)
Task: Find value from regions where value exceeds the average value from staff for the same status.
SQL: | SELECT value FROM regions AS rgn
WHERE value > (
SELECT COUNT(value) FROM staff AS empl
WHERE empl.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_11381 | train | T2 |
v1 | Schema:
staff (alias: empl)(amount, name, status, code)
transactions(salary, code, name, id)
Task: Find name from staff where code appears in transactions entries with matching status.
SQL: | SELECT name FROM staff AS empl
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_11382 | train | T2 |
v3 | Schema:
orders (alias: ord)(level, salary, name, date)
sales(amount, value, type, level)
Task: Retrieve code from orders with salary above the MAX(amount) of sales rows sharing the same id.
SQL: | SELECT code FROM orders AS ord
WHERE salary > (
SELECT MAX(amount) FROM sales AS sale
WHERE sale.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_11383 | train | T1 |
v3 | Schema:
products (alias: prod)(name, type, value, status)
categories(amount, date, code, level)
Task: Retrieve amount from products with value above the AVG(value) of categories rows sharing the same code.
SQL: | SELECT amount FROM products AS prod
WHERE value > (
SELECT AVG(value) FROM categories AS catg
WHERE catg.code = prod.code
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_11384 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(value, salary, status, amount)
budgets(level, amount, value, date)
Task: Retrieve amount from warehouses that have at least one corresponding entry in budgets sharing the same code.
SQL: | SELECT amount FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "budgets",
"outer_alias": "whs",
"inner_alias": "budg",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_11385 | train | T2 |
v3 | Schema:
transactions (alias: txn)(date, value, id, status)
requests(date, code, id, value)
Task: Retrieve amount from transactions with amount above the COUNT(amount) of requests rows sharing the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE amount > (
SELECT COUNT(amount) FROM requests AS ordr
WHERE ordr.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_11386 | train | T1 |
v1 | Schema:
employees (alias: emp)(salary, level, amount, value)
budgets(name, date, level, value)
Task: Select name from employees where status exists in budgets for the same type.
SQL: | SELECT name FROM employees AS emp
WHERE status IN (
SELECT status FROM budgets AS budg
WHERE budg.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "budgets",
"outer_alias": "emp",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_11387 | train | T1 |
v3 | Schema:
schedules (alias: schd)(id, code, date, salary)
orders(name, status, date, salary)
Task: Find amount from schedules where amount exceeds the average value from orders for the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE amount > (
SELECT MIN(value) FROM orders AS ord
WHERE ord.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_11388 | train | T2 |
v3 | Schema:
budgets (alias: budg)(name, code, value, type)
accounts(value, salary, code, name)
Task: Retrieve name from budgets with salary above the MAX(salary) of accounts rows sharing the same id.
SQL: | SELECT name FROM budgets AS budg
WHERE salary > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "accounts",
"outer_alias": "budg",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_11389 | train | T2 |
v1 | Schema:
orders (alias: ord)(amount, date, level, type)
accounts(id, date, level, status)
Task: Select amount from orders where id exists in accounts for the same code.
SQL: | SELECT amount FROM orders AS ord
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_11390 | train | T1 |
v2 | Schema:
customers (alias: cust)(code, value, status, amount)
sales(salary, code, level, type)
Task: Retrieve amount from customers that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_11391 | train | T1 |
v3 | Schema:
shipments (alias: shp)(amount, id, value, salary)
customers(type, salary, date, level)
Task: Find amount from shipments where salary exceeds the average amount from customers for the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE salary > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_11392 | train | T2 |
v2 | Schema:
items (alias: lne)(value, salary, level, type)
regions(status, salary, code, date)
Task: Find code from items where a matching record exists in regions with the same type.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = lne.type
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_11393 | train | T2 |
v2 | Schema:
shipments (alias: shp)(date, type, id, amount)
warehouses(status, value, name, id)
Task: Find amount from shipments where a matching record exists in warehouses with the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "warehouses",
"outer_alias": "shp",
"inner_alias": "whs",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_11394 | train | T2 |
v1 | Schema:
products (alias: prod)(value, id, name, status)
invoices(date, name, amount, level)
Task: Find amount from products where id appears in invoices entries with matching id.
SQL: | SELECT amount FROM products AS prod
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.id = prod.id
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_11395 | train | T1 |
v3 | Schema:
requests (alias: ordr)(type, id, amount, value)
sales(code, id, level, type)
Task: Retrieve name from requests with salary above the SUM(salary) of sales rows sharing the same code.
SQL: | SELECT name FROM requests AS ordr
WHERE salary > (
SELECT SUM(salary) FROM sales AS sale
WHERE sale.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_11396 | train | T2 |
v1 | Schema:
budgets (alias: budg)(code, amount, value, salary)
managers(date, value, level, salary)
Task: Select id from budgets where status exists in managers for the same code.
SQL: | SELECT id FROM budgets AS budg
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "managers",
"outer_alias": "budg",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_11397 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(type, value, status, salary)
categories(status, id, salary, code)
Task: Select salary from warehouses where code exists in categories for the same level.
SQL: | SELECT salary FROM warehouses AS whs
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "categories",
"outer_alias": "whs",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_11398 | train | T2 |
v2 | Schema:
regions (alias: rgn)(value, code, type, salary)
staff(date, status, value, code)
Task: Retrieve id from regions that have at least one corresponding entry in staff sharing the same type.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_11399 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.