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:
employees (alias: emp)(value, type, level, name)
invoices(code, type, level, name)
Task: Retrieve salary from employees with value above the COUNT(value) of invoices rows sharing the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE value > (
SELECT COUNT(value) FROM invoices AS inv
WHERE inv.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_05500 | train | T1 |
v2 | Schema:
schedules (alias: schd)(code, value, level, amount)
services(value, amount, level, name)
Task: Retrieve value from schedules that have at least one corresponding entry in services sharing the same id.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "services",
"outer_alias": "schd",
"inner_alias": "srvc",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_05501 | train | T2 |
v2 | Schema:
managers (alias: mgr)(level, status, amount, value)
schedules(name, amount, id, type)
Task: Retrieve name from managers that have at least one corresponding entry in schedules sharing the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_05502 | train | T1 |
v3 | Schema:
schedules (alias: schd)(value, salary, date, amount)
invoices(level, date, id, status)
Task: Find code from schedules where value exceeds the average salary from invoices for the same type.
SQL: | SELECT code FROM schedules AS schd
WHERE value > (
SELECT MAX(salary) FROM invoices AS inv
WHERE inv.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_05503 | train | T2 |
v1 | Schema:
shipments (alias: shp)(code, date, value, status)
transactions(id, status, salary, type)
Task: Retrieve id from shipments whose type is found in transactions rows where status matches the outer record.
SQL: | SELECT id FROM shipments AS shp
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_05504 | train | T2 |
v1 | Schema:
shipments (alias: shp)(amount, name, id, value)
employees(level, id, value, type)
Task: Retrieve amount from shipments whose type is found in employees rows where level matches the outer record.
SQL: | SELECT amount FROM shipments AS shp
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_05505 | train | T2 |
v1 | Schema:
requests (alias: ordr)(date, id, code, status)
departments(value, id, date, salary)
Task: Retrieve name from requests whose code is found in departments rows where type matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_05506 | train | T2 |
v1 | Schema:
regions (alias: rgn)(status, salary, name, amount)
orders(salary, type, date, level)
Task: Select code from regions where code exists in orders for the same id.
SQL: | SELECT code FROM regions AS rgn
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_05507 | train | T2 |
v1 | Schema:
employees (alias: emp)(value, salary, amount, code)
sales(amount, value, salary, type)
Task: Select value from employees where id exists in sales for the same type.
SQL: | SELECT value FROM employees AS emp
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_05508 | train | T1 |
v1 | Schema:
sales (alias: sale)(status, amount, code, date)
shipments(value, code, salary, amount)
Task: Select id from sales where level exists in shipments for the same status.
SQL: | SELECT id FROM sales AS sale
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_05509 | train | T1 |
v3 | Schema:
invoices (alias: inv)(level, code, amount, name)
categories(salary, value, date, id)
Task: Retrieve code from invoices with value above the MIN(salary) of categories rows sharing the same status.
SQL: | SELECT code FROM invoices AS inv
WHERE value > (
SELECT MIN(salary) FROM categories AS catg
WHERE catg.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_05510 | train | T1 |
v2 | Schema:
accounts (alias: acct)(type, date, id, name)
schedules(code, level, value, status)
Task: Find id from accounts where a matching record exists in schedules with the same level.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_05511 | train | T1 |
v1 | Schema:
regions (alias: rgn)(code, level, status, date)
warehouses(level, id, code, name)
Task: Select id from regions where code exists in warehouses for the same code.
SQL: | SELECT id FROM regions AS rgn
WHERE code IN (
SELECT code FROM warehouses AS whs
WHERE whs.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "warehouses",
"outer_alias": "rgn",
"inner_alias": "whs",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_05512 | train | T2 |
v2 | Schema:
departments (alias: dept)(code, name, amount, type)
categories(id, amount, date, status)
Task: Retrieve name from departments that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_05513 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(salary, level, amount, id)
accounts(salary, code, value, type)
Task: Find name from warehouses where amount exceeds the average amount from accounts for the same level.
SQL: | SELECT name FROM warehouses AS whs
WHERE amount > (
SELECT COUNT(amount) FROM accounts AS acct
WHERE acct.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "accounts",
"outer_alias": "whs",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_05514 | train | T2 |
v2 | Schema:
budgets (alias: budg)(id, type, name, status)
orders(date, status, name, salary)
Task: Find name from budgets where a matching record exists in orders with the same type.
SQL: | SELECT name FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "orders",
"outer_alias": "budg",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_05515 | train | T2 |
v3 | Schema:
categories (alias: catg)(salary, date, name, status)
items(amount, name, type, id)
Task: Find name from categories where amount exceeds the average value from items for the same id.
SQL: | SELECT name FROM categories AS catg
WHERE amount > (
SELECT SUM(value) FROM items AS lne
WHERE lne.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_05516 | train | T2 |
v1 | Schema:
staff (alias: empl)(date, value, id, level)
items(salary, value, id, amount)
Task: Find value from staff where type appears in items entries with matching code.
SQL: | SELECT value FROM staff AS empl
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_05517 | train | T2 |
v2 | Schema:
categories (alias: catg)(name, type, value, amount)
transactions(level, code, amount, salary)
Task: Retrieve salary from categories that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_05518 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(value, id, code, date)
categories(type, id, value, name)
Task: Retrieve id from warehouses with salary above the COUNT(salary) of categories rows sharing the same code.
SQL: | SELECT id FROM warehouses AS whs
WHERE salary > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "categories",
"outer_alias": "whs",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_05519 | train | T2 |
v1 | Schema:
requests (alias: ordr)(salary, date, name, value)
categories(level, code, type, id)
Task: Retrieve value from requests whose level is found in categories rows where code matches the outer record.
SQL: | SELECT value FROM requests AS ordr
WHERE level IN (
SELECT level 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": "level",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_05520 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(code, level, status, id)
budgets(status, salary, value, date)
Task: Find code from warehouses where salary exceeds the average salary from budgets for the same status.
SQL: | SELECT code FROM warehouses AS whs
WHERE salary > (
SELECT MIN(salary) FROM budgets AS budg
WHERE budg.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "budgets",
"outer_alias": "whs",
"inner_alias": "budg",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_05521 | train | T2 |
v1 | Schema:
schedules (alias: schd)(level, name, salary, id)
items(type, amount, code, value)
Task: Retrieve code from schedules whose status is found in items rows where code matches the outer record.
SQL: | SELECT code FROM schedules AS schd
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_05522 | train | T2 |
v2 | Schema:
customers (alias: cust)(date, code, value, amount)
services(amount, level, salary, type)
Task: Retrieve salary from customers that have at least one corresponding entry in services sharing the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "services",
"outer_alias": "cust",
"inner_alias": "srvc",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_05523 | train | T1 |
v1 | Schema:
customers (alias: cust)(level, code, id, status)
warehouses(level, amount, date, code)
Task: Select name from customers where type exists in warehouses for the same code.
SQL: | SELECT name FROM customers AS cust
WHERE type IN (
SELECT type FROM warehouses AS whs
WHERE whs.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "warehouses",
"outer_alias": "cust",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_05524 | train | T1 |
v1 | Schema:
orders (alias: ord)(status, type, id, amount)
sales(type, status, value, level)
Task: Retrieve amount from orders whose status is found in sales rows where type matches the outer record.
SQL: | SELECT amount FROM orders AS ord
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_05525 | train | T1 |
v3 | Schema:
requests (alias: ordr)(level, code, status, salary)
orders(salary, status, value, id)
Task: Retrieve name from requests with amount above the SUM(salary) of orders rows sharing the same id.
SQL: | SELECT name FROM requests AS ordr
WHERE amount > (
SELECT SUM(salary) FROM orders AS ord
WHERE ord.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_05526 | train | T2 |
v3 | Schema:
orders (alias: ord)(salary, name, code, date)
requests(value, id, date, amount)
Task: Find code from orders where salary exceeds the average amount from requests for the same status.
SQL: | SELECT code FROM orders AS ord
WHERE salary > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_05527 | train | T1 |
v1 | Schema:
employees (alias: emp)(name, code, amount, date)
items(amount, level, date, id)
Task: Find code from employees where type appears in items entries with matching code.
SQL: | SELECT code FROM employees AS emp
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_05528 | train | T1 |
v1 | Schema:
budgets (alias: budg)(date, amount, value, level)
transactions(salary, status, type, code)
Task: Select name from budgets where type exists in transactions for the same id.
SQL: | SELECT name FROM budgets AS budg
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "transactions",
"outer_alias": "budg",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_05529 | train | T2 |
v1 | Schema:
transactions (alias: txn)(code, status, type, salary)
regions(id, name, type, date)
Task: Retrieve code from transactions whose level is found in regions rows where type matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_05530 | train | T1 |
v2 | Schema:
accounts (alias: acct)(salary, date, level, amount)
departments(amount, value, salary, code)
Task: Retrieve salary from accounts that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_05531 | train | T1 |
v3 | Schema:
sales (alias: sale)(status, date, level, code)
accounts(name, id, amount, value)
Task: Find code from sales where salary exceeds the average value from accounts for the same type.
SQL: | SELECT code FROM sales AS sale
WHERE salary > (
SELECT MIN(value) FROM accounts AS acct
WHERE acct.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_05532 | train | T1 |
v3 | Schema:
employees (alias: emp)(date, code, name, status)
warehouses(code, date, id, salary)
Task: Find amount from employees where value exceeds the average salary from warehouses for the same level.
SQL: | SELECT amount FROM employees AS emp
WHERE value > (
SELECT AVG(salary) FROM warehouses AS whs
WHERE whs.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "warehouses",
"outer_alias": "emp",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_05533 | train | T1 |
v2 | Schema:
budgets (alias: budg)(code, name, salary, level)
warehouses(name, amount, status, value)
Task: Find value from budgets where a matching record exists in warehouses with the same id.
SQL: | SELECT value FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "warehouses",
"outer_alias": "budg",
"inner_alias": "whs",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_05534 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(level, type, value, amount)
customers(amount, code, date, level)
Task: Find value from warehouses where id appears in customers entries with matching status.
SQL: | SELECT value FROM warehouses AS whs
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "customers",
"outer_alias": "whs",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_05535 | train | T2 |
v2 | Schema:
shipments (alias: shp)(name, type, salary, date)
schedules(value, date, status, amount)
Task: Retrieve name from shipments that have at least one corresponding entry in schedules sharing the same level.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_05536 | train | T2 |
v1 | Schema:
regions (alias: rgn)(type, date, value, amount)
services(status, code, value, salary)
Task: Retrieve name from regions whose type is found in services rows where code matches the outer record.
SQL: | SELECT name FROM regions AS rgn
WHERE type IN (
SELECT type 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": "type",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_05537 | train | T2 |
v3 | Schema:
budgets (alias: budg)(date, amount, id, code)
customers(status, date, salary, amount)
Task: Find amount from budgets where value exceeds the average amount from customers for the same level.
SQL: | SELECT amount FROM budgets AS budg
WHERE value > (
SELECT MAX(amount) FROM customers AS cust
WHERE cust.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "customers",
"outer_alias": "budg",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_05538 | train | T2 |
v1 | Schema:
managers (alias: mgr)(amount, salary, id, level)
orders(amount, code, name, type)
Task: Find salary from managers where code appears in orders entries with matching status.
SQL: | SELECT salary FROM managers AS mgr
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_05539 | train | T1 |
v2 | Schema:
employees (alias: emp)(name, date, type, salary)
requests(name, level, date, type)
Task: Find value from employees where a matching record exists in requests with the same code.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_05540 | train | T1 |
v2 | Schema:
services (alias: srvc)(status, type, level, salary)
invoices(code, name, status, amount)
Task: Retrieve salary from services that have at least one corresponding entry in invoices sharing the same code.
SQL: | SELECT salary FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "invoices",
"outer_alias": "srvc",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_05541 | train | T2 |
v2 | Schema:
shipments (alias: shp)(code, status, date, level)
transactions(code, name, value, salary)
Task: Find amount from shipments where a matching record exists in transactions with the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_05542 | train | T2 |
v1 | Schema:
items (alias: lne)(status, id, amount, date)
schedules(code, date, amount, salary)
Task: Find salary from items where code appears in schedules entries with matching status.
SQL: | SELECT salary FROM items AS lne
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.status = lne.status
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_05543 | train | T2 |
v1 | Schema:
customers (alias: cust)(id, salary, name, date)
invoices(level, code, name, amount)
Task: Select amount from customers where id exists in invoices for the same code.
SQL: | SELECT amount FROM customers AS cust
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_05544 | train | T1 |
v2 | Schema:
accounts (alias: acct)(status, salary, value, type)
services(name, status, amount, salary)
Task: Find code from accounts where a matching record exists in services with the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "services",
"outer_alias": "acct",
"inner_alias": "srvc",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_fixed_train_05545 | train | T1 |
v3 | Schema:
orders (alias: ord)(type, amount, salary, id)
services(salary, level, type, id)
Task: Find amount from orders where value exceeds the average value from services for the same code.
SQL: | SELECT amount FROM orders AS ord
WHERE value > (
SELECT MIN(value) FROM services AS srvc
WHERE srvc.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "services",
"outer_alias": "ord",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_05546 | train | T1 |
v1 | Schema:
transactions (alias: txn)(level, code, id, name)
accounts(status, code, id, level)
Task: Find id from transactions where id appears in accounts entries with matching id.
SQL: | SELECT id FROM transactions AS txn
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_05547 | train | T1 |
v2 | Schema:
requests (alias: ordr)(type, level, code, value)
managers(name, date, amount, id)
Task: Retrieve salary from requests that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_05548 | train | T2 |
v1 | Schema:
employees (alias: emp)(status, name, level, salary)
categories(code, salary, name, date)
Task: Select id from employees where type exists in categories for the same status.
SQL: | SELECT id FROM employees AS emp
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_05549 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(code, type, salary, name)
staff(name, code, date, value)
Task: Retrieve salary from warehouses that have at least one corresponding entry in staff sharing the same level.
SQL: | SELECT salary FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "staff",
"outer_alias": "whs",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_05550 | train | T2 |
v3 | Schema:
requests (alias: ordr)(date, type, amount, salary)
customers(id, status, date, level)
Task: Find code from requests where amount exceeds the average amount from customers for the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE amount > (
SELECT AVG(amount) FROM customers AS cust
WHERE cust.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_05551 | train | T2 |
v3 | Schema:
orders (alias: ord)(amount, type, status, name)
invoices(value, amount, id, date)
Task: Find amount from orders where value exceeds the average salary from invoices for the same type.
SQL: | SELECT amount FROM orders AS ord
WHERE value > (
SELECT SUM(salary) FROM invoices AS inv
WHERE inv.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_05552 | train | T1 |
v3 | Schema:
warehouses (alias: whs)(value, code, level, date)
shipments(date, value, salary, name)
Task: Retrieve salary from warehouses with amount above the AVG(salary) of shipments rows sharing the same id.
SQL: | SELECT salary FROM warehouses AS whs
WHERE amount > (
SELECT AVG(salary) FROM shipments AS shp
WHERE shp.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "shipments",
"outer_alias": "whs",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_05553 | train | T2 |
v3 | Schema:
staff (alias: empl)(date, status, name, code)
accounts(salary, amount, type, name)
Task: Find amount from staff where value exceeds the average amount from accounts for the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE value > (
SELECT MIN(amount) FROM accounts AS acct
WHERE acct.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_05554 | train | T2 |
v3 | Schema:
orders (alias: ord)(level, date, status, value)
accounts(salary, amount, date, code)
Task: Retrieve salary from orders with amount above the AVG(value) of accounts rows sharing the same level.
SQL: | SELECT salary FROM orders AS ord
WHERE amount > (
SELECT AVG(value) FROM accounts AS acct
WHERE acct.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_05555 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(salary, amount, code, level)
budgets(status, type, code, value)
Task: Select value from warehouses where id exists in budgets for the same level.
SQL: | SELECT value FROM warehouses AS whs
WHERE id IN (
SELECT id FROM budgets AS budg
WHERE budg.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "budgets",
"outer_alias": "whs",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_05556 | train | T2 |
v3 | Schema:
shipments (alias: shp)(salary, code, status, level)
services(date, level, value, id)
Task: Find value from shipments where value exceeds the average amount from services for the same code.
SQL: | SELECT value FROM shipments AS shp
WHERE value > (
SELECT SUM(amount) FROM services AS srvc
WHERE srvc.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "services",
"outer_alias": "shp",
"inner_alias": "srvc",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_05557 | train | T2 |
v3 | Schema:
schedules (alias: schd)(date, amount, salary, type)
departments(date, level, salary, status)
Task: Retrieve salary from schedules with amount above the MIN(salary) of departments rows sharing the same status.
SQL: | SELECT salary FROM schedules AS schd
WHERE amount > (
SELECT MIN(salary) FROM departments AS dept
WHERE dept.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_05558 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(date, value, code, type)
departments(id, amount, salary, date)
Task: Retrieve salary from warehouses that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT salary FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "departments",
"outer_alias": "whs",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_05559 | train | T2 |
v2 | Schema:
invoices (alias: inv)(level, name, type, id)
employees(type, level, salary, date)
Task: Find amount from invoices where a matching record exists in employees with the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_05560 | train | T1 |
v1 | Schema:
staff (alias: empl)(id, amount, date, status)
accounts(date, value, name, status)
Task: Retrieve code from staff whose type is found in accounts rows where id matches the outer record.
SQL: | SELECT code FROM staff AS empl
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_05561 | train | T2 |
v3 | Schema:
departments (alias: dept)(date, status, id, salary)
invoices(level, amount, salary, value)
Task: Find salary from departments where value exceeds the average amount from invoices for the same level.
SQL: | SELECT salary FROM departments AS dept
WHERE value > (
SELECT MIN(amount) FROM invoices AS inv
WHERE inv.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "invoices",
"outer_alias": "dept",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_05562 | train | T1 |
v2 | Schema:
sales (alias: sale)(amount, date, status, type)
warehouses(amount, type, status, id)
Task: Find code from sales where a matching record exists in warehouses with the same type.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "warehouses",
"outer_alias": "sale",
"inner_alias": "whs",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_05563 | train | T1 |
v3 | Schema:
products (alias: prod)(salary, name, level, code)
schedules(id, value, status, salary)
Task: Find id from products where value exceeds the average amount from schedules for the same code.
SQL: | SELECT id FROM products AS prod
WHERE value > (
SELECT SUM(amount) FROM schedules AS schd
WHERE schd.code = prod.code
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_05564 | train | T1 |
v2 | Schema:
staff (alias: empl)(date, type, amount, id)
transactions(value, id, name, date)
Task: Find salary from staff where a matching record exists in transactions with the same id.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_05565 | train | T2 |
v3 | Schema:
employees (alias: emp)(type, value, status, salary)
invoices(salary, value, amount, date)
Task: Find name from employees where salary exceeds the average value from invoices for the same code.
SQL: | SELECT name FROM employees AS emp
WHERE salary > (
SELECT MAX(value) FROM invoices AS inv
WHERE inv.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_05566 | train | T1 |
v1 | Schema:
managers (alias: mgr)(value, code, amount, id)
invoices(id, name, date, level)
Task: Select amount from managers where code exists in invoices for the same id.
SQL: | SELECT amount FROM managers AS mgr
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_05567 | train | T1 |
v2 | Schema:
staff (alias: empl)(value, date, level, name)
sales(code, amount, type, level)
Task: Find amount from staff where a matching record exists in sales with the same status.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_05568 | train | T2 |
v2 | Schema:
items (alias: lne)(name, code, status, value)
products(name, value, amount, code)
Task: Find salary from items where a matching record exists in products with the same level.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = lne.level
); | {
"outer_table": "items",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_05569 | train | T2 |
v2 | Schema:
accounts (alias: acct)(salary, status, amount, name)
employees(status, type, name, date)
Task: Find name from accounts where a matching record exists in employees with the same code.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_05570 | train | T1 |
v1 | Schema:
regions (alias: rgn)(code, amount, date, salary)
departments(salary, level, value, amount)
Task: Find salary from regions where level appears in departments entries with matching level.
SQL: | SELECT salary FROM regions AS rgn
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_05571 | train | T2 |
v2 | Schema:
requests (alias: ordr)(level, name, date, value)
employees(date, name, status, id)
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_05572 | train | T2 |
v1 | Schema:
items (alias: lne)(name, code, status, id)
managers(status, value, salary, date)
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_05573 | train | T2 |
v1 | Schema:
requests (alias: ordr)(name, id, salary, level)
categories(level, date, status, salary)
Task: Find code from requests where type appears in categories entries with matching code.
SQL: | SELECT code FROM requests AS ordr
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_05574 | train | T2 |
v2 | Schema:
products (alias: prod)(type, name, amount, status)
requests(id, salary, amount, value)
Task: Retrieve code from products that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = prod.code
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_05575 | train | T1 |
v3 | Schema:
sales (alias: sale)(date, status, level, amount)
warehouses(id, date, type, salary)
Task: Retrieve value from sales with salary above the AVG(value) of warehouses rows sharing the same code.
SQL: | SELECT value FROM sales AS sale
WHERE salary > (
SELECT AVG(value) 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": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_05576 | train | T1 |
v1 | Schema:
schedules (alias: schd)(code, salary, value, id)
departments(code, value, level, type)
Task: Retrieve name from schedules whose code is found in departments rows where id matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_05577 | train | T2 |
v2 | Schema:
schedules (alias: schd)(value, type, level, date)
departments(name, value, amount, code)
Task: Retrieve amount from schedules that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_05578 | train | T2 |
v3 | Schema:
services (alias: srvc)(name, salary, id, type)
accounts(amount, salary, date, code)
Task: Retrieve value from services with amount above the SUM(value) of accounts rows sharing the same status.
SQL: | SELECT value FROM services AS srvc
WHERE amount > (
SELECT SUM(value) FROM accounts AS acct
WHERE acct.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "accounts",
"outer_alias": "srvc",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_05579 | train | T2 |
v2 | Schema:
services (alias: srvc)(type, level, value, code)
schedules(level, date, id, amount)
Task: Retrieve salary from services that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT salary FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "schedules",
"outer_alias": "srvc",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_05580 | train | T2 |
v3 | Schema:
invoices (alias: inv)(name, amount, date, value)
items(salary, name, id, type)
Task: Retrieve id from invoices with salary above the AVG(salary) of items rows sharing the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE salary > (
SELECT AVG(salary) FROM items AS lne
WHERE lne.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_05581 | train | T1 |
v2 | Schema:
categories (alias: catg)(name, id, level, value)
accounts(amount, name, level, salary)
Task: Find name from categories where a matching record exists in accounts with the same level.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_05582 | train | T2 |
v3 | Schema:
customers (alias: cust)(name, date, type, level)
warehouses(amount, salary, value, date)
Task: Retrieve amount from customers with salary above the COUNT(salary) of warehouses rows sharing the same id.
SQL: | SELECT amount FROM customers AS cust
WHERE salary > (
SELECT COUNT(salary) FROM warehouses AS whs
WHERE whs.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "warehouses",
"outer_alias": "cust",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_05583 | train | T1 |
v2 | Schema:
products (alias: prod)(value, status, level, date)
shipments(date, value, level, code)
Task: Retrieve salary from products that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = prod.code
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_05584 | train | T1 |
v1 | Schema:
invoices (alias: inv)(status, date, id, type)
warehouses(value, type, salary, amount)
Task: Select code from invoices where status exists in warehouses for the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE status IN (
SELECT status FROM warehouses AS whs
WHERE whs.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "warehouses",
"outer_alias": "inv",
"inner_alias": "whs",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_05585 | train | T1 |
v1 | Schema:
shipments (alias: shp)(salary, code, name, amount)
orders(level, id, value, code)
Task: Find value from shipments where status appears in orders entries with matching status.
SQL: | SELECT value FROM shipments AS shp
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_05586 | train | T2 |
v2 | Schema:
products (alias: prod)(amount, code, type, name)
requests(date, id, type, value)
Task: Retrieve name from products that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_05587 | train | T1 |
v2 | Schema:
shipments (alias: shp)(salary, type, code, value)
regions(value, date, amount, id)
Task: Find code from shipments where a matching record exists in regions with the same type.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_05588 | train | T2 |
v2 | Schema:
items (alias: lne)(code, status, date, salary)
transactions(level, salary, type, id)
Task: Retrieve value from items that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = lne.id
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_05589 | train | T2 |
v1 | Schema:
categories (alias: catg)(status, type, level, id)
transactions(amount, date, code, value)
Task: Retrieve salary from categories whose level is found in transactions rows where level matches the outer record.
SQL: | SELECT salary FROM categories AS catg
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_05590 | train | T2 |
v1 | Schema:
warehouses (alias: whs)(level, code, date, status)
departments(name, code, id, salary)
Task: Find amount from warehouses where level appears in departments entries with matching code.
SQL: | SELECT amount FROM warehouses AS whs
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "departments",
"outer_alias": "whs",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_05591 | train | T2 |
v1 | Schema:
invoices (alias: inv)(status, level, date, id)
warehouses(value, type, amount, date)
Task: Retrieve amount from invoices whose status is found in warehouses rows where level matches the outer record.
SQL: | SELECT amount FROM invoices AS inv
WHERE status IN (
SELECT status FROM warehouses AS whs
WHERE whs.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "warehouses",
"outer_alias": "inv",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_05592 | train | T1 |
v2 | Schema:
orders (alias: ord)(id, value, name, type)
invoices(value, amount, id, type)
Task: Retrieve id from orders that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_05593 | train | T1 |
v3 | Schema:
invoices (alias: inv)(value, name, status, code)
customers(level, status, code, amount)
Task: Retrieve id from invoices with value above the SUM(value) of customers rows sharing the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE value > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_05594 | train | T1 |
v1 | Schema:
transactions (alias: txn)(code, id, level, date)
orders(id, status, amount, name)
Task: Find salary from transactions where status appears in orders entries with matching type.
SQL: | SELECT salary FROM transactions AS txn
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_05595 | train | T1 |
v2 | Schema:
products (alias: prod)(id, date, type, salary)
staff(status, type, name, level)
Task: Retrieve amount from products that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = prod.id
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_05596 | train | T1 |
v3 | Schema:
managers (alias: mgr)(salary, value, date, code)
schedules(code, id, level, date)
Task: Retrieve code from managers with amount above the MIN(amount) of schedules rows sharing the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE amount > (
SELECT MIN(amount) FROM schedules AS schd
WHERE schd.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_05597 | train | T1 |
v3 | Schema:
budgets (alias: budg)(type, name, code, value)
products(status, date, name, value)
Task: Retrieve amount from budgets with salary above the COUNT(salary) of products rows sharing the same type.
SQL: | SELECT amount FROM budgets AS budg
WHERE salary > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "products",
"outer_alias": "budg",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_05598 | train | T2 |
v3 | Schema:
staff (alias: empl)(salary, amount, level, date)
products(name, date, salary, code)
Task: Find name from staff where amount exceeds the average salary from products for the same id.
SQL: | SELECT name FROM staff AS empl
WHERE amount > (
SELECT SUM(salary) FROM products AS prod
WHERE prod.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_05599 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.