variant stringclasses 3
values | prompt stringlengths 163 237 | sql stringlengths 103 143 | metadata unknown | id stringlengths 21 21 | split stringclasses 1
value | token_group stringclasses 2
values |
|---|---|---|---|---|---|---|
v2 | Schema:
products (alias: prod)(type, id, level, status)
sales(salary, status, level, code)
Task: Retrieve code from products that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = prod.id
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_06400 | train | T1 |
v1 | Schema:
customers (alias: cust)(date, salary, code, level)
items(value, amount, date, type)
Task: Select value from customers where level exists in items for the same code.
SQL: | SELECT value FROM customers AS cust
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_06401 | train | T1 |
v1 | Schema:
items (alias: lne)(amount, salary, code, name)
departments(name, value, level, salary)
Task: Select name from items where level exists in departments for the same type.
SQL: | SELECT name FROM items AS lne
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.type = lne.type
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_06402 | train | T2 |
v1 | Schema:
categories (alias: catg)(id, level, name, amount)
orders(date, level, salary, name)
Task: Select code from categories where status exists in orders for the same level.
SQL: | SELECT code FROM categories AS catg
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_06403 | train | T2 |
v3 | Schema:
schedules (alias: schd)(level, value, salary, amount)
departments(salary, date, status, name)
Task: Retrieve salary from schedules with salary above the MAX(salary) of departments rows sharing the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE salary > (
SELECT MAX(salary) FROM departments AS dept
WHERE dept.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_06404 | train | T2 |
v3 | Schema:
managers (alias: mgr)(status, salary, date, name)
categories(id, date, value, type)
Task: Retrieve id from managers with salary above the MAX(value) of categories rows sharing the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE salary > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_06405 | train | T1 |
v2 | Schema:
services (alias: srvc)(id, status, date, value)
employees(value, level, id, type)
Task: Retrieve amount from services that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT amount FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "employees",
"outer_alias": "srvc",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_06406 | train | T2 |
v1 | Schema:
services (alias: srvc)(salary, code, type, level)
requests(salary, amount, level, date)
Task: Retrieve value from services whose code is found in requests rows where level matches the outer record.
SQL: | SELECT value FROM services AS srvc
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "requests",
"outer_alias": "srvc",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_06407 | train | T2 |
v1 | Schema:
requests (alias: ordr)(salary, id, code, level)
schedules(code, id, date, salary)
Task: Retrieve amount from requests whose code is found in schedules rows where level matches the outer record.
SQL: | SELECT amount FROM requests AS ordr
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_06408 | train | T2 |
v3 | Schema:
shipments (alias: shp)(id, amount, date, type)
departments(code, type, status, name)
Task: Find amount from shipments where amount exceeds the average value from departments for the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE amount > (
SELECT MIN(value) FROM departments AS dept
WHERE dept.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_06409 | train | T2 |
v3 | Schema:
sales (alias: sale)(id, salary, name, date)
items(type, code, level, status)
Task: Find value from sales where value exceeds the average value from items for the same code.
SQL: | SELECT value FROM sales AS sale
WHERE value > (
SELECT MAX(value) FROM items AS lne
WHERE lne.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_06410 | train | T1 |
v2 | Schema:
schedules (alias: schd)(value, status, date, name)
departments(value, date, name, code)
Task: Retrieve amount from schedules that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_06411 | train | T2 |
v1 | Schema:
requests (alias: ordr)(type, date, amount, salary)
invoices(status, id, code, type)
Task: Select code from requests where type exists in invoices for the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_06412 | train | T2 |
v1 | Schema:
invoices (alias: inv)(value, date, level, code)
schedules(date, salary, name, code)
Task: Retrieve amount from invoices whose id is found in schedules rows where status matches the outer record.
SQL: | SELECT amount FROM invoices AS inv
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_06413 | train | T1 |
v3 | Schema:
employees (alias: emp)(id, amount, code, status)
products(salary, level, amount, status)
Task: Find name from employees where amount exceeds the average salary from products for the same status.
SQL: | SELECT name FROM employees AS emp
WHERE amount > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_06414 | train | T1 |
v2 | Schema:
schedules (alias: schd)(name, level, date, salary)
items(status, name, type, value)
Task: Find value from schedules where a matching record exists in items with the same level.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_06415 | train | T2 |
v1 | Schema:
regions (alias: rgn)(date, status, amount, value)
requests(name, id, value, date)
Task: Select code from regions where status exists in requests for the same level.
SQL: | SELECT code FROM regions AS rgn
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_06416 | train | T2 |
v2 | Schema:
budgets (alias: budg)(code, name, value, salary)
sales(id, type, date, salary)
Task: Find code from budgets where a matching record exists in sales with the same id.
SQL: | SELECT code FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "sales",
"outer_alias": "budg",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_06417 | train | T2 |
v1 | Schema:
departments (alias: dept)(id, amount, name, value)
products(status, date, value, type)
Task: Find amount from departments where id appears in products entries with matching type.
SQL: | SELECT amount FROM departments AS dept
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_06418 | train | T1 |
v2 | Schema:
categories (alias: catg)(date, type, status, level)
regions(level, date, code, type)
Task: Retrieve name from categories that have at least one corresponding entry in regions sharing the same code.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_06419 | train | T2 |
v1 | Schema:
accounts (alias: acct)(amount, salary, name, id)
orders(date, type, level, name)
Task: Select value from accounts where id exists in orders for the same status.
SQL: | SELECT value FROM accounts AS acct
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_06420 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(status, code, id, level)
requests(value, id, date, name)
Task: Select id from warehouses where id exists in requests for the same code.
SQL: | SELECT id FROM warehouses AS whs
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "requests",
"outer_alias": "whs",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_06421 | train | T2 |
v2 | Schema:
products (alias: prod)(salary, id, value, amount)
managers(amount, name, id, salary)
Task: Retrieve code from products that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_06422 | train | T1 |
v1 | Schema:
sales (alias: sale)(type, value, id, status)
warehouses(level, type, amount, name)
Task: Find value from sales where type appears in warehouses entries with matching code.
SQL: | SELECT value FROM sales AS sale
WHERE type IN (
SELECT type FROM warehouses AS whs
WHERE whs.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "warehouses",
"outer_alias": "sale",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_06423 | train | T1 |
v3 | Schema:
orders (alias: ord)(status, amount, name, code)
products(date, salary, id, name)
Task: Retrieve code from orders with amount above the COUNT(salary) of products rows sharing the same level.
SQL: | SELECT code FROM orders AS ord
WHERE amount > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_06424 | train | T1 |
v2 | Schema:
products (alias: prod)(status, value, level, code)
orders(code, status, id, date)
Task: Retrieve code from products that have at least one corresponding entry in orders sharing the same status.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = prod.status
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_06425 | train | T1 |
v1 | Schema:
items (alias: lne)(code, status, amount, level)
regions(date, status, level, name)
Task: Retrieve code from items whose id is found in regions rows where level matches the outer record.
SQL: | SELECT code FROM items AS lne
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_06426 | train | T2 |
v3 | Schema:
managers (alias: mgr)(amount, date, type, value)
products(code, status, id, name)
Task: Find code from managers where salary exceeds the average amount from products for the same code.
SQL: | SELECT code FROM managers AS mgr
WHERE salary > (
SELECT COUNT(amount) FROM products AS prod
WHERE prod.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_06427 | train | T1 |
v3 | Schema:
services (alias: srvc)(amount, id, name, value)
categories(id, level, type, date)
Task: Retrieve name from services with value above the MIN(salary) of categories rows sharing the same code.
SQL: | SELECT name FROM services AS srvc
WHERE value > (
SELECT MIN(salary) FROM categories AS catg
WHERE catg.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "categories",
"outer_alias": "srvc",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_06428 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(date, amount, salary, level)
regions(date, value, type, id)
Task: Find code from warehouses where level appears in regions entries with matching code.
SQL: | SELECT code FROM warehouses AS whs
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "regions",
"outer_alias": "whs",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_06429 | train | T2 |
v1 | Schema:
employees (alias: emp)(code, name, id, amount)
orders(level, name, status, type)
Task: Select name from employees where status exists in orders for the same level.
SQL: | SELECT name FROM employees AS emp
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_06430 | train | T1 |
v2 | Schema:
regions (alias: rgn)(status, date, type, code)
invoices(date, name, status, salary)
Task: Retrieve id from regions that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_06431 | train | T2 |
v1 | Schema:
managers (alias: mgr)(amount, salary, date, status)
budgets(date, status, value, amount)
Task: Select value from managers where level exists in budgets for the same level.
SQL: | SELECT value FROM managers AS mgr
WHERE level IN (
SELECT level FROM budgets AS budg
WHERE budg.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "budgets",
"outer_alias": "mgr",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_06432 | train | T1 |
v3 | Schema:
staff (alias: empl)(salary, name, status, type)
sales(status, code, salary, date)
Task: Find name from staff where amount exceeds the average amount from sales for the same type.
SQL: | SELECT name FROM staff AS empl
WHERE amount > (
SELECT COUNT(amount) FROM sales AS sale
WHERE sale.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_06433 | train | T2 |
v2 | Schema:
employees (alias: emp)(level, value, status, date)
staff(code, amount, date, value)
Task: Find code from employees where a matching record exists in staff with the same level.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_06434 | train | T1 |
v1 | Schema:
sales (alias: sale)(level, status, amount, date)
invoices(salary, date, level, amount)
Task: Retrieve salary from sales whose status is found in invoices rows where id matches the outer record.
SQL: | SELECT salary FROM sales AS sale
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_06435 | train | T1 |
v3 | Schema:
categories (alias: catg)(date, amount, code, type)
accounts(name, value, type, salary)
Task: Retrieve salary from categories with value above the SUM(amount) of accounts rows sharing the same code.
SQL: | SELECT salary FROM categories AS catg
WHERE value > (
SELECT SUM(amount) FROM accounts AS acct
WHERE acct.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_06436 | train | T2 |
v2 | Schema:
schedules (alias: schd)(value, status, id, type)
categories(id, salary, value, type)
Task: Retrieve name from schedules that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_06437 | train | T2 |
v1 | Schema:
managers (alias: mgr)(type, amount, id, status)
shipments(name, salary, date, code)
Task: Retrieve amount from managers whose level is found in shipments rows where code matches the outer record.
SQL: | SELECT amount FROM managers AS mgr
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_06438 | train | T1 |
v2 | Schema:
sales (alias: sale)(name, id, date, status)
categories(code, value, id, name)
Task: Retrieve amount from sales that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_06439 | train | T1 |
v3 | Schema:
items (alias: lne)(id, type, name, value)
requests(type, value, date, id)
Task: Find name from items where value exceeds the average value from requests for the same status.
SQL: | SELECT name FROM items AS lne
WHERE value > (
SELECT AVG(value) FROM requests AS ordr
WHERE ordr.status = lne.status
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_06440 | train | T2 |
v3 | Schema:
customers (alias: cust)(name, code, salary, type)
categories(level, value, date, amount)
Task: Retrieve value from customers with salary above the AVG(value) of categories rows sharing the same level.
SQL: | SELECT value FROM customers AS cust
WHERE salary > (
SELECT AVG(value) FROM categories AS catg
WHERE catg.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_06441 | train | T1 |
v1 | Schema:
requests (alias: ordr)(code, salary, name, level)
budgets(code, type, status, name)
Task: Retrieve name from requests whose level is found in budgets rows where level matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE level IN (
SELECT level FROM budgets AS budg
WHERE budg.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "budgets",
"outer_alias": "ordr",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_06442 | train | T2 |
v2 | Schema:
items (alias: lne)(code, value, id, level)
invoices(name, value, date, level)
Task: Find amount from items where a matching record exists in invoices with the same id.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = lne.id
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_06443 | train | T2 |
v2 | Schema:
employees (alias: emp)(id, value, type, status)
requests(status, amount, level, value)
Task: Find name from employees where a matching record exists in requests with the same level.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_06444 | train | T1 |
v2 | Schema:
transactions (alias: txn)(amount, name, value, id)
services(name, id, code, type)
Task: Retrieve id from transactions that have at least one corresponding entry in services sharing the same status.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "services",
"outer_alias": "txn",
"inner_alias": "srvc",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_06445 | train | T1 |
v1 | Schema:
regions (alias: rgn)(salary, status, value, type)
managers(salary, code, type, date)
Task: Retrieve value from regions whose status is found in managers rows where type matches the outer record.
SQL: | SELECT value FROM regions AS rgn
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_06446 | train | T2 |
v1 | Schema:
departments (alias: dept)(id, status, salary, date)
staff(code, type, id, name)
Task: Select name from departments where status exists in staff for the same code.
SQL: | SELECT name FROM departments AS dept
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_06447 | train | T1 |
v1 | Schema:
budgets (alias: budg)(type, amount, level, date)
products(type, name, status, code)
Task: Retrieve name from budgets whose id is found in products rows where code matches the outer record.
SQL: | SELECT name FROM budgets AS budg
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "products",
"outer_alias": "budg",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_06448 | train | T2 |
v3 | Schema:
regions (alias: rgn)(status, salary, date, level)
categories(salary, level, id, value)
Task: Retrieve amount from regions with amount above the COUNT(salary) of categories rows sharing the same id.
SQL: | SELECT amount FROM regions AS rgn
WHERE amount > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_06449 | train | T2 |
v1 | Schema:
employees (alias: emp)(level, salary, type, name)
items(type, id, date, salary)
Task: Find value from employees where status appears in items entries with matching type.
SQL: | SELECT value FROM employees AS emp
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_06450 | train | T1 |
v3 | Schema:
products (alias: prod)(amount, code, type, date)
items(value, id, salary, amount)
Task: Find id from products where amount exceeds the average amount from items for the same level.
SQL: | SELECT id FROM products AS prod
WHERE amount > (
SELECT COUNT(amount) FROM items AS lne
WHERE lne.level = prod.level
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_06451 | train | T1 |
v3 | Schema:
customers (alias: cust)(id, status, date, name)
employees(value, type, level, amount)
Task: Retrieve name from customers with value above the AVG(value) of employees rows sharing the same level.
SQL: | SELECT name FROM customers AS cust
WHERE value > (
SELECT AVG(value) FROM employees AS emp
WHERE emp.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_06452 | train | T1 |
v3 | Schema:
regions (alias: rgn)(amount, salary, level, type)
products(amount, type, value, date)
Task: Retrieve value from regions with salary above the COUNT(value) of products rows sharing the same level.
SQL: | SELECT value FROM regions AS rgn
WHERE salary > (
SELECT COUNT(value) FROM products AS prod
WHERE prod.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_06453 | train | T2 |
v3 | Schema:
items (alias: lne)(value, date, name, level)
regions(amount, type, level, status)
Task: Retrieve id from items with amount above the COUNT(value) of regions rows sharing the same id.
SQL: | SELECT id FROM items AS lne
WHERE amount > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.id = lne.id
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_06454 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(salary, value, type, code)
shipments(id, level, name, status)
Task: Find id from warehouses where salary exceeds the average amount from shipments for the same type.
SQL: | SELECT id FROM warehouses AS whs
WHERE salary > (
SELECT AVG(amount) FROM shipments AS shp
WHERE shp.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "shipments",
"outer_alias": "whs",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_06455 | train | T2 |
v2 | Schema:
schedules (alias: schd)(name, salary, value, level)
transactions(amount, name, level, type)
Task: Find id from schedules where a matching record exists in transactions with the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_06456 | train | T2 |
v1 | Schema:
accounts (alias: acct)(date, code, type, level)
departments(id, value, status, amount)
Task: Find amount from accounts where level appears in departments entries with matching level.
SQL: | SELECT amount FROM accounts AS acct
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_06457 | train | T1 |
v1 | Schema:
services (alias: srvc)(name, code, date, status)
orders(type, status, date, salary)
Task: Retrieve amount from services whose id is found in orders rows where level matches the outer record.
SQL: | SELECT amount FROM services AS srvc
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "orders",
"outer_alias": "srvc",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_06458 | train | T2 |
v3 | Schema:
managers (alias: mgr)(salary, value, level, code)
accounts(id, amount, level, name)
Task: Retrieve value from managers with value above the AVG(salary) of accounts rows sharing the same code.
SQL: | SELECT value FROM managers AS mgr
WHERE value > (
SELECT AVG(salary) FROM accounts AS acct
WHERE acct.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_06459 | train | T1 |
v1 | Schema:
departments (alias: dept)(salary, amount, value, code)
warehouses(value, date, status, level)
Task: Retrieve amount from departments whose status is found in warehouses rows where level matches the outer record.
SQL: | SELECT amount FROM departments AS dept
WHERE status IN (
SELECT status FROM warehouses AS whs
WHERE whs.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "warehouses",
"outer_alias": "dept",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_06460 | train | T1 |
v1 | Schema:
schedules (alias: schd)(value, amount, level, code)
managers(date, amount, type, id)
Task: Select salary from schedules where code exists in managers for the same level.
SQL: | SELECT salary FROM schedules AS schd
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_06461 | train | T2 |
v2 | Schema:
accounts (alias: acct)(level, amount, date, value)
transactions(level, date, name, type)
Task: Retrieve id from accounts that have at least one corresponding entry in transactions sharing the same code.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_06462 | train | T1 |
v2 | Schema:
products (alias: prod)(code, value, status, amount)
accounts(id, amount, value, type)
Task: Retrieve id from products that have at least one corresponding entry in accounts sharing the same type.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = prod.type
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_06463 | train | T1 |
v1 | Schema:
products (alias: prod)(code, type, status, salary)
orders(amount, type, id, level)
Task: Find code from products where status appears in orders entries with matching type.
SQL: | SELECT code FROM products AS prod
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.type = prod.type
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_06464 | train | T1 |
v3 | Schema:
sales (alias: sale)(value, id, level, amount)
customers(id, value, status, date)
Task: Find name from sales where amount exceeds the average value from customers for the same code.
SQL: | SELECT name FROM sales AS sale
WHERE amount > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_06465 | train | T1 |
v3 | Schema:
regions (alias: rgn)(level, amount, code, status)
transactions(type, level, value, date)
Task: Retrieve salary from regions with value above the MAX(value) of transactions rows sharing the same code.
SQL: | SELECT salary FROM regions AS rgn
WHERE value > (
SELECT MAX(value) FROM transactions AS txn
WHERE txn.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_06466 | train | T2 |
v1 | Schema:
items (alias: lne)(status, amount, name, type)
managers(name, salary, id, amount)
Task: Find id from items where type appears in managers entries with matching level.
SQL: | SELECT id FROM items AS lne
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.level = lne.level
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_06467 | train | T2 |
v1 | Schema:
invoices (alias: inv)(type, id, name, status)
customers(amount, value, type, salary)
Task: Select value from invoices where code exists in customers for the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_06468 | train | T1 |
v1 | Schema:
products (alias: prod)(value, level, status, type)
staff(code, status, level, value)
Task: Select code from products where id exists in staff for the same code.
SQL: | SELECT code FROM products AS prod
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.code = prod.code
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_06469 | train | T1 |
v2 | Schema:
budgets (alias: budg)(code, type, name, amount)
accounts(id, value, code, amount)
Task: Find amount from budgets where a matching record exists in accounts with the same code.
SQL: | SELECT amount FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "accounts",
"outer_alias": "budg",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_06470 | train | T2 |
v2 | Schema:
managers (alias: mgr)(amount, level, salary, name)
sales(status, id, value, code)
Task: Find name from managers where a matching record exists in sales with the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_06471 | train | T1 |
v3 | Schema:
employees (alias: emp)(code, id, level, type)
staff(code, salary, type, name)
Task: Retrieve value from employees with value above the MIN(value) of staff rows sharing the same code.
SQL: | SELECT value FROM employees AS emp
WHERE value > (
SELECT MIN(value) FROM staff AS empl
WHERE empl.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_06472 | train | T1 |
v1 | Schema:
services (alias: srvc)(salary, name, date, value)
categories(id, status, date, code)
Task: Find amount from services where type appears in categories entries with matching status.
SQL: | SELECT amount FROM services AS srvc
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "categories",
"outer_alias": "srvc",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_06473 | train | T2 |
v2 | Schema:
services (alias: srvc)(code, value, status, id)
categories(amount, type, status, id)
Task: Retrieve id from services that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT id FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "categories",
"outer_alias": "srvc",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_06474 | train | T2 |
v1 | Schema:
accounts (alias: acct)(id, salary, status, code)
departments(code, date, id, name)
Task: Find name from accounts where code appears in departments entries with matching status.
SQL: | SELECT name FROM accounts AS acct
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_06475 | train | T1 |
v2 | Schema:
customers (alias: cust)(salary, amount, code, value)
invoices(level, code, status, date)
Task: Find name from customers where a matching record exists in invoices with the same id.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_06476 | train | T1 |
v2 | Schema:
budgets (alias: budg)(id, type, salary, code)
shipments(date, salary, id, amount)
Task: Retrieve value from budgets that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT value FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "shipments",
"outer_alias": "budg",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_06477 | train | T2 |
v1 | Schema:
invoices (alias: inv)(id, amount, type, salary)
orders(id, status, name, date)
Task: Find value from invoices where code appears in orders entries with matching id.
SQL: | SELECT value FROM invoices AS inv
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_06478 | train | T1 |
v2 | Schema:
schedules (alias: schd)(name, date, id, value)
transactions(code, salary, name, level)
Task: Find id from schedules where a matching record exists in transactions with the same level.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_06479 | train | T2 |
v3 | Schema:
accounts (alias: acct)(code, type, salary, amount)
managers(level, status, id, code)
Task: Retrieve amount from accounts with salary above the MAX(value) of managers rows sharing the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE salary > (
SELECT MAX(value) FROM managers AS mgr
WHERE mgr.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_06480 | train | T1 |
v1 | Schema:
products (alias: prod)(salary, level, amount, date)
employees(status, level, name, value)
Task: Find value from products where level appears in employees entries with matching id.
SQL: | SELECT value FROM products AS prod
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.id = prod.id
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_06481 | train | T1 |
v1 | Schema:
transactions (alias: txn)(code, value, level, salary)
managers(amount, salary, code, level)
Task: Retrieve amount from transactions whose level is found in managers rows where status matches the outer record.
SQL: | SELECT amount FROM transactions AS txn
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_06482 | train | T1 |
v3 | Schema:
employees (alias: emp)(code, name, value, date)
schedules(code, amount, name, status)
Task: Find amount from employees where salary exceeds the average amount from schedules for the same level.
SQL: | SELECT amount FROM employees AS emp
WHERE salary > (
SELECT AVG(amount) FROM schedules AS schd
WHERE schd.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_06483 | train | T1 |
v2 | Schema:
sales (alias: sale)(value, code, status, name)
items(amount, name, salary, status)
Task: Find amount from sales where a matching record exists in items with the same status.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_06484 | train | T1 |
v1 | Schema:
budgets (alias: budg)(status, level, value, salary)
invoices(value, name, id, level)
Task: Find salary from budgets where code appears in invoices entries with matching id.
SQL: | SELECT salary FROM budgets AS budg
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "invoices",
"outer_alias": "budg",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_06485 | train | T2 |
v2 | Schema:
sales (alias: sale)(level, value, status, code)
warehouses(status, code, amount, name)
Task: Find salary from sales where a matching record exists in warehouses with the same id.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "warehouses",
"outer_alias": "sale",
"inner_alias": "whs",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_06486 | train | T1 |
v3 | Schema:
items (alias: lne)(level, name, id, code)
customers(name, date, type, id)
Task: Find salary from items where salary exceeds the average amount from customers for the same status.
SQL: | SELECT salary FROM items AS lne
WHERE salary > (
SELECT SUM(amount) 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": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_06487 | train | T2 |
v2 | Schema:
departments (alias: dept)(code, level, id, salary)
budgets(id, value, level, amount)
Task: Find salary from departments where a matching record exists in budgets with the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "budgets",
"outer_alias": "dept",
"inner_alias": "budg",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_06488 | train | T1 |
v2 | Schema:
orders (alias: ord)(level, type, code, value)
regions(date, id, value, level)
Task: Retrieve amount from orders that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_06489 | train | T1 |
v3 | Schema:
requests (alias: ordr)(name, level, type, value)
warehouses(level, amount, code, id)
Task: Find salary from requests where value exceeds the average salary from warehouses for the same id.
SQL: | SELECT salary FROM requests AS ordr
WHERE value > (
SELECT COUNT(salary) FROM warehouses AS whs
WHERE whs.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "warehouses",
"outer_alias": "ordr",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_06490 | train | T2 |
v2 | Schema:
products (alias: prod)(id, value, date, amount)
sales(type, name, date, id)
Task: Find name from products where a matching record exists in sales with the same code.
SQL: | SELECT name 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": "name",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_06491 | train | T1 |
v1 | Schema:
regions (alias: rgn)(status, value, salary, level)
orders(code, type, value, status)
Task: Select code from regions where level exists in orders for the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_06492 | train | T2 |
v3 | Schema:
transactions (alias: txn)(name, status, amount, code)
products(name, code, date, status)
Task: Find id from transactions where value exceeds the average salary from products for the same code.
SQL: | SELECT id FROM transactions AS txn
WHERE value > (
SELECT SUM(salary) FROM products AS prod
WHERE prod.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_06493 | train | T1 |
v2 | Schema:
services (alias: srvc)(id, level, type, value)
budgets(date, id, code, level)
Task: Find code from services where a matching record exists in budgets with the same status.
SQL: | SELECT code FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "budgets",
"outer_alias": "srvc",
"inner_alias": "budg",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_06494 | train | T2 |
v1 | Schema:
transactions (alias: txn)(code, type, id, amount)
schedules(level, salary, id, value)
Task: Select name from transactions where id exists in schedules for the same type.
SQL: | SELECT name FROM transactions AS txn
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_06495 | train | T1 |
v1 | Schema:
services (alias: srvc)(level, code, name, date)
budgets(code, level, name, type)
Task: Find name from services where type appears in budgets entries with matching level.
SQL: | SELECT name FROM services AS srvc
WHERE type IN (
SELECT type FROM budgets AS budg
WHERE budg.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "budgets",
"outer_alias": "srvc",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_06496 | train | T2 |
v3 | Schema:
items (alias: lne)(id, salary, status, type)
accounts(code, id, name, type)
Task: Find code from items where salary exceeds the average value from accounts for the same code.
SQL: | SELECT code FROM items AS lne
WHERE salary > (
SELECT MAX(value) FROM accounts AS acct
WHERE acct.code = lne.code
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_06497 | train | T2 |
v1 | Schema:
customers (alias: cust)(code, id, status, date)
orders(status, type, salary, name)
Task: Select code from customers where code exists in orders for the same code.
SQL: | SELECT code FROM customers AS cust
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_06498 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(id, date, value, status)
transactions(salary, type, id, name)
Task: Find id from warehouses where type appears in transactions entries with matching id.
SQL: | SELECT id FROM warehouses AS whs
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "transactions",
"outer_alias": "whs",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_06499 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.