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 |
|---|---|---|---|---|---|---|
v2 | Schema:
customers (alias: cust)(level, salary, status, id)
tasks(name, date, id, code)
Task: Find name from customers where a matching record exists in tasks with the same id.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "tasks",
"outer_alias": "cust",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08700 | train |
v1 | Schema:
projects (alias: prj)(amount, name, status, code)
transactions(salary, code, name, id)
Task: Find name from projects where code appears in transactions entries with matching status.
SQL: | SELECT name FROM projects AS prj
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08701 | train |
v3 | Schema:
tasks (alias: tsk)(status, type, name, value)
schedules(level, salary, id, type)
Task: Retrieve salary from tasks with salary above the AVG(salary) of schedules rows sharing the same id.
SQL: | SELECT salary FROM tasks AS tsk
WHERE salary > (
SELECT AVG(salary) FROM schedules AS schd
WHERE schd.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08702 | train |
v3 | Schema:
tasks (alias: tsk)(code, salary, amount, level)
projects(id, code, salary, name)
Task: Find value from tasks where amount exceeds the average amount from projects for the same code.
SQL: | SELECT value FROM tasks AS tsk
WHERE amount > (
SELECT AVG(amount) FROM projects AS prj
WHERE prj.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08703 | train |
v1 | Schema:
regions (alias: rgn)(name, id, code, date)
requests(type, amount, value, id)
Task: Find id from regions where status appears in requests entries with matching type.
SQL: | SELECT id FROM regions AS rgn
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08704 | train |
v3 | Schema:
staff (alias: empl)(date, value, code, status)
categories(id, level, amount, status)
Task: Retrieve salary from staff with amount above the COUNT(value) of categories rows sharing the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE amount > (
SELECT COUNT(value) FROM categories AS catg
WHERE catg.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08705 | train |
v3 | Schema:
employees (alias: emp)(id, code, status, level)
sales(amount, status, date, type)
Task: Retrieve code from employees with value above the MAX(salary) of sales rows sharing the same status.
SQL: | SELECT code FROM employees AS emp
WHERE value > (
SELECT MAX(salary) FROM sales AS sale
WHERE sale.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08706 | train |
v2 | Schema:
categories (alias: catg)(amount, level, status, name)
projects(level, status, code, value)
Task: Find amount from categories where a matching record exists in projects with the same level.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08707 | train |
v3 | Schema:
requests (alias: ordr)(name, salary, status, date)
schedules(code, name, date, salary)
Task: Find name from requests where salary exceeds the minimum value from schedules for the same level.
SQL: | SELECT name FROM requests AS ordr
WHERE salary > (
SELECT MIN(value) FROM schedules AS schd
WHERE schd.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08708 | train |
v2 | Schema:
customers (alias: cust)(date, salary, value, amount)
employees(code, level, type, value)
Task: Retrieve code from customers that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08709 | train |
v3 | Schema:
invoices (alias: inv)(level, code, value, date)
shipments(code, date, value, salary)
Task: Find code from invoices where value exceeds the maximum amount from shipments for the same id.
SQL: | SELECT code FROM invoices AS inv
WHERE value > (
SELECT MAX(amount) FROM shipments AS shp
WHERE shp.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08710 | train |
v3 | Schema:
accounts (alias: acct)(id, date, name, code)
products(code, status, level, value)
Task: Find value from accounts where salary exceeds the average amount from products for the same level.
SQL: | SELECT value FROM accounts AS acct
WHERE salary > (
SELECT AVG(amount) FROM products AS prod
WHERE prod.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08711 | train |
v3 | Schema:
sales (alias: sale)(date, level, salary, name)
staff(level, code, name, amount)
Task: Retrieve amount from sales with amount above the MAX(salary) of staff rows sharing the same level.
SQL: | SELECT amount FROM sales AS sale
WHERE amount > (
SELECT MAX(salary) FROM staff AS empl
WHERE empl.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08712 | train |
v1 | Schema:
shipments (alias: shp)(name, value, salary, level)
customers(name, date, id, code)
Task: Find salary from shipments where id appears in customers entries with matching level.
SQL: | SELECT salary FROM shipments AS shp
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08713 | train |
v3 | Schema:
items (alias: lne)(value, name, id, type)
shipments(code, type, value, date)
Task: Retrieve value from items with value above the AVG(amount) of shipments rows sharing the same level.
SQL: | SELECT value FROM items AS lne
WHERE value > (
SELECT AVG(amount) FROM shipments AS shp
WHERE shp.level = lne.level
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08714 | train |
v2 | Schema:
employees (alias: emp)(amount, type, level, value)
customers(date, value, type, amount)
Task: Find amount from employees where a matching record exists in customers with the same status.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08715 | train |
v3 | Schema:
managers (alias: mgr)(salary, amount, code, id)
regions(name, id, code, type)
Task: Find id from managers where salary exceeds the count of value from regions for the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE salary > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08716 | train |
v1 | Schema:
categories (alias: catg)(name, date, type, status)
schedules(level, value, type, salary)
Task: Retrieve id from categories whose status is found in schedules rows where id matches the outer record.
SQL: | SELECT id FROM categories AS catg
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08717 | train |
v3 | Schema:
projects (alias: prj)(type, code, status, id)
invoices(amount, id, value, status)
Task: Find salary from projects where salary exceeds the maximum value from invoices for the same type.
SQL: | SELECT salary FROM projects AS prj
WHERE salary > (
SELECT MAX(value) FROM invoices AS inv
WHERE inv.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08718 | train |
v2 | Schema:
departments (alias: dept)(level, amount, salary, value)
schedules(value, salary, amount, code)
Task: Find id from departments where a matching record exists in schedules with the same id.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08719 | train |
v2 | Schema:
branches (alias: brc)(level, code, amount, name)
staff(type, date, id, name)
Task: Retrieve name from branches that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT name FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08720 | train |
v2 | Schema:
orders (alias: ord)(status, type, code, name)
projects(value, id, date, amount)
Task: Retrieve id from orders that have at least one corresponding entry in projects sharing the same id.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08721 | train |
v1 | Schema:
employees (alias: emp)(date, code, type, amount)
products(level, code, value, date)
Task: Select id from employees where level exists in products for the same id.
SQL: | SELECT id FROM employees AS emp
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08722 | train |
v1 | Schema:
invoices (alias: inv)(date, status, id, amount)
tasks(date, id, value, level)
Task: Select code from invoices where type exists in tasks for the same level.
SQL: | SELECT code FROM invoices AS inv
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08723 | train |
v3 | Schema:
transactions (alias: txn)(type, status, level, value)
categories(status, type, level, name)
Task: Retrieve id from transactions with amount above the MAX(value) of categories rows sharing the same level.
SQL: | SELECT id FROM transactions AS txn
WHERE amount > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08724 | train |
v3 | Schema:
customers (alias: cust)(level, code, status, value)
requests(code, level, id, date)
Task: Find code from customers where salary exceeds the total value from requests for the same type.
SQL: | SELECT code FROM customers AS cust
WHERE salary > (
SELECT SUM(value) FROM requests AS ordr
WHERE ordr.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08725 | train |
v1 | Schema:
branches (alias: brc)(id, value, salary, type)
items(status, name, id, value)
Task: Select salary from branches where type exists in items for the same id.
SQL: | SELECT salary FROM branches AS brc
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08726 | train |
v2 | Schema:
items (alias: lne)(code, level, name, salary)
tasks(name, code, salary, status)
Task: Retrieve amount from items that have at least one corresponding entry in tasks sharing the same status.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = lne.status
); | {
"outer_table": "items",
"inner_table": "tasks",
"outer_alias": "lne",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08727 | train |
v3 | Schema:
tasks (alias: tsk)(name, code, amount, date)
schedules(level, amount, id, value)
Task: Retrieve amount from tasks with salary above the MIN(salary) of schedules rows sharing the same status.
SQL: | SELECT amount FROM tasks AS tsk
WHERE salary > (
SELECT MIN(salary) FROM schedules AS schd
WHERE schd.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08728 | train |
v3 | Schema:
invoices (alias: inv)(value, level, name, type)
projects(status, value, level, code)
Task: Retrieve code from invoices with value above the MIN(salary) of projects rows sharing the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE value > (
SELECT MIN(salary) FROM projects AS prj
WHERE prj.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08729 | train |
v1 | Schema:
employees (alias: emp)(value, type, status, name)
regions(status, id, name, level)
Task: Find salary from employees where id appears in regions entries with matching status.
SQL: | SELECT salary FROM employees AS emp
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08730 | train |
v2 | Schema:
projects (alias: prj)(type, salary, date, status)
items(status, date, value, salary)
Task: Find amount from projects where a matching record exists in items with the same code.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08731 | train |
v1 | Schema:
tasks (alias: tsk)(salary, level, status, code)
regions(type, status, amount, salary)
Task: Find value from tasks where type appears in regions entries with matching type.
SQL: | SELECT value FROM tasks AS tsk
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08732 | train |
v2 | Schema:
branches (alias: brc)(value, name, amount, code)
orders(salary, id, name, type)
Task: Retrieve salary from branches that have at least one corresponding entry in orders sharing the same status.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08733 | train |
v3 | Schema:
regions (alias: rgn)(salary, amount, value, name)
projects(status, name, date, salary)
Task: Retrieve salary from regions with value above the MAX(amount) of projects rows sharing the same code.
SQL: | SELECT salary FROM regions AS rgn
WHERE value > (
SELECT MAX(amount) FROM projects AS prj
WHERE prj.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08734 | train |
v2 | Schema:
transactions (alias: txn)(name, code, type, date)
employees(date, value, id, level)
Task: Find salary from transactions where a matching record exists in employees with the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08735 | train |
v2 | Schema:
staff (alias: empl)(date, amount, value, type)
customers(type, level, code, date)
Task: Find amount from staff where a matching record exists in customers with the same type.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08736 | train |
v1 | Schema:
orders (alias: ord)(code, date, level, value)
tasks(type, code, amount, id)
Task: Retrieve id from orders whose status is found in tasks rows where code matches the outer record.
SQL: | SELECT id FROM orders AS ord
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08737 | train |
v1 | Schema:
items (alias: lne)(status, date, value, level)
projects(status, value, level, code)
Task: Select code from items where status exists in projects for the same status.
SQL: | SELECT code FROM items AS lne
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.status = lne.status
); | {
"outer_table": "items",
"inner_table": "projects",
"outer_alias": "lne",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08738 | train |
v3 | Schema:
tasks (alias: tsk)(id, level, value, salary)
schedules(salary, status, type, level)
Task: Retrieve salary from tasks with amount above the MIN(amount) of schedules rows sharing the same type.
SQL: | SELECT salary FROM tasks AS tsk
WHERE amount > (
SELECT MIN(amount) FROM schedules AS schd
WHERE schd.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08739 | train |
v3 | Schema:
regions (alias: rgn)(id, value, name, type)
projects(amount, name, level, salary)
Task: Find code from regions where value exceeds the maximum salary from projects for the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE value > (
SELECT MAX(salary) FROM projects AS prj
WHERE prj.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08740 | train |
v3 | Schema:
sales (alias: sale)(name, date, id, level)
invoices(code, amount, type, salary)
Task: Find amount from sales where value exceeds the average value from invoices for the same id.
SQL: | SELECT amount FROM sales AS sale
WHERE value > (
SELECT AVG(value) FROM invoices AS inv
WHERE inv.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08741 | train |
v1 | Schema:
schedules (alias: schd)(status, name, value, date)
invoices(name, salary, id, status)
Task: Find amount from schedules where status appears in invoices entries with matching code.
SQL: | SELECT amount FROM schedules AS schd
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08742 | train |
v2 | Schema:
products (alias: prod)(id, status, amount, date)
employees(level, amount, status, type)
Task: Retrieve amount from products that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = prod.level
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08743 | train |
v1 | Schema:
regions (alias: rgn)(value, name, amount, code)
branches(name, level, date, amount)
Task: Find code from regions where status appears in branches entries with matching status.
SQL: | SELECT code FROM regions AS rgn
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08744 | train |
v3 | Schema:
regions (alias: rgn)(status, salary, code, id)
tasks(status, level, id, name)
Task: Retrieve name from regions with salary above the AVG(salary) of tasks rows sharing the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE salary > (
SELECT AVG(salary) FROM tasks AS tsk
WHERE tsk.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08745 | train |
v2 | Schema:
categories (alias: catg)(value, status, date, salary)
branches(date, name, value, amount)
Task: Retrieve amount from categories that have at least one corresponding entry in branches sharing the same type.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08746 | train |
v1 | Schema:
projects (alias: prj)(value, id, salary, amount)
departments(status, date, name, level)
Task: Select amount from projects where status exists in departments for the same id.
SQL: | SELECT amount FROM projects AS prj
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08747 | train |
v2 | Schema:
items (alias: lne)(value, type, code, level)
managers(level, id, salary, date)
Task: Find code from items where a matching record exists in managers with the same status.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = lne.status
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08748 | train |
v3 | Schema:
customers (alias: cust)(level, date, code, amount)
items(value, amount, name, salary)
Task: Retrieve code from customers with value above the AVG(salary) of items rows sharing the same id.
SQL: | SELECT code FROM customers AS cust
WHERE value > (
SELECT AVG(salary) FROM items AS lne
WHERE lne.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08749 | train |
v2 | Schema:
shipments (alias: shp)(code, amount, id, level)
tasks(level, code, date, type)
Task: Retrieve amount from shipments that have at least one corresponding entry in tasks sharing the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08750 | train |
v3 | Schema:
customers (alias: cust)(salary, id, name, level)
projects(type, code, status, salary)
Task: Find value from customers where salary exceeds the minimum salary from projects for the same id.
SQL: | SELECT value FROM customers AS cust
WHERE salary > (
SELECT MIN(salary) FROM projects AS prj
WHERE prj.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08751 | train |
v3 | Schema:
products (alias: prod)(level, amount, salary, value)
employees(code, level, amount, id)
Task: Retrieve name from products with amount above the AVG(amount) of employees rows sharing the same code.
SQL: | SELECT name FROM products AS prod
WHERE amount > (
SELECT AVG(amount) FROM employees AS emp
WHERE emp.code = prod.code
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08752 | train |
v2 | Schema:
customers (alias: cust)(id, name, level, type)
regions(name, status, amount, value)
Task: Find name from customers where a matching record exists in regions with the same type.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08753 | train |
v3 | Schema:
departments (alias: dept)(level, name, value, amount)
shipments(name, value, salary, amount)
Task: Retrieve id from departments with salary above the SUM(amount) of shipments rows sharing the same id.
SQL: | SELECT id FROM departments AS dept
WHERE salary > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08754 | train |
v1 | Schema:
schedules (alias: schd)(level, salary, type, amount)
branches(type, id, code, value)
Task: Select salary from schedules where level exists in branches for the same code.
SQL: | SELECT salary FROM schedules AS schd
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08755 | train |
v2 | Schema:
employees (alias: emp)(value, level, code, date)
staff(name, salary, level, id)
Task: Retrieve id from employees that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08756 | train |
v3 | Schema:
departments (alias: dept)(id, status, name, value)
customers(id, name, amount, date)
Task: Find salary from departments where value exceeds the average amount from customers for the same level.
SQL: | SELECT salary FROM departments AS dept
WHERE value > (
SELECT AVG(amount) FROM customers AS cust
WHERE cust.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08757 | train |
v1 | Schema:
requests (alias: ordr)(type, date, salary, amount)
sales(date, type, level, amount)
Task: Find salary from requests where code appears in sales entries with matching code.
SQL: | SELECT salary FROM requests AS ordr
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08758 | train |
v2 | Schema:
accounts (alias: acct)(name, level, amount, id)
items(status, value, amount, id)
Task: Find code from accounts where a matching record exists in items with the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08759 | train |
v2 | Schema:
managers (alias: mgr)(level, amount, salary, id)
products(date, level, code, amount)
Task: Find name from managers where a matching record exists in products with the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08760 | train |
v1 | Schema:
orders (alias: ord)(name, level, id, date)
branches(level, name, id, code)
Task: Select salary from orders where status exists in branches for the same type.
SQL: | SELECT salary FROM orders AS ord
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08761 | train |
v1 | Schema:
categories (alias: catg)(date, id, type, amount)
transactions(value, code, status, date)
Task: Retrieve salary from categories whose status is found in transactions rows where type matches the outer record.
SQL: | SELECT salary FROM categories AS catg
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08762 | train |
v2 | Schema:
tasks (alias: tsk)(value, code, id, salary)
transactions(name, status, value, amount)
Task: Retrieve amount from tasks that have at least one corresponding entry in transactions sharing the same code.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08763 | train |
v1 | Schema:
shipments (alias: shp)(date, code, value, type)
accounts(salary, code, name, level)
Task: Select amount from shipments where code exists in accounts for the same level.
SQL: | SELECT amount FROM shipments AS shp
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08764 | train |
v2 | Schema:
products (alias: prod)(amount, status, name, value)
transactions(type, level, code, date)
Task: Retrieve code from products that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = prod.level
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08765 | train |
v3 | Schema:
tasks (alias: tsk)(amount, type, date, name)
managers(code, status, amount, type)
Task: Retrieve code from tasks with amount above the AVG(salary) of managers rows sharing the same type.
SQL: | SELECT code FROM tasks AS tsk
WHERE amount > (
SELECT AVG(salary) FROM managers AS mgr
WHERE mgr.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08766 | train |
v1 | Schema:
branches (alias: brc)(date, level, value, id)
projects(code, id, salary, level)
Task: Find amount from branches where id appears in projects entries with matching status.
SQL: | SELECT amount FROM branches AS brc
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08767 | train |
v2 | Schema:
projects (alias: prj)(amount, code, value, type)
regions(salary, level, value, date)
Task: Find amount from projects where a matching record exists in regions with the same level.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08768 | train |
v1 | Schema:
shipments (alias: shp)(type, salary, id, date)
products(status, salary, value, name)
Task: Select salary from shipments where level exists in products for the same id.
SQL: | SELECT salary FROM shipments AS shp
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08769 | train |
v1 | Schema:
staff (alias: empl)(salary, id, date, code)
items(date, type, amount, value)
Task: Select amount from staff where type exists in items for the same level.
SQL: | SELECT amount FROM staff AS empl
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08770 | train |
v1 | Schema:
categories (alias: catg)(salary, level, name, amount)
orders(date, status, level, value)
Task: Retrieve amount from categories whose code is found in orders rows where level matches the outer record.
SQL: | SELECT amount FROM categories AS catg
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08771 | train |
v2 | Schema:
accounts (alias: acct)(name, salary, type, status)
invoices(type, salary, code, date)
Task: Retrieve value from accounts that have at least one corresponding entry in invoices sharing the same level.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08772 | train |
v3 | Schema:
managers (alias: mgr)(value, code, salary, type)
staff(status, code, type, value)
Task: Find value from managers where salary exceeds the maximum value from staff for the same code.
SQL: | SELECT value FROM managers AS mgr
WHERE salary > (
SELECT MAX(value) FROM staff AS empl
WHERE empl.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08773 | train |
v3 | Schema:
regions (alias: rgn)(code, value, amount, date)
accounts(salary, date, level, name)
Task: Retrieve id from regions with value above the MAX(salary) of accounts rows sharing the same code.
SQL: | SELECT id FROM regions AS rgn
WHERE value > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08774 | train |
v3 | Schema:
orders (alias: ord)(value, id, code, amount)
regions(amount, code, level, value)
Task: Find code from orders where value exceeds the maximum amount from regions for the same level.
SQL: | SELECT code FROM orders AS ord
WHERE value > (
SELECT MAX(amount) 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": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08775 | train |
v1 | Schema:
items (alias: lne)(value, id, status, salary)
managers(type, salary, amount, id)
Task: Select code from items where level exists in managers for the same level.
SQL: | SELECT code FROM items AS lne
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.level = lne.level
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08776 | train |
v3 | Schema:
schedules (alias: schd)(id, code, type, name)
items(amount, type, id, status)
Task: Retrieve id from schedules with amount above the SUM(value) of items rows sharing the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE amount > (
SELECT SUM(value) FROM items AS lne
WHERE lne.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08777 | train |
v1 | Schema:
orders (alias: ord)(amount, salary, id, date)
schedules(salary, level, type, amount)
Task: Find value from orders where code appears in schedules entries with matching level.
SQL: | SELECT value FROM orders AS ord
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08778 | train |
v3 | Schema:
employees (alias: emp)(amount, salary, code, type)
customers(name, code, date, id)
Task: Retrieve code from employees with amount above the MAX(salary) of customers rows sharing the same level.
SQL: | SELECT code FROM employees AS emp
WHERE amount > (
SELECT MAX(salary) FROM customers AS cust
WHERE cust.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08779 | train |
v2 | Schema:
staff (alias: empl)(status, amount, id, date)
orders(salary, value, date, type)
Task: Find salary from staff where a matching record exists in orders with the same status.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08780 | train |
v3 | Schema:
items (alias: lne)(date, code, salary, name)
customers(date, level, value, id)
Task: Retrieve code from items with value above the AVG(value) of customers rows sharing the same code.
SQL: | SELECT code FROM items AS lne
WHERE value > (
SELECT AVG(value) FROM customers AS cust
WHERE cust.code = lne.code
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08781 | train |
v2 | Schema:
schedules (alias: schd)(status, date, name, level)
products(code, value, level, status)
Task: Retrieve amount from schedules that have at least one corresponding entry in products sharing the same code.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08782 | train |
v3 | Schema:
tasks (alias: tsk)(salary, date, value, type)
invoices(id, amount, type, code)
Task: Find name from tasks where value exceeds the average value from invoices for the same type.
SQL: | SELECT name FROM tasks AS tsk
WHERE value > (
SELECT AVG(value) FROM invoices AS inv
WHERE inv.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08783 | train |
v1 | Schema:
items (alias: lne)(status, level, id, code)
departments(id, level, code, date)
Task: Select value from items where level exists in departments for the same status.
SQL: | SELECT value FROM items AS lne
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.status = lne.status
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08784 | train |
v2 | Schema:
departments (alias: dept)(code, amount, value, level)
regions(code, level, type, value)
Task: Find salary from departments where a matching record exists in regions with the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08785 | train |
v1 | Schema:
sales (alias: sale)(code, type, status, amount)
tasks(type, amount, salary, date)
Task: Retrieve id from sales whose level is found in tasks rows where code matches the outer record.
SQL: | SELECT id FROM sales AS sale
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08786 | train |
v1 | Schema:
orders (alias: ord)(code, amount, level, salary)
transactions(level, name, date, id)
Task: Select id from orders where type exists in transactions for the same level.
SQL: | SELECT id FROM orders AS ord
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08787 | train |
v1 | Schema:
departments (alias: dept)(value, salary, name, date)
requests(salary, code, date, level)
Task: Select id from departments where id exists in requests for the same level.
SQL: | SELECT id FROM departments AS dept
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08788 | train |
v3 | Schema:
tasks (alias: tsk)(date, salary, level, amount)
orders(value, level, name, status)
Task: Retrieve code from tasks with amount above the MAX(amount) of orders rows sharing the same level.
SQL: | SELECT code FROM tasks AS tsk
WHERE amount > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08789 | train |
v1 | Schema:
sales (alias: sale)(salary, status, id, type)
items(value, amount, name, id)
Task: Retrieve name from sales whose status is found in items rows where id matches the outer record.
SQL: | SELECT name 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": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08790 | train |
v1 | Schema:
products (alias: prod)(salary, status, level, amount)
categories(code, status, amount, value)
Task: Find code from products where type appears in categories entries with matching code.
SQL: | SELECT code FROM products AS prod
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.code = prod.code
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08791 | train |
v3 | Schema:
categories (alias: catg)(value, name, level, date)
managers(salary, amount, type, level)
Task: Find salary from categories where amount exceeds the count of salary from managers for the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE amount > (
SELECT COUNT(salary) FROM managers AS mgr
WHERE mgr.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08792 | train |
v3 | Schema:
departments (alias: dept)(code, level, value, type)
categories(code, value, status, date)
Task: Retrieve value from departments with value above the COUNT(salary) of categories rows sharing the same id.
SQL: | SELECT value FROM departments AS dept
WHERE value > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08793 | train |
v2 | Schema:
tasks (alias: tsk)(code, status, amount, id)
sales(level, value, salary, id)
Task: Find value from tasks where a matching record exists in sales with the same id.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08794 | train |
v1 | Schema:
projects (alias: prj)(date, status, amount, type)
invoices(id, name, code, type)
Task: Retrieve name from projects whose status is found in invoices rows where code matches the outer record.
SQL: | SELECT name FROM projects AS prj
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08795 | train |
v2 | Schema:
shipments (alias: shp)(amount, type, id, level)
transactions(amount, salary, id, name)
Task: Find amount from shipments where a matching record exists in transactions with the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08796 | train |
v2 | Schema:
sales (alias: sale)(status, date, salary, code)
employees(type, id, salary, value)
Task: Retrieve salary from sales that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08797 | train |
v1 | Schema:
tasks (alias: tsk)(id, amount, salary, name)
staff(status, type, date, code)
Task: Find amount from tasks where status appears in staff entries with matching type.
SQL: | SELECT amount FROM tasks AS tsk
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "staff",
"outer_alias": "tsk",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08798 | train |
v1 | Schema:
requests (alias: ordr)(level, type, salary, status)
shipments(id, value, level, name)
Task: Find salary from requests where level appears in shipments entries with matching id.
SQL: | SELECT salary FROM requests AS ordr
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08799 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.