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 |
|---|---|---|---|---|---|---|
v1 | Schema:
shipments (alias: shp)(id, amount, status, code)
customers(name, amount, code, type)
Task: Find value from shipments where status appears in customers entries with matching status.
SQL: | SELECT value FROM shipments AS shp
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08500 | train |
v1 | Schema:
customers (alias: cust)(amount, name, date, level)
staff(code, date, value, id)
Task: Retrieve amount from customers whose type is found in staff rows where code matches the outer record.
SQL: | SELECT amount FROM customers AS cust
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08501 | train |
v2 | Schema:
regions (alias: rgn)(level, type, salary, name)
projects(code, value, id, type)
Task: Find code from regions where a matching record exists in projects with the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08502 | train |
v3 | Schema:
accounts (alias: acct)(date, name, value, code)
departments(amount, code, value, status)
Task: Retrieve value from accounts with amount above the SUM(salary) of departments rows sharing the same level.
SQL: | SELECT value FROM accounts AS acct
WHERE amount > (
SELECT SUM(salary) FROM departments AS dept
WHERE dept.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08503 | train |
v2 | Schema:
regions (alias: rgn)(salary, code, date, value)
projects(id, level, value, salary)
Task: Retrieve name from regions that have at least one corresponding entry in projects sharing the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08504 | train |
v2 | Schema:
shipments (alias: shp)(level, value, salary, status)
schedules(status, name, date, value)
Task: Retrieve code from shipments that have at least one corresponding entry in schedules sharing the same id.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08505 | train |
v2 | Schema:
departments (alias: dept)(id, amount, level, value)
sales(date, name, id, level)
Task: Find salary from departments where a matching record exists in sales with the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08506 | train |
v1 | Schema:
managers (alias: mgr)(name, status, date, level)
items(date, type, id, code)
Task: Retrieve value from managers whose type is found in items rows where level matches the outer record.
SQL: | SELECT value FROM managers AS mgr
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08507 | train |
v1 | Schema:
shipments (alias: shp)(value, date, level, code)
branches(type, level, status, date)
Task: Find value from shipments where status appears in branches entries with matching type.
SQL: | SELECT value FROM shipments AS shp
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08508 | train |
v2 | Schema:
branches (alias: brc)(level, status, date, salary)
products(salary, type, value, status)
Task: Retrieve name from branches that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT name FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08509 | train |
v1 | Schema:
transactions (alias: txn)(name, level, date, amount)
customers(level, id, salary, value)
Task: Select amount from transactions where status exists in customers for the same type.
SQL: | SELECT amount FROM transactions AS txn
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08510 | train |
v2 | Schema:
employees (alias: emp)(name, code, status, id)
items(status, level, code, salary)
Task: Find name from employees where a matching record exists in items with the same code.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08511 | train |
v3 | Schema:
customers (alias: cust)(salary, code, id, date)
staff(value, amount, id, name)
Task: Find value from customers where salary exceeds the count of salary from staff for the same level.
SQL: | SELECT value FROM customers AS cust
WHERE salary > (
SELECT COUNT(salary) FROM staff AS empl
WHERE empl.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08512 | train |
v2 | Schema:
requests (alias: ordr)(code, amount, value, type)
projects(salary, date, name, value)
Task: Retrieve name from requests that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08513 | train |
v1 | Schema:
products (alias: prod)(status, amount, type, salary)
projects(value, id, date, type)
Task: Select code from products where type exists in projects for the same type.
SQL: | SELECT code FROM products AS prod
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.type = prod.type
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "prod",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08514 | train |
v3 | Schema:
sales (alias: sale)(code, salary, level, type)
branches(name, amount, value, type)
Task: Find id from sales where salary exceeds the total salary from branches for the same code.
SQL: | SELECT id FROM sales AS sale
WHERE salary > (
SELECT SUM(salary) FROM branches AS brc
WHERE brc.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "branches",
"outer_alias": "sale",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08515 | train |
v2 | Schema:
schedules (alias: schd)(level, salary, status, date)
branches(type, id, status, value)
Task: Retrieve id from schedules that have at least one corresponding entry in branches sharing the same type.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08516 | train |
v3 | Schema:
projects (alias: prj)(id, date, name, status)
categories(code, value, status, date)
Task: Retrieve value from projects with salary above the MAX(salary) of categories rows sharing the same id.
SQL: | SELECT value FROM projects AS prj
WHERE salary > (
SELECT MAX(salary) FROM categories AS catg
WHERE catg.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08517 | train |
v1 | Schema:
categories (alias: catg)(value, salary, level, status)
staff(id, name, type, amount)
Task: Retrieve code from categories whose type is found in staff rows where status matches the outer record.
SQL: | SELECT code FROM categories AS catg
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08518 | train |
v1 | Schema:
departments (alias: dept)(value, amount, level, date)
orders(status, amount, id, value)
Task: Select salary from departments where type exists in orders for the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08519 | train |
v1 | Schema:
regions (alias: rgn)(code, name, id, date)
tasks(amount, name, value, status)
Task: Find code from regions where code appears in tasks entries with matching level.
SQL: | SELECT code FROM regions AS rgn
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08520 | train |
v2 | Schema:
categories (alias: catg)(status, value, level, type)
customers(amount, value, salary, name)
Task: Find code from categories where a matching record exists in customers with the same status.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08521 | train |
v2 | Schema:
sales (alias: sale)(level, amount, code, id)
categories(id, name, status, type)
Task: Retrieve amount from sales that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08522 | train |
v2 | Schema:
accounts (alias: acct)(level, value, code, amount)
employees(name, value, salary, level)
Task: Retrieve amount from accounts that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT amount 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": "amount",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08523 | train |
v1 | Schema:
employees (alias: emp)(id, value, status, amount)
customers(date, salary, type, value)
Task: Select value from employees where status exists in customers for the same id.
SQL: | SELECT value FROM employees AS emp
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08524 | train |
v1 | Schema:
employees (alias: emp)(date, status, id, amount)
departments(status, id, name, code)
Task: Find id from employees where status appears in departments entries with matching status.
SQL: | SELECT id FROM employees AS emp
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08525 | train |
v1 | Schema:
managers (alias: mgr)(salary, status, id, value)
tasks(value, level, type, salary)
Task: Find amount from managers where code appears in tasks entries with matching id.
SQL: | SELECT amount FROM managers AS mgr
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08526 | train |
v1 | Schema:
projects (alias: prj)(name, salary, id, date)
branches(level, code, name, salary)
Task: Select code from projects where type exists in branches for the same level.
SQL: | SELECT code FROM projects AS prj
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08527 | train |
v1 | Schema:
schedules (alias: schd)(salary, value, status, id)
invoices(name, id, value, date)
Task: Find name from schedules where type appears in invoices entries with matching level.
SQL: | SELECT name FROM schedules AS schd
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08528 | train |
v3 | Schema:
branches (alias: brc)(status, id, name, value)
tasks(salary, id, name, date)
Task: Find code from branches where salary exceeds the average value from tasks for the same status.
SQL: | SELECT code FROM branches AS brc
WHERE salary > (
SELECT AVG(value) FROM tasks AS tsk
WHERE tsk.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08529 | train |
v3 | Schema:
items (alias: lne)(name, code, status, type)
branches(level, salary, id, code)
Task: Retrieve salary from items with amount above the SUM(value) of branches rows sharing the same type.
SQL: | SELECT salary FROM items AS lne
WHERE amount > (
SELECT SUM(value) FROM branches AS brc
WHERE brc.type = lne.type
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08530 | train |
v3 | Schema:
products (alias: prod)(value, amount, date, status)
orders(date, id, status, salary)
Task: Retrieve code from products with value above the MAX(amount) of orders rows sharing the same type.
SQL: | SELECT code FROM products AS prod
WHERE value > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.type = prod.type
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08531 | train |
v1 | Schema:
invoices (alias: inv)(salary, level, id, code)
products(amount, date, code, name)
Task: Retrieve amount from invoices whose code is found in products rows where status matches the outer record.
SQL: | SELECT amount FROM invoices AS inv
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08532 | train |
v1 | Schema:
accounts (alias: acct)(date, code, status, amount)
requests(status, value, name, amount)
Task: Select salary from accounts where status exists in requests for the same level.
SQL: | SELECT salary FROM accounts AS acct
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08533 | train |
v1 | Schema:
shipments (alias: shp)(type, level, status, amount)
managers(value, level, amount, salary)
Task: Select code from shipments where type exists in managers for the same code.
SQL: | SELECT code FROM shipments AS shp
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08534 | train |
v3 | Schema:
orders (alias: ord)(type, code, id, status)
regions(amount, type, status, value)
Task: Retrieve code from orders with amount above the COUNT(salary) of regions rows sharing the same level.
SQL: | SELECT code FROM orders AS ord
WHERE amount > (
SELECT COUNT(salary) FROM regions AS rgn
WHERE rgn.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08535 | train |
v3 | Schema:
departments (alias: dept)(date, amount, type, value)
categories(type, level, id, value)
Task: Retrieve salary from departments with amount above the MAX(amount) of categories rows sharing the same level.
SQL: | SELECT salary FROM departments AS dept
WHERE amount > (
SELECT MAX(amount) FROM categories AS catg
WHERE catg.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08536 | train |
v1 | Schema:
products (alias: prod)(date, salary, code, name)
managers(level, type, date, name)
Task: Retrieve code from products whose id is found in managers rows where level matches the outer record.
SQL: | SELECT code FROM products AS prod
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08537 | train |
v3 | Schema:
departments (alias: dept)(type, amount, name, salary)
staff(id, status, code, amount)
Task: Find salary from departments where value exceeds the total value from staff for the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE value > (
SELECT SUM(value) FROM staff AS empl
WHERE empl.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08538 | train |
v2 | Schema:
customers (alias: cust)(amount, level, status, code)
products(id, date, level, status)
Task: Find salary from customers where a matching record exists in products with the same status.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08539 | train |
v2 | Schema:
orders (alias: ord)(name, level, salary, status)
branches(code, salary, status, amount)
Task: Find amount from orders where a matching record exists in branches with the same type.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08540 | train |
v3 | Schema:
transactions (alias: txn)(id, amount, value, name)
orders(amount, date, level, name)
Task: Retrieve salary from transactions with value above the COUNT(salary) of orders rows sharing the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE value > (
SELECT COUNT(salary) FROM orders AS ord
WHERE ord.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08541 | train |
v2 | Schema:
transactions (alias: txn)(code, date, id, name)
branches(name, level, amount, value)
Task: Find name from transactions where a matching record exists in branches with the same level.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08542 | train |
v3 | Schema:
staff (alias: empl)(status, salary, name, date)
customers(id, status, code, date)
Task: Find code from staff where value exceeds the average salary from customers for the same status.
SQL: | SELECT code FROM staff AS empl
WHERE value > (
SELECT AVG(salary) FROM customers AS cust
WHERE cust.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08543 | train |
v3 | Schema:
items (alias: lne)(salary, code, status, type)
schedules(name, value, code, status)
Task: Retrieve amount from items with amount above the MAX(value) of schedules rows sharing the same type.
SQL: | SELECT amount FROM items AS lne
WHERE amount > (
SELECT MAX(value) FROM schedules AS schd
WHERE schd.type = lne.type
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08544 | train |
v2 | Schema:
shipments (alias: shp)(id, value, type, salary)
schedules(level, date, value, status)
Task: Retrieve value from shipments that have at least one corresponding entry in schedules sharing the same level.
SQL: | SELECT value 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": "value",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08545 | train |
v1 | Schema:
shipments (alias: shp)(name, value, type, id)
projects(id, name, code, status)
Task: Select code from shipments where type exists in projects for the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08546 | train |
v2 | Schema:
sales (alias: sale)(id, date, status, salary)
transactions(date, id, value, status)
Task: Find salary from sales where a matching record exists in transactions with the same type.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08547 | train |
v1 | Schema:
accounts (alias: acct)(value, id, level, salary)
managers(amount, date, salary, level)
Task: Find id from accounts where type appears in managers entries with matching status.
SQL: | SELECT id FROM accounts AS acct
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08548 | train |
v1 | Schema:
categories (alias: catg)(code, amount, value, salary)
managers(date, value, level, salary)
Task: Select id from categories where status exists in managers for the same code.
SQL: | SELECT id FROM categories AS catg
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08549 | train |
v2 | Schema:
departments (alias: dept)(date, level, type, name)
branches(amount, status, date, level)
Task: Retrieve id from departments that have at least one corresponding entry in branches sharing the same type.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08550 | train |
v2 | Schema:
tasks (alias: tsk)(type, value, id, name)
orders(status, name, amount, code)
Task: Retrieve name from tasks that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08551 | train |
v1 | Schema:
departments (alias: dept)(id, name, value, amount)
shipments(type, name, date, status)
Task: Retrieve code from departments whose code is found in shipments rows where code matches the outer record.
SQL: | SELECT code FROM departments AS dept
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08552 | train |
v2 | Schema:
departments (alias: dept)(type, date, status, name)
accounts(type, level, name, salary)
Task: Retrieve code from departments that have at least one corresponding entry in accounts sharing the same type.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08553 | train |
v2 | Schema:
regions (alias: rgn)(id, name, level, code)
departments(value, amount, code, date)
Task: Retrieve amount from regions that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08554 | train |
v2 | Schema:
schedules (alias: schd)(id, code, status, type)
managers(type, status, id, name)
Task: Retrieve amount from schedules that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08555 | train |
v1 | Schema:
branches (alias: brc)(date, amount, code, status)
transactions(level, status, id, amount)
Task: Find code from branches where type appears in transactions entries with matching level.
SQL: | SELECT code FROM branches AS brc
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "transactions",
"outer_alias": "brc",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08556 | train |
v3 | Schema:
customers (alias: cust)(amount, salary, name, date)
regions(code, level, status, salary)
Task: Find value from customers where amount exceeds the minimum salary from regions for the same code.
SQL: | SELECT value FROM customers AS cust
WHERE amount > (
SELECT MIN(salary) FROM regions AS rgn
WHERE rgn.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08557 | train |
v1 | Schema:
customers (alias: cust)(status, name, type, id)
schedules(value, code, name, date)
Task: Retrieve salary from customers whose status is found in schedules rows where id matches the outer record.
SQL: | SELECT salary FROM customers AS cust
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08558 | train |
v1 | Schema:
staff (alias: empl)(code, salary, status, name)
accounts(level, type, name, salary)
Task: Retrieve amount from staff whose level is found in accounts rows where type matches the outer record.
SQL: | SELECT amount FROM staff AS empl
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08559 | train |
v3 | Schema:
sales (alias: sale)(code, name, status, value)
staff(id, status, date, code)
Task: Find value from sales where value exceeds the maximum salary from staff for the same type.
SQL: | SELECT value FROM sales AS sale
WHERE value > (
SELECT MAX(salary) FROM staff AS empl
WHERE empl.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08560 | train |
v2 | Schema:
projects (alias: prj)(name, level, value, date)
employees(name, id, status, amount)
Task: Find name from projects where a matching record exists in employees with the same level.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08561 | train |
v2 | Schema:
managers (alias: mgr)(type, code, name, value)
departments(status, name, salary, date)
Task: Retrieve amount from managers that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08562 | train |
v2 | Schema:
departments (alias: dept)(value, level, status, code)
customers(type, name, status, date)
Task: Find name from departments where a matching record exists in customers with the same level.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08563 | train |
v3 | Schema:
sales (alias: sale)(status, name, id, type)
regions(amount, type, id, date)
Task: Find code from sales where amount exceeds the average amount from regions for the same id.
SQL: | SELECT code FROM sales AS sale
WHERE amount > (
SELECT AVG(amount) FROM regions AS rgn
WHERE rgn.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08564 | train |
v1 | Schema:
products (alias: prod)(amount, level, salary, value)
departments(value, amount, type, salary)
Task: Find amount from products where type appears in departments entries with matching level.
SQL: | SELECT amount FROM products AS prod
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.level = prod.level
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08565 | train |
v1 | Schema:
orders (alias: ord)(value, status, date, name)
customers(value, code, salary, name)
Task: Select amount from orders where id exists in customers for the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08566 | train |
v1 | Schema:
managers (alias: mgr)(value, type, date, level)
orders(date, value, level, type)
Task: Retrieve code from managers whose type is found in orders rows where level matches the outer record.
SQL: | SELECT code FROM managers AS mgr
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08567 | train |
v1 | Schema:
departments (alias: dept)(salary, status, date, code)
sales(status, salary, type, value)
Task: Retrieve amount from departments whose status is found in sales rows where id matches the outer record.
SQL: | SELECT amount FROM departments AS dept
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08568 | train |
v1 | Schema:
orders (alias: ord)(code, amount, type, level)
branches(id, amount, salary, level)
Task: Retrieve code from orders whose type is found in branches rows where level matches the outer record.
SQL: | SELECT code FROM orders AS ord
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08569 | train |
v2 | Schema:
managers (alias: mgr)(salary, type, level, value)
orders(code, salary, amount, date)
Task: Find id from managers where a matching record exists in orders with the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08570 | train |
v3 | Schema:
tasks (alias: tsk)(id, level, status, date)
invoices(value, type, date, status)
Task: Find code from tasks where salary exceeds the minimum amount from invoices for the same level.
SQL: | SELECT code FROM tasks AS tsk
WHERE salary > (
SELECT MIN(amount) FROM invoices AS inv
WHERE inv.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08571 | train |
v1 | Schema:
products (alias: prod)(code, level, type, value)
shipments(value, name, amount, date)
Task: Find value from products where level appears in shipments entries with matching status.
SQL: | SELECT value FROM products AS prod
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.status = prod.status
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08572 | train |
v3 | Schema:
departments (alias: dept)(salary, name, type, code)
categories(amount, level, name, id)
Task: Retrieve code from departments with value above the SUM(salary) of categories rows sharing the same type.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT SUM(salary) FROM categories AS catg
WHERE catg.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08573 | train |
v3 | Schema:
branches (alias: brc)(type, amount, value, id)
categories(id, name, amount, code)
Task: Find id from branches where amount exceeds the maximum salary from categories for the same level.
SQL: | SELECT id FROM branches AS brc
WHERE amount > (
SELECT MAX(salary) FROM categories AS catg
WHERE catg.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08574 | train |
v1 | Schema:
sales (alias: sale)(type, id, level, amount)
items(amount, type, id, level)
Task: Select code from sales where status exists in items for the same id.
SQL: | SELECT code FROM sales AS sale
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08575 | train |
v2 | Schema:
shipments (alias: shp)(value, id, status, amount)
staff(level, status, date, code)
Task: Find value from shipments where a matching record exists in staff with the same id.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08576 | train |
v1 | Schema:
orders (alias: ord)(salary, amount, date, code)
sales(name, id, value, salary)
Task: Find name from orders where type appears in sales entries with matching type.
SQL: | SELECT name FROM orders AS ord
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08577 | train |
v1 | Schema:
sales (alias: sale)(amount, date, level, type)
requests(amount, id, type, code)
Task: Retrieve value from sales whose code is found in requests rows where level matches the outer record.
SQL: | SELECT value FROM sales AS sale
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08578 | train |
v1 | Schema:
staff (alias: empl)(level, value, code, amount)
requests(date, id, type, salary)
Task: Select code from staff where type exists in requests for the same code.
SQL: | SELECT code FROM staff AS empl
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08579 | train |
v2 | Schema:
invoices (alias: inv)(type, value, salary, id)
accounts(amount, status, type, value)
Task: Find code from invoices where a matching record exists in accounts with the same level.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08580 | train |
v3 | Schema:
schedules (alias: schd)(status, value, amount, salary)
departments(type, status, code, value)
Task: Find name from schedules where salary exceeds the average salary from departments for the same id.
SQL: | SELECT name FROM schedules AS schd
WHERE salary > (
SELECT AVG(salary) 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": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08581 | train |
v1 | Schema:
sales (alias: sale)(date, value, code, salary)
orders(value, status, type, amount)
Task: Select code from sales where type exists in orders for the same type.
SQL: | SELECT code FROM sales AS sale
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08582 | train |
v2 | Schema:
transactions (alias: txn)(code, type, value, level)
staff(salary, value, amount, level)
Task: Find salary from transactions where a matching record exists in staff with the same type.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08583 | train |
v2 | Schema:
categories (alias: catg)(salary, status, amount, id)
items(amount, type, code, level)
Task: Retrieve name from categories that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08584 | train |
v1 | Schema:
schedules (alias: schd)(level, date, value, type)
tasks(amount, name, status, id)
Task: Select name from schedules where id exists in tasks for the same status.
SQL: | SELECT name FROM schedules AS schd
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08585 | train |
v1 | Schema:
sales (alias: sale)(status, value, code, id)
accounts(amount, type, value, date)
Task: Retrieve salary from sales whose code is found in accounts rows where code matches the outer record.
SQL: | SELECT salary FROM sales AS sale
WHERE code IN (
SELECT code 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": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08586 | train |
v2 | Schema:
tasks (alias: tsk)(status, name, level, code)
requests(value, amount, type, name)
Task: Find code from tasks where a matching record exists in requests with the same status.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08587 | train |
v1 | Schema:
invoices (alias: inv)(status, id, value, salary)
accounts(code, value, salary, name)
Task: Find name from invoices where level appears in accounts entries with matching status.
SQL: | SELECT name FROM invoices AS inv
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08588 | train |
v1 | Schema:
employees (alias: emp)(amount, name, level, value)
tasks(date, type, level, name)
Task: Retrieve name from employees whose code is found in tasks rows where code matches the outer record.
SQL: | SELECT name FROM employees AS emp
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08589 | train |
v2 | Schema:
departments (alias: dept)(type, code, date, level)
invoices(salary, name, level, status)
Task: Retrieve name from departments that have at least one corresponding entry in invoices sharing the same code.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "invoices",
"outer_alias": "dept",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08590 | train |
v1 | Schema:
managers (alias: mgr)(level, name, code, id)
items(name, value, id, date)
Task: Retrieve name from managers whose level is found in items rows where type matches the outer record.
SQL: | SELECT name FROM managers AS mgr
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08591 | train |
v1 | Schema:
schedules (alias: schd)(name, value, level, amount)
projects(name, code, date, value)
Task: Find value from schedules where type appears in projects entries with matching status.
SQL: | SELECT value FROM schedules AS schd
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08592 | train |
v3 | Schema:
accounts (alias: acct)(id, type, name, code)
projects(date, status, salary, code)
Task: Find id from accounts where salary exceeds the count of salary from projects for the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE salary > (
SELECT COUNT(salary) FROM projects AS prj
WHERE prj.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08593 | train |
v2 | Schema:
customers (alias: cust)(type, date, name, value)
accounts(code, value, type, salary)
Task: Retrieve salary from customers that have at least one corresponding entry in accounts sharing the same type.
SQL: | SELECT salary 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": "salary",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08594 | train |
v3 | Schema:
managers (alias: mgr)(status, salary, id, amount)
transactions(amount, value, level, type)
Task: Retrieve amount from managers with salary above the MAX(salary) of transactions rows sharing the same id.
SQL: | SELECT amount FROM managers AS mgr
WHERE salary > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08595 | train |
v2 | Schema:
branches (alias: brc)(id, date, level, value)
products(type, id, level, date)
Task: Retrieve salary from branches that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08596 | train |
v3 | Schema:
branches (alias: brc)(status, type, level, date)
requests(date, value, level, type)
Task: Retrieve salary from branches with amount above the SUM(amount) of requests rows sharing the same status.
SQL: | SELECT salary FROM branches AS brc
WHERE amount > (
SELECT SUM(amount) FROM requests AS ordr
WHERE ordr.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08597 | train |
v2 | Schema:
managers (alias: mgr)(level, id, salary, amount)
employees(value, type, name, status)
Task: Retrieve id from managers that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08598 | train |
v3 | Schema:
staff (alias: empl)(level, amount, id, status)
products(type, status, code, name)
Task: Retrieve salary from staff with salary above the MAX(salary) of products rows sharing the same id.
SQL: | SELECT salary FROM staff AS empl
WHERE salary > (
SELECT MAX(salary) FROM products AS prod
WHERE prod.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08599 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.