variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v3 | Schema:
items (alias: lne)(amount, level, value, type)
customers(salary, id, level, type)
Task: Retrieve id from items with salary above the AVG(salary) of customers rows sharing the same level.
SQL: | SELECT id FROM items AS lne
WHERE salary > (
SELECT AVG(salary) FROM customers AS cust
WHERE cust.level = lne.level
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_04100 | train |
v1 | Schema:
customers (alias: cust)(value, level, id, amount)
invoices(level, code, name, amount)
Task: Select id from customers where type exists in invoices for the same id.
SQL: | SELECT id FROM customers AS cust
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04101 | train |
v1 | Schema:
accounts (alias: acct)(level, salary, code, value)
products(level, status, value, date)
Task: Find amount from accounts where level appears in products entries with matching code.
SQL: | SELECT amount FROM accounts AS acct
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04102 | train |
v2 | Schema:
staff (alias: empl)(amount, id, level, salary)
regions(level, amount, code, value)
Task: Find salary from staff where a matching record exists in regions with the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_04103 | train |
v3 | Schema:
transactions (alias: txn)(type, id, status, date)
departments(date, amount, code, level)
Task: Retrieve salary from transactions with value above the COUNT(salary) of departments rows sharing the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE value > (
SELECT COUNT(salary) FROM departments AS dept
WHERE dept.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04104 | train |
v1 | Schema:
staff (alias: empl)(amount, salary, date, status)
branches(code, salary, level, name)
Task: Select amount from staff where type exists in branches for the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_04105 | train |
v3 | Schema:
categories (alias: catg)(id, status, amount, code)
shipments(level, status, salary, date)
Task: Retrieve name from categories with salary above the MIN(amount) of shipments rows sharing the same level.
SQL: | SELECT name FROM categories AS catg
WHERE salary > (
SELECT MIN(amount) FROM shipments AS shp
WHERE shp.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_04106 | train |
v3 | Schema:
employees (alias: emp)(amount, salary, level, date)
tasks(type, value, salary, code)
Task: Find code from employees where value exceeds the total amount from tasks for the same level.
SQL: | SELECT code FROM employees AS emp
WHERE value > (
SELECT SUM(amount) FROM tasks AS tsk
WHERE tsk.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04107 | train |
v1 | Schema:
managers (alias: mgr)(amount, value, code, name)
departments(date, salary, name, amount)
Task: Retrieve salary from managers whose level is found in departments rows where code matches the outer record.
SQL: | SELECT salary FROM managers AS mgr
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04108 | train |
v2 | Schema:
branches (alias: brc)(value, status, id, level)
shipments(level, amount, date, id)
Task: Find id from branches where a matching record exists in shipments with the same status.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_04109 | train |
v1 | Schema:
staff (alias: empl)(level, amount, name, value)
tasks(name, salary, level, value)
Task: Retrieve value from staff whose status is found in tasks rows where status matches the outer record.
SQL: | SELECT value FROM staff AS empl
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_04110 | train |
v2 | Schema:
sales (alias: sale)(value, date, code, status)
tasks(salary, id, level, status)
Task: Retrieve salary from sales that have at least one corresponding entry in tasks sharing the same id.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04111 | train |
v3 | Schema:
items (alias: lne)(type, date, status, code)
employees(status, date, type, name)
Task: Find salary from items where salary exceeds the total amount from employees for the same id.
SQL: | SELECT salary FROM items AS lne
WHERE salary > (
SELECT SUM(amount) FROM employees AS emp
WHERE emp.id = lne.id
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_04112 | train |
v1 | Schema:
products (alias: prod)(name, salary, level, code)
tasks(level, status, code, id)
Task: Select id from products where type exists in tasks for the same code.
SQL: | SELECT id FROM products AS prod
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.code = prod.code
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04113 | train |
v3 | Schema:
requests (alias: ordr)(id, level, name, code)
products(level, status, name, date)
Task: Find code from requests where value exceeds the average value from products for the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE value > (
SELECT AVG(value) FROM products AS prod
WHERE prod.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_04114 | train |
v1 | Schema:
items (alias: lne)(amount, status, code, salary)
branches(value, level, date, name)
Task: Find code from items where code appears in branches entries with matching code.
SQL: | SELECT code FROM items AS lne
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.code = lne.code
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_04115 | train |
v3 | Schema:
products (alias: prod)(salary, value, name, level)
categories(date, value, level, status)
Task: Find amount from products where salary exceeds the count of amount from categories for the same type.
SQL: | SELECT amount FROM products AS prod
WHERE salary > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.type = prod.type
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04116 | train |
v3 | Schema:
staff (alias: empl)(amount, code, level, date)
employees(name, status, id, value)
Task: Find name from staff where amount exceeds the maximum amount from employees for the same code.
SQL: | SELECT name FROM staff AS empl
WHERE amount > (
SELECT MAX(amount) FROM employees AS emp
WHERE emp.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_04117 | train |
v3 | Schema:
employees (alias: emp)(status, name, amount, salary)
managers(name, type, level, value)
Task: Find value from employees where amount exceeds the maximum salary from managers for the same status.
SQL: | SELECT value FROM employees AS emp
WHERE amount > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04118 | train |
v2 | Schema:
tasks (alias: tsk)(date, type, code, salary)
employees(date, salary, name, level)
Task: Find salary from tasks where a matching record exists in employees with the same id.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "tsk",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_04119 | train |
v1 | Schema:
accounts (alias: acct)(name, level, status, code)
customers(value, salary, status, code)
Task: Find salary from accounts where level appears in customers entries with matching level.
SQL: | SELECT salary FROM accounts AS acct
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04120 | train |
v3 | Schema:
products (alias: prod)(name, status, code, id)
managers(level, code, status, name)
Task: Retrieve salary from products with value above the COUNT(amount) of managers rows sharing the same level.
SQL: | SELECT salary FROM products AS prod
WHERE value > (
SELECT COUNT(amount) FROM managers AS mgr
WHERE mgr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04121 | train |
v2 | Schema:
employees (alias: emp)(type, name, date, id)
projects(code, value, status, salary)
Task: Find salary from employees where a matching record exists in projects with the same id.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "projects",
"outer_alias": "emp",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04122 | train |
v1 | Schema:
regions (alias: rgn)(id, name, status, level)
departments(name, value, salary, level)
Task: Find code from regions where status appears in departments entries with matching status.
SQL: | SELECT code FROM regions AS rgn
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_04123 | train |
v2 | Schema:
managers (alias: mgr)(name, amount, date, level)
departments(value, status, salary, date)
Task: Find value from managers where a matching record exists in departments with the same status.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04124 | train |
v1 | Schema:
items (alias: lne)(code, name, type, date)
shipments(amount, id, date, type)
Task: Find amount from items where type appears in shipments entries with matching status.
SQL: | SELECT amount FROM items AS lne
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.status = lne.status
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_04125 | train |
v1 | Schema:
shipments (alias: shp)(salary, type, code, value)
departments(value, status, name, amount)
Task: Select value from shipments where type exists in departments for the same status.
SQL: | SELECT value FROM shipments AS shp
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_04126 | train |
v2 | Schema:
requests (alias: ordr)(level, status, id, date)
staff(value, date, id, type)
Task: Find amount from requests where a matching record exists in staff with the same type.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_04127 | train |
v1 | Schema:
sales (alias: sale)(amount, status, id, value)
invoices(date, amount, id, salary)
Task: Select id from sales where type exists in invoices for the same status.
SQL: | SELECT id FROM sales AS sale
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04128 | train |
v1 | Schema:
invoices (alias: inv)(salary, amount, date, type)
departments(value, amount, salary, date)
Task: Retrieve id from invoices whose id is found in departments rows where status matches the outer record.
SQL: | SELECT id FROM invoices AS inv
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04129 | train |
v3 | Schema:
transactions (alias: txn)(status, level, type, date)
staff(type, date, value, status)
Task: Find amount from transactions where salary exceeds the average value from staff for the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE salary > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04130 | train |
v2 | Schema:
invoices (alias: inv)(value, id, date, type)
shipments(id, salary, level, status)
Task: Find amount from invoices where a matching record exists in shipments with the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04131 | train |
v2 | Schema:
regions (alias: rgn)(code, level, type, value)
shipments(level, value, salary, amount)
Task: Retrieve name from regions that have at least one corresponding entry in shipments sharing the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_04132 | train |
v2 | Schema:
branches (alias: brc)(date, name, code, id)
tasks(amount, salary, code, name)
Task: Find id from branches where a matching record exists in tasks with the same level.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_04133 | train |
v1 | Schema:
sales (alias: sale)(amount, id, type, value)
transactions(salary, id, amount, value)
Task: Retrieve value from sales whose type is found in transactions rows where type matches the outer record.
SQL: | SELECT value FROM sales AS sale
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04134 | train |
v3 | Schema:
transactions (alias: txn)(name, level, amount, salary)
shipments(amount, status, value, code)
Task: Find amount from transactions where amount exceeds the minimum value from shipments for the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE amount > (
SELECT MIN(value) FROM shipments AS shp
WHERE shp.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04135 | train |
v1 | Schema:
shipments (alias: shp)(level, salary, name, id)
departments(name, value, status, code)
Task: Retrieve name from shipments whose id is found in departments rows where level matches the outer record.
SQL: | SELECT name FROM shipments AS shp
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_04136 | train |
v3 | Schema:
customers (alias: cust)(value, code, date, level)
items(type, id, value, salary)
Task: Retrieve value from customers with amount above the SUM(salary) of items rows sharing the same id.
SQL: | SELECT value FROM customers AS cust
WHERE amount > (
SELECT SUM(salary) FROM items AS lne
WHERE lne.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04137 | train |
v1 | Schema:
items (alias: lne)(name, code, status, id)
managers(status, value, salary, date)
Task: Find id from items where type appears in managers entries with matching level.
SQL: | SELECT id FROM items AS lne
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.level = lne.level
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_04138 | train |
v2 | Schema:
departments (alias: dept)(salary, code, level, type)
accounts(code, amount, type, salary)
Task: Find value from departments where a matching record exists in accounts with the same type.
SQL: | SELECT value 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": "value",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04139 | train |
v1 | Schema:
staff (alias: empl)(value, type, date, level)
categories(code, id, status, salary)
Task: Select salary from staff where code exists in categories for the same code.
SQL: | SELECT salary FROM staff AS empl
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_04140 | train |
v2 | Schema:
invoices (alias: inv)(code, type, value, salary)
accounts(code, level, name, salary)
Task: Retrieve id from invoices that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT id 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": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04141 | train |
v2 | Schema:
customers (alias: cust)(salary, id, status, date)
categories(code, type, amount, level)
Task: Retrieve salary from customers that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04142 | train |
v3 | Schema:
branches (alias: brc)(name, level, type, status)
requests(amount, value, status, level)
Task: Find name from branches where salary exceeds the minimum value from requests for the same code.
SQL: | SELECT name FROM branches AS brc
WHERE salary > (
SELECT MIN(value) FROM requests AS ordr
WHERE ordr.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_04143 | train |
v1 | Schema:
employees (alias: emp)(level, date, status, value)
shipments(id, name, status, salary)
Task: Find amount from employees where type appears in shipments entries with matching id.
SQL: | SELECT amount FROM employees AS emp
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04144 | train |
v2 | Schema:
categories (alias: catg)(name, amount, value, salary)
sales(code, type, value, date)
Task: Retrieve code from categories that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_04145 | train |
v1 | Schema:
schedules (alias: schd)(name, salary, value, level)
requests(value, id, level, salary)
Task: Find salary from schedules where level appears in requests entries with matching type.
SQL: | SELECT salary FROM schedules AS schd
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_04146 | train |
v2 | Schema:
transactions (alias: txn)(code, name, value, date)
regions(status, type, id, salary)
Task: Find id from transactions where a matching record exists in regions with the same type.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04147 | train |
v3 | Schema:
customers (alias: cust)(code, status, level, date)
items(level, code, date, amount)
Task: Find code from customers where value exceeds the minimum value from items for the same level.
SQL: | SELECT code FROM customers AS cust
WHERE value > (
SELECT MIN(value) FROM items AS lne
WHERE lne.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04148 | train |
v3 | Schema:
tasks (alias: tsk)(id, name, salary, value)
requests(amount, value, type, level)
Task: Find name from tasks where amount exceeds the minimum amount from requests for the same type.
SQL: | SELECT name FROM tasks AS tsk
WHERE amount > (
SELECT MIN(amount) FROM requests AS ordr
WHERE ordr.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "name",
"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_04149 | train |
v3 | Schema:
orders (alias: ord)(name, code, amount, id)
requests(id, date, level, name)
Task: Find salary from orders where salary exceeds the average amount from requests for the same id.
SQL: | SELECT salary FROM orders AS ord
WHERE salary > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04150 | train |
v3 | Schema:
schedules (alias: schd)(value, code, name, type)
items(level, value, salary, status)
Task: Retrieve name from schedules with value above the MIN(value) of items rows sharing the same level.
SQL: | SELECT name FROM schedules AS schd
WHERE value > (
SELECT MIN(value) FROM items AS lne
WHERE lne.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_04151 | train |
v1 | Schema:
products (alias: prod)(value, name, date, amount)
accounts(salary, status, amount, date)
Task: Find code from products where code appears in accounts entries with matching level.
SQL: | SELECT code FROM products AS prod
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.level = prod.level
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04152 | train |
v1 | Schema:
staff (alias: empl)(status, type, amount, code)
sales(salary, id, type, status)
Task: Select code from staff where id exists in sales for the same type.
SQL: | SELECT code FROM staff AS empl
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_04153 | train |
v1 | Schema:
requests (alias: ordr)(salary, code, name, date)
staff(id, status, amount, name)
Task: Retrieve name from requests whose type is found in staff rows where type matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_04154 | train |
v2 | Schema:
orders (alias: ord)(type, salary, amount, name)
projects(level, amount, type, salary)
Task: Find amount from orders where a matching record exists in projects with the same type.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04155 | train |
v1 | Schema:
tasks (alias: tsk)(name, status, amount, code)
shipments(name, amount, date, status)
Task: Find salary from tasks where level appears in shipments entries with matching code.
SQL: | SELECT salary FROM tasks AS tsk
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_04156 | train |
v2 | Schema:
shipments (alias: shp)(level, id, date, status)
tasks(status, level, date, salary)
Task: Find id from shipments where a matching record exists in tasks with the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_04157 | train |
v1 | Schema:
projects (alias: prj)(level, status, value, salary)
shipments(type, level, value, amount)
Task: Find amount from projects where id appears in shipments entries with matching type.
SQL: | SELECT amount FROM projects AS prj
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_04158 | train |
v1 | Schema:
items (alias: lne)(value, status, amount, id)
sales(level, status, salary, amount)
Task: Find amount from items where level appears in sales entries with matching status.
SQL: | SELECT amount FROM items AS lne
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.status = lne.status
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_04159 | train |
v2 | Schema:
sales (alias: sale)(type, id, name, status)
projects(code, name, id, salary)
Task: Retrieve value from sales that have at least one corresponding entry in projects sharing the same code.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04160 | train |
v2 | Schema:
customers (alias: cust)(value, name, level, salary)
requests(level, amount, id, salary)
Task: Find code from customers where a matching record exists in requests with the same type.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04161 | train |
v2 | Schema:
projects (alias: prj)(level, salary, amount, value)
sales(id, date, name, salary)
Task: Find salary from projects where a matching record exists in sales with the same code.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_04162 | train |
v1 | Schema:
departments (alias: dept)(date, value, code, name)
regions(salary, amount, name, value)
Task: Select amount from departments where status exists in regions for the same code.
SQL: | SELECT amount FROM departments AS dept
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04163 | train |
v2 | Schema:
regions (alias: rgn)(level, amount, code, type)
sales(status, id, salary, date)
Task: Retrieve id from regions that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_04164 | train |
v1 | Schema:
regions (alias: rgn)(date, value, salary, type)
departments(salary, type, name, code)
Task: Find name from regions where status appears in departments entries with matching code.
SQL: | SELECT name FROM regions AS rgn
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_04165 | train |
v3 | Schema:
tasks (alias: tsk)(date, amount, type, level)
departments(status, level, id, amount)
Task: Find code from tasks where salary exceeds the minimum value from departments for the same status.
SQL: | SELECT code FROM tasks AS tsk
WHERE salary > (
SELECT MIN(value) FROM departments AS dept
WHERE dept.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "tsk",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_04166 | train |
v2 | Schema:
branches (alias: brc)(salary, level, code, date)
customers(amount, id, type, name)
Task: Find code from branches where a matching record exists in customers with the same type.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_04167 | train |
v1 | Schema:
categories (alias: catg)(type, code, name, level)
staff(id, code, salary, value)
Task: Retrieve code from categories whose id is found in staff rows where id matches the outer record.
SQL: | SELECT code FROM categories AS catg
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_04168 | train |
v2 | Schema:
departments (alias: dept)(level, salary, name, status)
invoices(salary, id, amount, date)
Task: Retrieve id from departments that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "invoices",
"outer_alias": "dept",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04169 | train |
v2 | Schema:
departments (alias: dept)(value, status, amount, code)
customers(status, level, type, salary)
Task: Retrieve name from departments that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04170 | train |
v3 | Schema:
orders (alias: ord)(date, salary, code, amount)
shipments(type, code, amount, salary)
Task: Find salary from orders where salary exceeds the total value from shipments for the same id.
SQL: | SELECT salary FROM orders AS ord
WHERE salary > (
SELECT SUM(value) FROM shipments AS shp
WHERE shp.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04171 | train |
v2 | Schema:
customers (alias: cust)(name, id, code, value)
shipments(date, name, code, id)
Task: Find id from customers where a matching record exists in shipments with the same code.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04172 | train |
v1 | Schema:
employees (alias: emp)(id, salary, level, date)
managers(amount, id, level, name)
Task: Retrieve salary from employees whose code is found in managers rows where type matches the outer record.
SQL: | SELECT salary FROM employees AS emp
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04173 | train |
v3 | Schema:
accounts (alias: acct)(value, code, amount, id)
branches(level, name, status, type)
Task: Find id from accounts where amount exceeds the total salary from branches for the same level.
SQL: | SELECT id FROM accounts AS acct
WHERE amount > (
SELECT SUM(salary) FROM branches AS brc
WHERE brc.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "brc",
"proj_col": "id",
"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_04174 | train |
v2 | Schema:
sales (alias: sale)(name, salary, amount, date)
customers(value, salary, name, code)
Task: Find salary from sales where a matching record exists in customers with the same level.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04175 | train |
v2 | Schema:
tasks (alias: tsk)(code, value, id, salary)
employees(amount, date, status, id)
Task: Find id from tasks where a matching record exists in employees with the same level.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "tsk",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_04176 | train |
v2 | Schema:
managers (alias: mgr)(value, amount, status, code)
regions(type, level, code, salary)
Task: Retrieve value from managers that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04177 | train |
v3 | Schema:
regions (alias: rgn)(name, status, value, type)
staff(level, name, salary, status)
Task: Retrieve value from regions with value above the COUNT(value) of staff rows sharing the same level.
SQL: | SELECT value FROM regions AS rgn
WHERE value > (
SELECT COUNT(value) FROM staff AS empl
WHERE empl.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_04178 | train |
v1 | Schema:
products (alias: prod)(id, amount, status, date)
projects(value, amount, date, type)
Task: Select salary from products where id exists in projects for the same status.
SQL: | SELECT salary FROM products AS prod
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.status = prod.status
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "prod",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04179 | train |
v2 | Schema:
orders (alias: ord)(salary, level, id, amount)
requests(level, status, date, name)
Task: Find id from orders where a matching record exists in requests with the same code.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04180 | train |
v3 | Schema:
tasks (alias: tsk)(id, date, salary, name)
invoices(amount, type, code, level)
Task: Retrieve id from tasks with amount above the SUM(amount) of invoices rows sharing the same id.
SQL: | SELECT id FROM tasks AS tsk
WHERE amount > (
SELECT SUM(amount) FROM invoices AS inv
WHERE inv.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_04181 | train |
v1 | Schema:
sales (alias: sale)(salary, name, id, date)
employees(id, type, value, date)
Task: Select salary from sales where id exists in employees for the same id.
SQL: | SELECT salary FROM sales AS sale
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04182 | train |
v3 | Schema:
transactions (alias: txn)(salary, amount, level, value)
accounts(value, salary, level, date)
Task: Retrieve amount from transactions with value above the AVG(salary) of accounts rows sharing the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE value > (
SELECT AVG(salary) FROM accounts AS acct
WHERE acct.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04183 | train |
v1 | Schema:
requests (alias: ordr)(date, value, id, salary)
branches(id, status, date, amount)
Task: Find name from requests where type appears in branches entries with matching code.
SQL: | SELECT name FROM requests AS ordr
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_04184 | train |
v1 | Schema:
departments (alias: dept)(name, salary, type, id)
employees(name, id, amount, type)
Task: Retrieve id from departments whose level is found in employees rows where type matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04185 | train |
v3 | Schema:
employees (alias: emp)(id, salary, status, level)
shipments(date, status, value, amount)
Task: Retrieve code from employees with amount above the COUNT(value) of shipments rows sharing the same status.
SQL: | SELECT code FROM employees AS emp
WHERE amount > (
SELECT COUNT(value) FROM shipments AS shp
WHERE shp.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04186 | train |
v1 | Schema:
transactions (alias: txn)(date, level, amount, status)
tasks(level, salary, amount, type)
Task: Select salary from transactions where status exists in tasks for the same type.
SQL: | SELECT salary FROM transactions AS txn
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04187 | train |
v2 | Schema:
regions (alias: rgn)(salary, date, level, type)
schedules(status, salary, value, id)
Task: Retrieve value from regions that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_04188 | train |
v2 | Schema:
regions (alias: rgn)(status, name, type, id)
customers(id, status, name, type)
Task: Retrieve id from regions that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_04189 | train |
v1 | Schema:
products (alias: prod)(date, level, value, status)
requests(type, value, date, status)
Task: Select salary from products where code exists in requests for the same id.
SQL: | SELECT salary FROM products AS prod
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.id = prod.id
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04190 | train |
v3 | Schema:
customers (alias: cust)(status, id, value, level)
tasks(status, date, type, id)
Task: Retrieve name from customers with salary above the COUNT(value) of tasks rows sharing the same code.
SQL: | SELECT name FROM customers AS cust
WHERE salary > (
SELECT COUNT(value) FROM tasks AS tsk
WHERE tsk.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "tasks",
"outer_alias": "cust",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04191 | train |
v2 | Schema:
managers (alias: mgr)(code, status, id, salary)
tasks(name, status, value, amount)
Task: Retrieve id from managers that have at least one corresponding entry in tasks sharing the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04192 | train |
v2 | Schema:
sales (alias: sale)(code, status, date, type)
items(id, date, salary, value)
Task: Retrieve id from sales that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04193 | train |
v3 | Schema:
branches (alias: brc)(status, code, level, salary)
departments(date, status, type, id)
Task: Retrieve salary from branches with salary above the SUM(salary) of departments rows sharing the same level.
SQL: | SELECT salary FROM branches AS brc
WHERE salary > (
SELECT SUM(salary) FROM departments AS dept
WHERE dept.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "departments",
"outer_alias": "brc",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_04194 | train |
v3 | Schema:
transactions (alias: txn)(type, date, level, amount)
regions(code, level, status, amount)
Task: Retrieve value from transactions with value above the MAX(value) of regions rows sharing the same type.
SQL: | SELECT value FROM transactions AS txn
WHERE value > (
SELECT MAX(value) FROM regions AS rgn
WHERE rgn.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04195 | train |
v2 | Schema:
invoices (alias: inv)(id, level, salary, value)
customers(name, level, date, value)
Task: Retrieve value from invoices that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04196 | train |
v1 | Schema:
departments (alias: dept)(id, name, code, status)
managers(date, type, value, level)
Task: Retrieve amount from departments whose status is found in managers rows where type matches the outer record.
SQL: | SELECT amount FROM departments AS dept
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_04197 | train |
v2 | Schema:
categories (alias: catg)(date, salary, amount, id)
employees(code, salary, name, id)
Task: Find id from categories where a matching record exists in employees with the same code.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_04198 | train |
v2 | Schema:
items (alias: lne)(type, amount, name, level)
shipments(value, name, date, type)
Task: Find salary from items where a matching record exists in shipments with the same level.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = lne.level
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_04199 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.