variant stringclasses 3
values | prompt stringlengths 163 237 | sql stringlengths 103 143 | metadata unknown | id stringlengths 21 21 | split stringclasses 1
value | token_group stringclasses 2
values |
|---|---|---|---|---|---|---|
v3 | Schema:
services (alias: srvc)(date, name, salary, level)
schedules(name, status, date, salary)
Task: Retrieve name from services with amount above the AVG(amount) of schedules rows sharing the same code.
SQL: | SELECT name FROM services AS srvc
WHERE amount > (
SELECT AVG(amount) FROM schedules AS schd
WHERE schd.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "schedules",
"outer_alias": "srvc",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_07600 | train | T2 |
v3 | Schema:
items (alias: lne)(id, value, salary, type)
accounts(date, value, name, type)
Task: Find value from items where value exceeds the average value from accounts for the same code.
SQL: | SELECT value FROM items AS lne
WHERE value > (
SELECT AVG(value) FROM accounts AS acct
WHERE acct.code = lne.code
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_07601 | train | T2 |
v1 | Schema:
invoices (alias: inv)(salary, value, status, type)
transactions(value, name, date, status)
Task: Retrieve id from invoices whose id is found in transactions rows where id matches the outer record.
SQL: | SELECT id FROM invoices AS inv
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_07602 | train | T1 |
v3 | Schema:
services (alias: srvc)(salary, type, level, value)
warehouses(code, type, date, value)
Task: Retrieve value from services with value above the MIN(value) of warehouses rows sharing the same type.
SQL: | SELECT value FROM services AS srvc
WHERE value > (
SELECT MIN(value) FROM warehouses AS whs
WHERE whs.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "warehouses",
"outer_alias": "srvc",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_07603 | train | T2 |
v1 | Schema:
shipments (alias: shp)(name, code, salary, id)
warehouses(type, code, date, amount)
Task: Select amount from shipments where level exists in warehouses for the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE level IN (
SELECT level FROM warehouses AS whs
WHERE whs.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "warehouses",
"outer_alias": "shp",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_07604 | train | T2 |
v3 | Schema:
products (alias: prod)(date, level, status, amount)
orders(salary, value, level, code)
Task: Find code from products where value exceeds the average amount from orders for the same code.
SQL: | SELECT code FROM products AS prod
WHERE value > (
SELECT SUM(amount) FROM orders AS ord
WHERE ord.code = prod.code
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_07605 | train | T1 |
v1 | Schema:
orders (alias: ord)(id, code, type, amount)
requests(code, level, id, amount)
Task: Select amount from orders where type exists in requests for the same status.
SQL: | SELECT amount FROM orders AS ord
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_07606 | train | T1 |
v1 | Schema:
sales (alias: sale)(salary, amount, type, level)
budgets(status, amount, salary, name)
Task: Select salary from sales where level exists in budgets for the same status.
SQL: | SELECT salary FROM sales AS sale
WHERE level IN (
SELECT level FROM budgets AS budg
WHERE budg.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "budgets",
"outer_alias": "sale",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_07607 | train | T1 |
v1 | Schema:
requests (alias: ordr)(name, level, amount, salary)
departments(value, level, amount, code)
Task: Find name from requests where level appears in departments entries with matching status.
SQL: | SELECT name FROM requests AS ordr
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_07608 | train | T2 |
v3 | Schema:
budgets (alias: budg)(type, id, status, amount)
schedules(salary, amount, code, level)
Task: Retrieve value from budgets with value above the SUM(value) of schedules rows sharing the same code.
SQL: | SELECT value FROM budgets AS budg
WHERE value > (
SELECT SUM(value) FROM schedules AS schd
WHERE schd.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "schedules",
"outer_alias": "budg",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_07609 | train | T2 |
v3 | Schema:
managers (alias: mgr)(type, amount, date, status)
staff(id, level, code, salary)
Task: Retrieve name from managers with amount above the COUNT(value) of staff rows sharing the same code.
SQL: | SELECT name FROM managers AS mgr
WHERE amount > (
SELECT COUNT(value) FROM staff AS empl
WHERE empl.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_07610 | train | T1 |
v3 | Schema:
categories (alias: catg)(status, id, code, amount)
shipments(code, date, type, salary)
Task: Retrieve value from categories with salary above the MIN(amount) of shipments rows sharing the same code.
SQL: | SELECT value FROM categories AS catg
WHERE salary > (
SELECT MIN(amount) FROM shipments AS shp
WHERE shp.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_07611 | train | T2 |
v2 | Schema:
employees (alias: emp)(status, code, type, id)
orders(amount, status, code, id)
Task: Retrieve salary from employees that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_07612 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(type, code, level, salary)
accounts(status, amount, type, id)
Task: Find id from warehouses where value exceeds the average salary from accounts for the same type.
SQL: | SELECT id FROM warehouses AS whs
WHERE value > (
SELECT MIN(salary) FROM accounts AS acct
WHERE acct.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "accounts",
"outer_alias": "whs",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_07613 | train | T2 |
v2 | Schema:
transactions (alias: txn)(level, date, name, salary)
shipments(date, name, code, level)
Task: Find salary from transactions where a matching record exists in shipments with the same type.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_07614 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(name, amount, date, code)
services(level, status, value, code)
Task: Retrieve name from warehouses whose id is found in services rows where id matches the outer record.
SQL: | SELECT name FROM warehouses AS whs
WHERE id IN (
SELECT id FROM services AS srvc
WHERE srvc.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "services",
"outer_alias": "whs",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_07615 | train | T2 |
v2 | Schema:
invoices (alias: inv)(value, code, type, name)
budgets(code, amount, level, id)
Task: Find id from invoices where a matching record exists in budgets with the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "budgets",
"outer_alias": "inv",
"inner_alias": "budg",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_07616 | train | T1 |
v3 | Schema:
schedules (alias: schd)(level, type, id, value)
invoices(salary, id, date, amount)
Task: Retrieve salary from schedules with amount above the SUM(value) of invoices rows sharing the same id.
SQL: | SELECT salary FROM schedules AS schd
WHERE amount > (
SELECT SUM(value) FROM invoices AS inv
WHERE inv.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_07617 | train | T2 |
v2 | Schema:
schedules (alias: schd)(salary, value, name, level)
sales(name, id, level, code)
Task: Retrieve amount from schedules that have at least one corresponding entry in sales sharing the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_07618 | train | T2 |
v2 | Schema:
items (alias: lne)(amount, name, code, type)
orders(name, id, status, date)
Task: Find value from items where a matching record exists in orders with the same id.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = lne.id
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_07619 | train | T2 |
v1 | Schema:
orders (alias: ord)(amount, value, salary, type)
categories(amount, date, type, value)
Task: Select amount from orders where type exists in categories for the same id.
SQL: | SELECT amount FROM orders AS ord
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_07620 | train | T1 |
v1 | Schema:
customers (alias: cust)(name, status, code, id)
warehouses(name, level, salary, date)
Task: Retrieve code from customers whose level is found in warehouses rows where code matches the outer record.
SQL: | SELECT code 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": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_07621 | train | T1 |
v1 | Schema:
managers (alias: mgr)(id, type, level, code)
orders(level, name, amount, id)
Task: Select code from managers where level exists in orders for the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_07622 | train | T1 |
v3 | Schema:
accounts (alias: acct)(code, status, name, value)
regions(name, amount, id, type)
Task: Retrieve salary from accounts with salary above the MAX(salary) of regions rows sharing the same status.
SQL: | SELECT salary FROM accounts AS acct
WHERE salary > (
SELECT MAX(salary) FROM regions AS rgn
WHERE rgn.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_07623 | train | T1 |
v2 | Schema:
managers (alias: mgr)(amount, salary, value, level)
shipments(value, level, salary, date)
Task: Find value from managers where a matching record exists in shipments with the same status.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_07624 | train | T1 |
v2 | Schema:
regions (alias: rgn)(date, name, type, status)
staff(status, amount, code, id)
Task: Find name from regions where a matching record exists in staff with the same id.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_07625 | train | T2 |
v1 | Schema:
staff (alias: empl)(code, amount, id, salary)
sales(type, level, status, name)
Task: Select value from staff where code exists in sales for the same status.
SQL: | SELECT value FROM staff AS empl
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_07626 | train | T2 |
v3 | Schema:
regions (alias: rgn)(name, code, type, salary)
employees(amount, code, id, status)
Task: Find id from regions where amount exceeds the average amount from employees for the same type.
SQL: | SELECT id FROM regions AS rgn
WHERE amount > (
SELECT SUM(amount) FROM employees AS emp
WHERE emp.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_07627 | train | T2 |
v2 | Schema:
categories (alias: catg)(type, level, code, date)
services(type, code, amount, salary)
Task: Find name from categories where a matching record exists in services with the same level.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "services",
"outer_alias": "catg",
"inner_alias": "srvc",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_07628 | train | T2 |
v1 | Schema:
invoices (alias: inv)(salary, level, value, id)
transactions(date, status, value, id)
Task: Find name from invoices where code appears in transactions entries with matching code.
SQL: | SELECT name FROM invoices AS inv
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_07629 | train | T1 |
v3 | Schema:
customers (alias: cust)(level, id, name, code)
employees(name, salary, status, code)
Task: Find name from customers where salary exceeds the average value from employees for the same id.
SQL: | SELECT name FROM customers AS cust
WHERE salary > (
SELECT MAX(value) FROM employees AS emp
WHERE emp.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_07630 | train | T1 |
v2 | Schema:
shipments (alias: shp)(salary, type, name, date)
customers(code, id, amount, name)
Task: Retrieve code from shipments that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_07631 | train | T2 |
v1 | Schema:
invoices (alias: inv)(id, code, level, amount)
warehouses(amount, date, name, level)
Task: Retrieve amount from invoices whose type is found in warehouses rows where id matches the outer record.
SQL: | SELECT amount FROM invoices AS inv
WHERE type IN (
SELECT type FROM warehouses AS whs
WHERE whs.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "warehouses",
"outer_alias": "inv",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_07632 | train | T1 |
v1 | Schema:
transactions (alias: txn)(value, date, level, status)
budgets(type, id, name, status)
Task: Retrieve code from transactions whose id is found in budgets rows where status matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE id IN (
SELECT id FROM budgets AS budg
WHERE budg.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "budgets",
"outer_alias": "txn",
"inner_alias": "budg",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_07633 | train | T1 |
v3 | Schema:
customers (alias: cust)(status, id, type, amount)
items(salary, code, level, amount)
Task: Find id from customers where salary exceeds the average salary from items for the same id.
SQL: | SELECT id FROM customers AS cust
WHERE salary > (
SELECT MIN(salary) FROM items AS lne
WHERE lne.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_07634 | train | T1 |
v1 | Schema:
sales (alias: sale)(id, date, level, type)
regions(date, value, status, id)
Task: Retrieve value from sales whose level is found in regions rows where type matches the outer record.
SQL: | SELECT value FROM sales AS sale
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_07635 | train | T1 |
v3 | Schema:
requests (alias: ordr)(amount, level, date, value)
departments(value, name, code, salary)
Task: Retrieve amount from requests with salary above the MAX(value) of departments rows sharing the same type.
SQL: | SELECT amount FROM requests AS ordr
WHERE salary > (
SELECT MAX(value) FROM departments AS dept
WHERE dept.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_07636 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(id, amount, status, type)
items(name, salary, level, status)
Task: Find name from warehouses where a matching record exists in items with the same level.
SQL: | SELECT name FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "items",
"outer_alias": "whs",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_07637 | train | T2 |
v2 | Schema:
invoices (alias: inv)(date, salary, type, status)
staff(salary, amount, code, value)
Task: Retrieve code from invoices that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_07638 | train | T1 |
v3 | Schema:
regions (alias: rgn)(status, date, value, amount)
customers(status, salary, type, name)
Task: Retrieve value from regions with salary above the MIN(amount) of customers rows sharing the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE salary > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_07639 | train | T2 |
v1 | Schema:
invoices (alias: inv)(level, salary, value, amount)
orders(status, salary, value, level)
Task: Select amount from invoices where status exists in orders for the same status.
SQL: | SELECT amount FROM invoices AS inv
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_07640 | train | T1 |
v3 | Schema:
schedules (alias: schd)(name, salary, type, code)
shipments(salary, level, value, amount)
Task: Find salary from schedules where amount exceeds the average value from shipments for the same status.
SQL: | SELECT salary FROM schedules AS schd
WHERE amount > (
SELECT MAX(value) FROM shipments AS shp
WHERE shp.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_07641 | train | T2 |
v3 | Schema:
categories (alias: catg)(id, name, amount, type)
schedules(salary, code, name, level)
Task: Retrieve salary from categories with value above the MAX(amount) of schedules rows sharing the same status.
SQL: | SELECT salary FROM categories AS catg
WHERE value > (
SELECT MAX(amount) FROM schedules AS schd
WHERE schd.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_07642 | train | T2 |
v1 | Schema:
employees (alias: emp)(id, value, type, amount)
invoices(value, amount, code, date)
Task: Find amount from employees where status appears in invoices entries with matching code.
SQL: | SELECT amount FROM employees AS emp
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_07643 | train | T1 |
v1 | Schema:
managers (alias: mgr)(date, amount, type, id)
sales(level, name, status, salary)
Task: Find id from managers where id appears in sales entries with matching code.
SQL: | SELECT id FROM managers AS mgr
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_07644 | train | T1 |
v2 | Schema:
orders (alias: ord)(id, type, value, level)
services(type, level, id, code)
Task: Find name from orders where a matching record exists in services with the same code.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "services",
"outer_alias": "ord",
"inner_alias": "srvc",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_07645 | train | T1 |
v2 | Schema:
schedules (alias: schd)(value, status, date, name)
transactions(level, type, status, id)
Task: Retrieve salary from schedules that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_07646 | train | T2 |
v3 | Schema:
regions (alias: rgn)(id, level, salary, type)
services(value, code, status, date)
Task: Find name from regions where amount exceeds the average value from services for the same code.
SQL: | SELECT name FROM regions AS rgn
WHERE amount > (
SELECT MIN(value) FROM services AS srvc
WHERE srvc.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "services",
"outer_alias": "rgn",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_07647 | train | T2 |
v2 | Schema:
sales (alias: sale)(name, amount, date, salary)
categories(status, name, id, type)
Task: Retrieve amount from sales that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_07648 | train | T1 |
v3 | Schema:
transactions (alias: txn)(level, salary, status, value)
categories(code, amount, level, id)
Task: Find amount from transactions where value exceeds the average salary from categories for the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE value > (
SELECT MAX(salary) FROM categories AS catg
WHERE catg.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_07649 | train | T1 |
v2 | Schema:
staff (alias: empl)(name, value, amount, status)
departments(id, date, salary, value)
Task: Find value from staff where a matching record exists in departments with the same type.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_07650 | train | T2 |
v1 | Schema:
staff (alias: empl)(code, id, value, amount)
customers(amount, salary, code, date)
Task: Select id from staff where type exists in customers for the same code.
SQL: | SELECT id FROM staff AS empl
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_07651 | train | T2 |
v2 | Schema:
departments (alias: dept)(level, value, name, date)
warehouses(amount, id, name, code)
Task: Retrieve id from departments that have at least one corresponding entry in warehouses sharing the same code.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "warehouses",
"outer_alias": "dept",
"inner_alias": "whs",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_07652 | train | T1 |
v2 | Schema:
employees (alias: emp)(id, type, date, amount)
shipments(level, name, amount, value)
Task: Retrieve id from employees that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_07653 | train | T1 |
v1 | Schema:
transactions (alias: txn)(date, name, amount, code)
orders(code, salary, amount, status)
Task: Select salary from transactions where id exists in orders for the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_07654 | train | T1 |
v1 | Schema:
budgets (alias: budg)(amount, id, value, status)
transactions(salary, status, type, id)
Task: Select salary from budgets where code exists in transactions for the same code.
SQL: | SELECT salary FROM budgets AS budg
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "transactions",
"outer_alias": "budg",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_07655 | train | T2 |
v2 | Schema:
products (alias: prod)(status, code, salary, value)
sales(code, date, status, salary)
Task: Find name from products where a matching record exists in sales with the same level.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = prod.level
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_07656 | train | T1 |
v2 | Schema:
sales (alias: sale)(value, amount, salary, code)
warehouses(level, name, date, status)
Task: Retrieve amount from sales that have at least one corresponding entry in warehouses sharing the same level.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "warehouses",
"outer_alias": "sale",
"inner_alias": "whs",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_07657 | train | T1 |
v2 | Schema:
staff (alias: empl)(level, salary, id, value)
items(date, level, id, amount)
Task: Retrieve code from staff that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_07658 | train | T2 |
v3 | Schema:
transactions (alias: txn)(status, value, level, date)
customers(id, value, amount, level)
Task: Retrieve name from transactions with value above the SUM(amount) of customers rows sharing the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE value > (
SELECT SUM(amount) FROM customers AS cust
WHERE cust.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_07659 | train | T1 |
v2 | Schema:
schedules (alias: schd)(id, code, salary, value)
warehouses(type, status, salary, code)
Task: Find salary from schedules where a matching record exists in warehouses with the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "warehouses",
"outer_alias": "schd",
"inner_alias": "whs",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_07660 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(value, status, level, amount)
schedules(level, salary, date, amount)
Task: Find code from warehouses where a matching record exists in schedules with the same level.
SQL: | SELECT code FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "schedules",
"outer_alias": "whs",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_07661 | train | T2 |
v2 | Schema:
managers (alias: mgr)(date, name, type, salary)
invoices(type, code, value, status)
Task: Retrieve name from managers that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_07662 | train | T1 |
v2 | Schema:
shipments (alias: shp)(salary, date, id, level)
departments(value, id, level, code)
Task: Retrieve id from shipments that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_07663 | train | T2 |
v3 | Schema:
transactions (alias: txn)(status, amount, date, type)
services(status, value, amount, date)
Task: Retrieve code from transactions with amount above the MAX(salary) of services rows sharing the same code.
SQL: | SELECT code FROM transactions AS txn
WHERE amount > (
SELECT MAX(salary) FROM services AS srvc
WHERE srvc.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "services",
"outer_alias": "txn",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_07664 | train | T1 |
v2 | Schema:
items (alias: lne)(type, code, level, amount)
staff(date, amount, value, id)
Task: Find name from items where a matching record exists in staff with the same type.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = lne.type
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_07665 | train | T2 |
v3 | Schema:
budgets (alias: budg)(amount, code, level, id)
services(name, salary, id, level)
Task: Retrieve amount from budgets with value above the SUM(salary) of services rows sharing the same type.
SQL: | SELECT amount FROM budgets AS budg
WHERE value > (
SELECT SUM(salary) FROM services AS srvc
WHERE srvc.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "services",
"outer_alias": "budg",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_07666 | train | T2 |
v3 | Schema:
customers (alias: cust)(status, type, id, name)
budgets(amount, level, id, code)
Task: Find amount from customers where salary exceeds the average value from budgets for the same level.
SQL: | SELECT amount FROM customers AS cust
WHERE salary > (
SELECT SUM(value) FROM budgets AS budg
WHERE budg.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "budgets",
"outer_alias": "cust",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_07667 | train | T1 |
v2 | Schema:
invoices (alias: inv)(amount, type, level, date)
budgets(amount, salary, code, status)
Task: Find name from invoices where a matching record exists in budgets with the same status.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "budgets",
"outer_alias": "inv",
"inner_alias": "budg",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_07668 | train | T1 |
v3 | Schema:
shipments (alias: shp)(status, type, id, level)
departments(value, level, date, name)
Task: Find salary from shipments where amount exceeds the average value from departments for the same status.
SQL: | SELECT salary FROM shipments AS shp
WHERE amount > (
SELECT AVG(value) FROM departments AS dept
WHERE dept.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_07669 | train | T2 |
v2 | Schema:
invoices (alias: inv)(id, date, code, type)
sales(name, date, id, level)
Task: Retrieve amount from invoices that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_07670 | train | T1 |
v1 | Schema:
items (alias: lne)(level, id, code, salary)
sales(value, name, type, salary)
Task: Find salary from items where level appears in sales entries with matching status.
SQL: | SELECT salary FROM items AS lne
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.status = lne.status
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_07671 | train | T2 |
v2 | Schema:
items (alias: lne)(id, salary, type, value)
products(amount, level, id, type)
Task: Find name from items where a matching record exists in products with the same type.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = lne.type
); | {
"outer_table": "items",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_fixed_train_07672 | train | T2 |
v1 | Schema:
budgets (alias: budg)(code, type, status, value)
employees(value, date, level, status)
Task: Find salary from budgets where type appears in employees entries with matching status.
SQL: | SELECT salary FROM budgets AS budg
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "employees",
"outer_alias": "budg",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_07673 | train | T2 |
v3 | Schema:
sales (alias: sale)(level, code, amount, id)
budgets(name, level, id, salary)
Task: Retrieve value from sales with amount above the AVG(salary) of budgets rows sharing the same level.
SQL: | SELECT value FROM sales AS sale
WHERE amount > (
SELECT AVG(salary) FROM budgets AS budg
WHERE budg.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "budgets",
"outer_alias": "sale",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_07674 | train | T1 |
v1 | Schema:
items (alias: lne)(code, date, salary, status)
managers(value, type, status, name)
Task: Retrieve salary from items whose status is found in managers rows where code matches the outer record.
SQL: | SELECT salary FROM items AS lne
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_07675 | train | T2 |
v2 | Schema:
invoices (alias: inv)(level, code, status, value)
services(type, id, date, value)
Task: Retrieve id from invoices that have at least one corresponding entry in services sharing the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "services",
"outer_alias": "inv",
"inner_alias": "srvc",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_07676 | train | T1 |
v3 | Schema:
categories (alias: catg)(salary, code, date, type)
schedules(status, level, code, type)
Task: Retrieve name from categories with salary above the MIN(salary) of schedules rows sharing the same type.
SQL: | SELECT name FROM categories AS catg
WHERE salary > (
SELECT MIN(salary) FROM schedules AS schd
WHERE schd.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_07677 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(salary, code, type, status)
employees(type, name, id, value)
Task: Retrieve name from warehouses that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT name FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "employees",
"outer_alias": "whs",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_07678 | train | T2 |
v3 | Schema:
products (alias: prod)(value, salary, type, name)
shipments(status, amount, salary, value)
Task: Retrieve salary from products with value above the COUNT(value) of shipments rows sharing the same id.
SQL: | SELECT salary FROM products AS prod
WHERE value > (
SELECT COUNT(value) FROM shipments AS shp
WHERE shp.id = prod.id
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_07679 | train | T1 |
v3 | Schema:
invoices (alias: inv)(id, type, level, value)
services(type, status, name, value)
Task: Find id from invoices where value exceeds the average amount from services for the same code.
SQL: | SELECT id FROM invoices AS inv
WHERE value > (
SELECT AVG(amount) FROM services AS srvc
WHERE srvc.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "services",
"outer_alias": "inv",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_07680 | train | T1 |
v2 | Schema:
sales (alias: sale)(type, amount, name, date)
departments(name, salary, level, date)
Task: Find salary from sales where a matching record exists in departments with the same status.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_07681 | train | T1 |
v1 | Schema:
requests (alias: ordr)(amount, value, level, code)
categories(level, id, code, status)
Task: Find value from requests where status appears in categories entries with matching code.
SQL: | SELECT value FROM requests AS ordr
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_07682 | train | T2 |
v2 | Schema:
accounts (alias: acct)(level, type, name, value)
staff(code, type, level, id)
Task: Find salary from accounts where a matching record exists in staff with the same level.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_07683 | train | T1 |
v3 | Schema:
managers (alias: mgr)(code, type, status, name)
shipments(id, status, salary, level)
Task: Retrieve value from managers with value above the SUM(value) of shipments rows sharing the same level.
SQL: | SELECT value FROM managers AS mgr
WHERE value > (
SELECT SUM(value) FROM shipments AS shp
WHERE shp.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_07684 | train | T1 |
v3 | Schema:
items (alias: lne)(date, type, code, amount)
customers(amount, date, name, level)
Task: Retrieve id from items with amount above the COUNT(amount) of customers rows sharing the same status.
SQL: | SELECT id FROM items AS lne
WHERE amount > (
SELECT COUNT(amount) FROM customers AS cust
WHERE cust.status = lne.status
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_07685 | train | T2 |
v2 | Schema:
requests (alias: ordr)(amount, code, value, name)
employees(status, name, date, level)
Task: Retrieve name from requests that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_07686 | train | T2 |
v2 | Schema:
invoices (alias: inv)(value, salary, amount, id)
transactions(salary, type, level, code)
Task: Find name from invoices where a matching record exists in transactions with the same id.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_07687 | train | T1 |
v1 | Schema:
sales (alias: sale)(id, date, amount, code)
customers(level, date, type, value)
Task: Select code from sales where code exists in customers for the same level.
SQL: | SELECT code FROM sales AS sale
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_07688 | train | T1 |
v3 | Schema:
products (alias: prod)(type, id, status, salary)
staff(type, date, id, status)
Task: Retrieve id from products with value above the SUM(amount) of staff rows sharing the same level.
SQL: | SELECT id FROM products AS prod
WHERE value > (
SELECT SUM(amount) FROM staff AS empl
WHERE empl.level = prod.level
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_07689 | train | T1 |
v1 | Schema:
staff (alias: empl)(value, id, salary, name)
transactions(amount, level, id, value)
Task: Find salary from staff where code appears in transactions entries with matching status.
SQL: | SELECT salary 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": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_07690 | train | T2 |
v1 | Schema:
employees (alias: emp)(amount, code, level, salary)
staff(amount, level, type, id)
Task: Retrieve code from employees whose status is found in staff rows where status matches the outer record.
SQL: | SELECT code FROM employees AS emp
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_07691 | train | T1 |
v2 | Schema:
accounts (alias: acct)(value, amount, type, level)
categories(date, type, name, salary)
Task: Find value from accounts where a matching record exists in categories with the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_07692 | train | T1 |
v1 | Schema:
services (alias: srvc)(name, date, id, code)
customers(value, code, type, date)
Task: Select id from services where type exists in customers for the same status.
SQL: | SELECT id FROM services AS srvc
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "customers",
"outer_alias": "srvc",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_07693 | train | T2 |
v2 | Schema:
sales (alias: sale)(id, type, date, name)
accounts(date, name, level, salary)
Task: Retrieve name from sales that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_07694 | train | T1 |
v3 | Schema:
transactions (alias: txn)(id, name, level, date)
budgets(type, date, name, amount)
Task: Retrieve salary from transactions with amount above the COUNT(value) of budgets rows sharing the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE amount > (
SELECT COUNT(value) FROM budgets AS budg
WHERE budg.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "budgets",
"outer_alias": "txn",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_07695 | train | T1 |
v1 | Schema:
transactions (alias: txn)(level, code, salary, name)
departments(name, type, amount, salary)
Task: Retrieve amount from transactions whose id is found in departments rows where type matches the outer record.
SQL: | SELECT amount FROM transactions AS txn
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_07696 | train | T1 |
v2 | Schema:
sales (alias: sale)(salary, amount, type, level)
warehouses(salary, code, status, value)
Task: Retrieve amount from sales that have at least one corresponding entry in warehouses sharing the same code.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "warehouses",
"outer_alias": "sale",
"inner_alias": "whs",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_07697 | train | T1 |
v3 | Schema:
budgets (alias: budg)(date, level, salary, id)
transactions(id, type, amount, status)
Task: Retrieve code from budgets with value above the MAX(value) of transactions rows sharing the same id.
SQL: | SELECT code FROM budgets AS budg
WHERE value > (
SELECT MAX(value) FROM transactions AS txn
WHERE txn.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "transactions",
"outer_alias": "budg",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_07698 | train | T2 |
v2 | Schema:
managers (alias: mgr)(value, code, status, level)
customers(date, status, level, amount)
Task: Find value from managers where a matching record exists in customers with the same level.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_07699 | train | T1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.