variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v3 | Schema:
projects (alias: prj)(date, id, type, value)
transactions(amount, code, name, id)
Task: Find code from projects where value exceeds the average value from transactions for the same id.
SQL: | SELECT code FROM projects AS prj
WHERE value > (
SELECT AVG(value) FROM transactions AS txn
WHERE txn.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_06500 | train |
v3 | Schema:
requests (alias: ordr)(id, status, code, date)
customers(amount, salary, value, code)
Task: Find amount from requests where salary exceeds the total amount from customers for the same id.
SQL: | SELECT amount FROM requests AS ordr
WHERE salary > (
SELECT SUM(amount) FROM customers AS cust
WHERE cust.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_06501 | train |
v2 | Schema:
sales (alias: sale)(code, amount, date, name)
employees(salary, id, type, level)
Task: Retrieve amount from sales that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06502 | train |
v1 | Schema:
sales (alias: sale)(value, salary, level, date)
tasks(level, id, value, amount)
Task: Retrieve value from sales whose id is found in tasks rows where id matches the outer record.
SQL: | SELECT value FROM sales AS sale
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06503 | train |
v1 | Schema:
sales (alias: sale)(amount, name, type, code)
products(salary, value, level, status)
Task: Find value from sales where type appears in products entries with matching status.
SQL: | SELECT value FROM sales AS sale
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06504 | train |
v2 | Schema:
requests (alias: ordr)(date, name, salary, id)
employees(level, status, date, type)
Task: Retrieve salary from requests that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_06505 | train |
v2 | Schema:
products (alias: prod)(type, amount, date, level)
invoices(code, salary, name, value)
Task: Find value from products where a matching record exists in invoices with the same type.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = prod.type
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06506 | train |
v3 | Schema:
employees (alias: emp)(status, date, type, id)
categories(type, name, id, level)
Task: Retrieve salary from employees with value above the AVG(salary) of categories rows sharing the same level.
SQL: | SELECT salary FROM employees AS emp
WHERE value > (
SELECT AVG(salary) FROM categories AS catg
WHERE catg.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06507 | train |
v3 | Schema:
employees (alias: emp)(value, status, id, name)
customers(value, salary, code, status)
Task: Find code from employees where salary exceeds the minimum salary from customers for the same type.
SQL: | SELECT code FROM employees AS emp
WHERE salary > (
SELECT MIN(salary) FROM customers AS cust
WHERE cust.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06508 | train |
v2 | Schema:
items (alias: lne)(amount, status, id, date)
staff(id, value, amount, date)
Task: Find salary from items where a matching record exists in staff with the same code.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = lne.code
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_06509 | train |
v2 | Schema:
shipments (alias: shp)(level, status, code, name)
customers(name, amount, id, date)
Task: Find value from shipments where a matching record exists in customers with the same status.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_06510 | train |
v1 | Schema:
products (alias: prod)(date, value, salary, id)
customers(name, type, code, salary)
Task: Find id from products where id appears in customers entries with matching status.
SQL: | SELECT id FROM products AS prod
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.status = prod.status
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06511 | train |
v3 | Schema:
products (alias: prod)(date, id, level, code)
schedules(salary, date, id, amount)
Task: Retrieve salary from products with salary above the AVG(salary) of schedules rows sharing the same status.
SQL: | SELECT salary FROM products AS prod
WHERE salary > (
SELECT AVG(salary) FROM schedules AS schd
WHERE schd.status = prod.status
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06512 | train |
v2 | Schema:
requests (alias: ordr)(code, level, salary, id)
departments(id, value, date, type)
Task: Retrieve id from requests that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_06513 | train |
v1 | Schema:
sales (alias: sale)(code, level, value, id)
orders(status, amount, date, value)
Task: Find id from sales where status appears in orders entries with matching code.
SQL: | SELECT id FROM sales AS sale
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06514 | train |
v3 | Schema:
shipments (alias: shp)(value, type, code, name)
branches(status, salary, id, value)
Task: Find name from shipments where salary exceeds the minimum amount from branches for the same status.
SQL: | SELECT name FROM shipments AS shp
WHERE salary > (
SELECT MIN(amount) FROM branches AS brc
WHERE brc.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_06515 | train |
v1 | Schema:
staff (alias: empl)(amount, date, id, value)
projects(id, level, value, date)
Task: Retrieve code from staff whose level is found in projects rows where id matches the outer record.
SQL: | SELECT code FROM staff AS empl
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06516 | train |
v1 | Schema:
regions (alias: rgn)(status, date, level, code)
staff(type, value, status, amount)
Task: Select code from regions where id exists in staff for the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_06517 | train |
v3 | Schema:
branches (alias: brc)(salary, amount, name, level)
items(type, id, salary, amount)
Task: Find id from branches where value exceeds the total value from items for the same level.
SQL: | SELECT id FROM branches AS brc
WHERE value > (
SELECT SUM(value) FROM items AS lne
WHERE lne.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06518 | train |
v3 | Schema:
sales (alias: sale)(salary, status, level, id)
customers(id, name, salary, value)
Task: Find value from sales where salary exceeds the minimum value from customers for the same status.
SQL: | SELECT value FROM sales AS sale
WHERE salary > (
SELECT MIN(value) FROM customers AS cust
WHERE cust.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06519 | train |
v3 | Schema:
categories (alias: catg)(amount, code, level, status)
staff(level, id, value, salary)
Task: Retrieve salary from categories with value above the COUNT(value) of staff rows sharing the same status.
SQL: | SELECT salary FROM categories AS catg
WHERE value > (
SELECT COUNT(value) FROM staff AS empl
WHERE empl.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06520 | train |
v3 | Schema:
managers (alias: mgr)(type, salary, value, code)
departments(type, value, salary, amount)
Task: Retrieve salary from managers with value above the AVG(value) of departments rows sharing the same type.
SQL: | SELECT salary FROM managers AS mgr
WHERE value > (
SELECT AVG(value) FROM departments AS dept
WHERE dept.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06521 | train |
v2 | Schema:
shipments (alias: shp)(salary, amount, name, code)
items(id, salary, name, date)
Task: Retrieve salary from shipments that have at least one corresponding entry in items sharing the same status.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_06522 | train |
v2 | Schema:
invoices (alias: inv)(status, type, salary, code)
customers(type, level, status, name)
Task: Find value from invoices where a matching record exists in customers with the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06523 | train |
v3 | Schema:
branches (alias: brc)(amount, status, code, value)
orders(value, level, salary, name)
Task: Retrieve name from branches with amount above the MAX(amount) of orders rows sharing the same id.
SQL: | SELECT name FROM branches AS brc
WHERE amount > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06524 | train |
v1 | Schema:
sales (alias: sale)(type, amount, status, date)
projects(date, amount, status, code)
Task: Retrieve value from sales whose level is found in projects rows where code matches the outer record.
SQL: | SELECT value FROM sales AS sale
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06525 | train |
v2 | Schema:
staff (alias: empl)(value, amount, status, name)
branches(level, salary, type, status)
Task: Retrieve id from staff that have at least one corresponding entry in branches sharing the same status.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06526 | train |
v3 | Schema:
shipments (alias: shp)(date, amount, code, type)
items(id, level, type, value)
Task: Find code from shipments where value exceeds the count of salary from items for the same type.
SQL: | SELECT code FROM shipments AS shp
WHERE value > (
SELECT COUNT(salary) FROM items AS lne
WHERE lne.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_06527 | train |
v2 | Schema:
managers (alias: mgr)(level, value, amount, code)
projects(type, level, name, date)
Task: Find code from managers where a matching record exists in projects with the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06528 | train |
v3 | Schema:
managers (alias: mgr)(code, type, date, value)
orders(amount, type, status, level)
Task: Find salary from managers where value exceeds the total amount from orders for the same id.
SQL: | SELECT salary FROM managers AS mgr
WHERE value > (
SELECT SUM(amount) FROM orders AS ord
WHERE ord.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06529 | train |
v2 | Schema:
invoices (alias: inv)(amount, level, id, status)
categories(name, salary, id, code)
Task: Find amount from invoices where a matching record exists in categories with the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06530 | train |
v3 | Schema:
employees (alias: emp)(level, id, value, salary)
items(id, status, amount, type)
Task: Find value from employees where value exceeds the total amount from items for the same status.
SQL: | SELECT value FROM employees AS emp
WHERE value > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06531 | train |
v3 | Schema:
transactions (alias: txn)(date, name, value, level)
staff(salary, amount, code, level)
Task: Retrieve id from transactions with amount above the AVG(value) of staff rows sharing the same id.
SQL: | SELECT id FROM transactions AS txn
WHERE amount > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06532 | train |
v2 | Schema:
customers (alias: cust)(type, name, salary, value)
accounts(date, amount, level, id)
Task: Find name from customers where a matching record exists in accounts with the same type.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06533 | train |
v2 | Schema:
orders (alias: ord)(level, code, status, type)
sales(amount, code, salary, level)
Task: Retrieve salary from orders that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06534 | train |
v2 | Schema:
managers (alias: mgr)(amount, status, id, date)
categories(type, amount, name, value)
Task: Retrieve value from managers that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06535 | train |
v1 | Schema:
sales (alias: sale)(amount, salary, type, value)
orders(amount, date, id, name)
Task: Retrieve value from sales whose code is found in orders rows where code matches the outer record.
SQL: | SELECT value FROM sales AS sale
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06536 | train |
v2 | Schema:
requests (alias: ordr)(code, level, amount, status)
accounts(name, value, amount, id)
Task: Retrieve name from requests that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_06537 | train |
v3 | Schema:
projects (alias: prj)(code, value, level, date)
branches(salary, date, status, value)
Task: Find salary from projects where salary exceeds the average salary from branches for the same type.
SQL: | SELECT salary FROM projects AS prj
WHERE salary > (
SELECT AVG(salary) FROM branches AS brc
WHERE brc.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_06538 | train |
v2 | Schema:
branches (alias: brc)(date, amount, type, value)
categories(salary, type, date, value)
Task: Retrieve salary from branches that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06539 | train |
v2 | Schema:
departments (alias: dept)(code, name, value, type)
accounts(date, status, value, level)
Task: Find salary from departments where a matching record exists in accounts with the same code.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06540 | train |
v3 | Schema:
managers (alias: mgr)(id, value, salary, code)
employees(code, date, status, salary)
Task: Find salary from managers where amount exceeds the count of value from employees for the same level.
SQL: | SELECT salary FROM managers AS mgr
WHERE amount > (
SELECT COUNT(value) FROM employees AS emp
WHERE emp.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06541 | train |
v2 | Schema:
products (alias: prod)(code, salary, value, level)
orders(id, value, code, status)
Task: Find amount from products where a matching record exists in orders with the same type.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = prod.type
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06542 | train |
v3 | Schema:
categories (alias: catg)(salary, date, amount, type)
projects(value, type, amount, date)
Task: Retrieve code from categories with value above the MAX(salary) of projects rows sharing the same code.
SQL: | SELECT code FROM categories AS catg
WHERE value > (
SELECT MAX(salary) FROM projects AS prj
WHERE prj.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06543 | train |
v1 | Schema:
staff (alias: empl)(amount, value, type, salary)
customers(level, date, status, code)
Task: Find id from staff where status appears in customers entries with matching level.
SQL: | SELECT id FROM staff AS empl
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06544 | train |
v1 | Schema:
accounts (alias: acct)(level, type, id, salary)
tasks(status, date, type, name)
Task: Select name from accounts where code exists in tasks for the same id.
SQL: | SELECT name FROM accounts AS acct
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06545 | train |
v3 | Schema:
accounts (alias: acct)(date, type, id, value)
requests(name, code, id, salary)
Task: Retrieve amount from accounts with amount above the MIN(salary) of requests rows sharing the same id.
SQL: | SELECT amount FROM accounts AS acct
WHERE amount > (
SELECT MIN(salary) FROM requests AS ordr
WHERE ordr.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06546 | train |
v3 | Schema:
categories (alias: catg)(id, type, level, amount)
projects(status, date, amount, value)
Task: Find value from categories where salary exceeds the total amount from projects for the same level.
SQL: | SELECT value FROM categories AS catg
WHERE salary > (
SELECT SUM(amount) FROM projects AS prj
WHERE prj.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06547 | train |
v1 | Schema:
tasks (alias: tsk)(amount, level, name, date)
projects(date, id, status, name)
Task: Find name from tasks where status appears in projects entries with matching type.
SQL: | SELECT name FROM tasks AS tsk
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_06548 | train |
v2 | Schema:
sales (alias: sale)(code, type, level, salary)
schedules(value, type, salary, name)
Task: Retrieve name from sales that have at least one corresponding entry in schedules sharing the same status.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06549 | train |
v2 | Schema:
branches (alias: brc)(status, type, code, id)
accounts(id, name, amount, value)
Task: Find code from branches where a matching record exists in accounts with the same id.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "accounts",
"outer_alias": "brc",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06550 | train |
v3 | Schema:
projects (alias: prj)(id, amount, name, date)
transactions(salary, value, date, name)
Task: Retrieve code from projects with salary above the MAX(amount) of transactions rows sharing the same status.
SQL: | SELECT code FROM projects AS prj
WHERE salary > (
SELECT MAX(amount) FROM transactions AS txn
WHERE txn.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_06551 | train |
v2 | Schema:
projects (alias: prj)(status, salary, code, value)
departments(value, name, code, salary)
Task: Retrieve amount from projects that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_06552 | train |
v3 | Schema:
orders (alias: ord)(code, level, status, salary)
products(status, type, code, value)
Task: Find name from orders where amount exceeds the average amount from products for the same type.
SQL: | SELECT name FROM orders AS ord
WHERE amount > (
SELECT AVG(amount) FROM products AS prod
WHERE prod.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06553 | train |
v1 | Schema:
sales (alias: sale)(type, date, status, value)
staff(amount, date, type, value)
Task: Find id from sales where code appears in staff entries with matching id.
SQL: | SELECT id FROM sales AS sale
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06554 | train |
v1 | Schema:
sales (alias: sale)(type, level, name, amount)
categories(level, value, type, id)
Task: Retrieve id from sales whose level is found in categories rows where code matches the outer record.
SQL: | SELECT id FROM sales AS sale
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06555 | train |
v2 | Schema:
staff (alias: empl)(amount, type, level, salary)
shipments(amount, level, type, id)
Task: Retrieve amount from staff that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06556 | train |
v3 | Schema:
transactions (alias: txn)(value, code, salary, date)
staff(type, level, id, status)
Task: Find id from transactions where salary exceeds the minimum amount from staff for the same id.
SQL: | SELECT id FROM transactions AS txn
WHERE salary > (
SELECT MIN(amount) FROM staff AS empl
WHERE empl.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06557 | train |
v1 | Schema:
categories (alias: catg)(status, code, name, level)
regions(code, amount, id, level)
Task: Find name from categories where level appears in regions entries with matching code.
SQL: | SELECT name FROM categories AS catg
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06558 | train |
v1 | Schema:
departments (alias: dept)(amount, id, salary, type)
accounts(amount, id, status, date)
Task: Select amount from departments where code exists in accounts for the same code.
SQL: | SELECT amount FROM departments AS dept
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06559 | train |
v1 | Schema:
products (alias: prod)(level, status, salary, type)
accounts(date, name, value, salary)
Task: Retrieve id from products whose type is found in accounts rows where status matches the outer record.
SQL: | SELECT id FROM products AS prod
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.status = prod.status
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06560 | train |
v2 | Schema:
invoices (alias: inv)(status, date, level, amount)
departments(status, level, type, value)
Task: Retrieve code from invoices that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06561 | train |
v2 | Schema:
projects (alias: prj)(date, type, amount, id)
transactions(value, id, name, date)
Task: Find salary from projects where a matching record exists in transactions with the same id.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_06562 | train |
v1 | Schema:
staff (alias: empl)(name, type, amount, id)
categories(salary, level, date, amount)
Task: Find amount from staff where type appears in categories entries with matching type.
SQL: | SELECT amount FROM staff AS empl
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06563 | train |
v1 | Schema:
branches (alias: brc)(code, name, type, status)
products(date, code, id, name)
Task: Find code from branches where type appears in products entries with matching status.
SQL: | SELECT code FROM branches AS brc
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06564 | train |
v2 | Schema:
managers (alias: mgr)(status, level, salary, value)
customers(code, amount, id, type)
Task: Retrieve name from managers that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06565 | train |
v3 | Schema:
items (alias: lne)(name, value, code, status)
orders(value, name, type, amount)
Task: Retrieve name from items with salary above the COUNT(salary) of orders rows sharing the same status.
SQL: | SELECT name FROM items AS lne
WHERE salary > (
SELECT COUNT(salary) FROM orders AS ord
WHERE ord.status = lne.status
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_06566 | train |
v1 | Schema:
regions (alias: rgn)(name, id, date, type)
employees(status, level, id, code)
Task: Retrieve value from regions whose id is found in employees rows where type matches the outer record.
SQL: | SELECT value FROM regions AS rgn
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_06567 | train |
v1 | Schema:
requests (alias: ordr)(type, level, status, code)
managers(level, type, amount, code)
Task: Select salary from requests where level exists in managers for the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_06568 | train |
v1 | Schema:
employees (alias: emp)(level, name, status, date)
categories(type, id, name, level)
Task: Retrieve salary from employees whose status is found in categories rows where level matches the outer record.
SQL: | SELECT salary FROM employees AS emp
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06569 | train |
v1 | Schema:
branches (alias: brc)(level, amount, date, code)
shipments(amount, date, id, value)
Task: Find id from branches where code appears in shipments entries with matching type.
SQL: | SELECT id FROM branches AS brc
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06570 | train |
v3 | Schema:
customers (alias: cust)(id, status, level, type)
managers(name, id, type, status)
Task: Find value from customers where salary exceeds the minimum amount from managers for the same type.
SQL: | SELECT value FROM customers AS cust
WHERE salary > (
SELECT MIN(amount) FROM managers AS mgr
WHERE mgr.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06571 | train |
v2 | Schema:
requests (alias: ordr)(value, name, type, code)
schedules(code, level, value, name)
Task: Find value from requests where a matching record exists in schedules with the same code.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_06572 | train |
v3 | Schema:
managers (alias: mgr)(date, level, value, code)
projects(level, status, date, type)
Task: Find amount from managers where amount exceeds the minimum salary from projects for the same id.
SQL: | SELECT amount FROM managers AS mgr
WHERE amount > (
SELECT MIN(salary) FROM projects AS prj
WHERE prj.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06573 | train |
v1 | Schema:
branches (alias: brc)(type, status, level, code)
shipments(amount, type, date, name)
Task: Select name from branches where level exists in shipments for the same status.
SQL: | SELECT name FROM branches AS brc
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06574 | train |
v2 | Schema:
sales (alias: sale)(status, level, name, type)
customers(id, code, level, type)
Task: Find name from sales where a matching record exists in customers with the same level.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06575 | train |
v3 | Schema:
managers (alias: mgr)(value, level, name, amount)
regions(level, amount, value, id)
Task: Find name from managers where salary exceeds the minimum amount from regions for the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE salary > (
SELECT MIN(amount) FROM regions AS rgn
WHERE rgn.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06576 | train |
v1 | Schema:
employees (alias: emp)(type, name, amount, salary)
customers(name, status, salary, code)
Task: Find value from employees where status appears in customers entries with matching code.
SQL: | SELECT value FROM employees AS emp
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06577 | train |
v1 | Schema:
categories (alias: catg)(status, type, code, id)
sales(status, code, level, type)
Task: Find code from categories where id appears in sales entries with matching level.
SQL: | SELECT code FROM categories AS catg
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06578 | train |
v2 | Schema:
orders (alias: ord)(salary, name, amount, code)
sales(level, salary, code, value)
Task: Find amount from orders where a matching record exists in sales with the same code.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06579 | train |
v3 | Schema:
schedules (alias: schd)(salary, id, code, level)
invoices(level, name, value, salary)
Task: Retrieve code from schedules with salary above the SUM(salary) of invoices rows sharing the same type.
SQL: | SELECT code FROM schedules AS schd
WHERE salary > (
SELECT SUM(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": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06580 | train |
v3 | Schema:
requests (alias: ordr)(name, status, salary, level)
products(date, level, code, status)
Task: Retrieve code from requests with amount above the MAX(value) of products rows sharing the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE amount > (
SELECT MAX(value) FROM products AS prod
WHERE prod.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_06581 | train |
v3 | Schema:
products (alias: prod)(code, date, amount, name)
managers(level, amount, salary, name)
Task: Find id from products where value exceeds the total value from managers for the same level.
SQL: | SELECT id FROM products AS prod
WHERE value > (
SELECT SUM(value) FROM managers AS mgr
WHERE mgr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06582 | train |
v2 | Schema:
regions (alias: rgn)(code, date, salary, value)
managers(value, status, salary, name)
Task: Retrieve value from regions that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_06583 | train |
v3 | Schema:
staff (alias: empl)(status, amount, name, code)
orders(name, date, id, salary)
Task: Retrieve amount from staff with amount above the MAX(value) of orders rows sharing the same status.
SQL: | SELECT amount FROM staff AS empl
WHERE amount > (
SELECT MAX(value) FROM orders AS ord
WHERE ord.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06584 | train |
v2 | Schema:
categories (alias: catg)(name, code, status, id)
employees(date, name, type, level)
Task: Find amount from categories where a matching record exists in employees with the same type.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06585 | train |
v2 | Schema:
branches (alias: brc)(type, date, name, code)
products(salary, level, amount, name)
Task: Retrieve code from branches that have at least one corresponding entry in products sharing the same type.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06586 | train |
v2 | Schema:
shipments (alias: shp)(level, name, type, status)
requests(id, value, type, amount)
Task: Find amount from shipments where a matching record exists in requests with the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_06587 | train |
v3 | Schema:
items (alias: lne)(type, salary, value, level)
regions(status, name, code, value)
Task: Retrieve amount from items with amount above the COUNT(amount) of regions rows sharing the same status.
SQL: | SELECT amount FROM items AS lne
WHERE amount > (
SELECT COUNT(amount) FROM regions AS rgn
WHERE rgn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_06588 | train |
v2 | Schema:
schedules (alias: schd)(amount, code, name, date)
staff(level, type, date, amount)
Task: Retrieve name from schedules that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06589 | train |
v3 | Schema:
requests (alias: ordr)(name, salary, type, status)
employees(id, code, date, name)
Task: Find salary from requests where amount exceeds the count of amount from employees for the same type.
SQL: | SELECT salary FROM requests AS ordr
WHERE amount > (
SELECT COUNT(amount) FROM employees AS emp
WHERE emp.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_06590 | train |
v3 | Schema:
transactions (alias: txn)(level, type, code, date)
schedules(salary, name, date, value)
Task: Find name from transactions where amount exceeds the average value from schedules for the same status.
SQL: | SELECT name FROM transactions AS txn
WHERE amount > (
SELECT AVG(value) FROM schedules AS schd
WHERE schd.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06591 | train |
v1 | Schema:
departments (alias: dept)(amount, value, level, date)
requests(level, type, salary, date)
Task: Select salary from departments where code exists in requests for the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06592 | train |
v3 | Schema:
staff (alias: empl)(name, code, value, type)
customers(value, status, type, date)
Task: Retrieve value from staff with value above the MIN(amount) of customers rows sharing the same id.
SQL: | SELECT value FROM staff AS empl
WHERE value > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06593 | train |
v2 | Schema:
customers (alias: cust)(salary, date, id, level)
items(id, code, name, date)
Task: Retrieve salary from customers that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06594 | train |
v1 | Schema:
customers (alias: cust)(value, level, salary, amount)
accounts(amount, type, value, code)
Task: Find code from customers where id appears in accounts entries with matching status.
SQL: | SELECT code FROM customers AS cust
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06595 | train |
v1 | Schema:
sales (alias: sale)(amount, type, code, salary)
accounts(amount, id, date, salary)
Task: Retrieve salary from sales whose id is found in accounts rows where code matches the outer record.
SQL: | SELECT salary FROM sales AS sale
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06596 | train |
v3 | Schema:
transactions (alias: txn)(code, status, value, date)
projects(value, level, amount, date)
Task: Retrieve value from transactions with value above the AVG(salary) of projects rows sharing the same id.
SQL: | SELECT value FROM transactions AS txn
WHERE value > (
SELECT AVG(salary) FROM projects AS prj
WHERE prj.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06597 | train |
v1 | Schema:
invoices (alias: inv)(name, type, status, id)
items(value, salary, type, id)
Task: Select amount from invoices where type exists in items for the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06598 | train |
v3 | Schema:
departments (alias: dept)(level, amount, status, salary)
branches(value, level, code, amount)
Task: Find name from departments where value exceeds the maximum value from branches for the same type.
SQL: | SELECT name FROM departments AS dept
WHERE value > (
SELECT MAX(value) FROM branches AS brc
WHERE brc.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06599 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.