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:
requests (alias: ordr)(type, name, code, level)
shipments(salary, name, level, code)
Task: Find id from requests where salary exceeds the total salary from shipments for the same type.
SQL: | SELECT id FROM requests AS ordr
WHERE salary > (
SELECT SUM(salary) FROM shipments AS shp
WHERE shp.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12200 | train |
v1 | Schema:
departments (alias: dept)(code, name, status, value)
categories(name, code, id, level)
Task: Retrieve salary from departments whose type is found in categories rows where id matches the outer record.
SQL: | SELECT salary FROM departments AS dept
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12201 | train |
v3 | Schema:
orders (alias: ord)(amount, value, type, name)
products(level, type, status, id)
Task: Find name from orders where value exceeds the maximum salary from products for the same code.
SQL: | SELECT name FROM orders AS ord
WHERE value > (
SELECT MAX(salary) FROM products AS prod
WHERE prod.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12202 | train |
v1 | Schema:
categories (alias: catg)(date, status, amount, type)
items(amount, salary, level, name)
Task: Select salary from categories where id exists in items for the same id.
SQL: | SELECT salary FROM categories AS catg
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12203 | train |
v1 | Schema:
tasks (alias: tsk)(status, amount, id, salary)
requests(name, amount, date, type)
Task: Select id from tasks where id exists in requests for the same status.
SQL: | SELECT id FROM tasks AS tsk
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_12204 | train |
v3 | Schema:
branches (alias: brc)(amount, value, level, type)
invoices(status, value, name, id)
Task: Retrieve code from branches with value above the AVG(value) of invoices rows sharing the same level.
SQL: | SELECT code FROM branches AS brc
WHERE value > (
SELECT AVG(value) FROM invoices AS inv
WHERE inv.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12205 | train |
v3 | Schema:
schedules (alias: schd)(amount, status, date, level)
items(type, value, id, salary)
Task: Find id from schedules where value exceeds the maximum salary from items for the same type.
SQL: | SELECT id FROM schedules AS schd
WHERE value > (
SELECT MAX(salary) FROM items AS lne
WHERE lne.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12206 | train |
v1 | Schema:
accounts (alias: acct)(value, code, type, status)
orders(salary, name, type, date)
Task: Find name from accounts where type appears in orders entries with matching id.
SQL: | SELECT name FROM accounts AS acct
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12207 | train |
v3 | Schema:
regions (alias: rgn)(level, salary, type, value)
accounts(amount, name, status, date)
Task: Find salary from regions where value exceeds the minimum amount from accounts for the same type.
SQL: | SELECT salary FROM regions AS rgn
WHERE value > (
SELECT MIN(amount) FROM accounts AS acct
WHERE acct.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_12208 | train |
v1 | Schema:
schedules (alias: schd)(id, level, value, code)
managers(status, code, name, salary)
Task: Retrieve id from schedules whose id is found in managers rows where status matches the outer record.
SQL: | SELECT id FROM schedules AS schd
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12209 | train |
v1 | Schema:
categories (alias: catg)(id, value, name, code)
sales(type, status, id, level)
Task: Select amount from categories where id exists in sales for the same status.
SQL: | SELECT amount FROM categories AS catg
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12210 | train |
v3 | Schema:
schedules (alias: schd)(level, amount, id, type)
categories(name, status, id, date)
Task: Retrieve amount from schedules with salary above the MIN(salary) of categories rows sharing the same code.
SQL: | SELECT amount FROM schedules AS schd
WHERE salary > (
SELECT MIN(salary) FROM categories AS catg
WHERE catg.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12211 | train |
v1 | Schema:
projects (alias: prj)(salary, type, status, value)
orders(code, type, level, amount)
Task: Find value from projects where code appears in orders entries with matching id.
SQL: | SELECT value FROM projects AS prj
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "orders",
"outer_alias": "prj",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_12212 | train |
v3 | Schema:
invoices (alias: inv)(type, name, level, amount)
transactions(amount, type, level, id)
Task: Find name from invoices where salary exceeds the minimum value from transactions for the same id.
SQL: | SELECT name FROM invoices AS inv
WHERE salary > (
SELECT MIN(value) FROM transactions AS txn
WHERE txn.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12213 | train |
v3 | Schema:
employees (alias: emp)(type, date, code, status)
customers(level, value, salary, date)
Task: Find salary from employees where value exceeds the maximum amount from customers for the same level.
SQL: | SELECT salary FROM employees AS emp
WHERE value > (
SELECT MAX(amount) FROM customers AS cust
WHERE cust.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12214 | train |
v2 | Schema:
tasks (alias: tsk)(status, salary, date, value)
categories(date, salary, amount, name)
Task: Find salary from tasks where a matching record exists in categories with the same level.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_12215 | train |
v2 | Schema:
categories (alias: catg)(date, value, type, name)
invoices(type, id, code, value)
Task: Retrieve value from categories that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12216 | train |
v1 | Schema:
categories (alias: catg)(amount, name, code, value)
projects(date, value, type, amount)
Task: Select salary from categories where type exists in projects for the same level.
SQL: | SELECT salary FROM categories AS catg
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12217 | train |
v2 | Schema:
managers (alias: mgr)(name, type, id, code)
projects(amount, code, level, value)
Task: Retrieve value from managers that have at least one corresponding entry in projects sharing the same type.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12218 | train |
v3 | Schema:
accounts (alias: acct)(type, code, status, id)
schedules(amount, salary, status, type)
Task: Find amount from accounts where salary exceeds the count of amount from schedules for the same status.
SQL: | SELECT amount FROM accounts AS acct
WHERE salary > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12219 | train |
v1 | Schema:
departments (alias: dept)(status, salary, type, code)
items(level, date, code, amount)
Task: Select name from departments where status exists in items for the same level.
SQL: | SELECT name FROM departments AS dept
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12220 | train |
v3 | Schema:
accounts (alias: acct)(value, type, salary, level)
orders(type, id, code, amount)
Task: Find salary from accounts where amount exceeds the count of salary from orders for the same level.
SQL: | SELECT salary FROM accounts AS acct
WHERE amount > (
SELECT COUNT(salary) FROM orders AS ord
WHERE ord.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12221 | train |
v2 | Schema:
products (alias: prod)(code, status, amount, value)
departments(status, date, level, code)
Task: Find value from products where a matching record exists in departments with the same id.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = prod.id
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12222 | train |
v2 | Schema:
schedules (alias: schd)(name, code, id, amount)
staff(name, id, level, code)
Task: Find salary from schedules where a matching record exists in staff with the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12223 | train |
v3 | Schema:
branches (alias: brc)(code, value, level, type)
managers(salary, id, name, type)
Task: Find salary from branches where value exceeds the minimum amount from managers for the same status.
SQL: | SELECT salary FROM branches AS brc
WHERE value > (
SELECT MIN(amount) FROM managers AS mgr
WHERE mgr.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "managers",
"outer_alias": "brc",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12224 | train |
v1 | Schema:
transactions (alias: txn)(date, value, level, salary)
customers(code, level, id, type)
Task: Find salary from transactions where code appears in customers entries with matching code.
SQL: | SELECT salary FROM transactions AS txn
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12225 | train |
v3 | Schema:
categories (alias: catg)(name, value, level, code)
schedules(type, date, amount, value)
Task: Retrieve name from categories with salary above the COUNT(value) of schedules rows sharing the same code.
SQL: | SELECT name FROM categories AS catg
WHERE salary > (
SELECT COUNT(value) FROM schedules AS schd
WHERE schd.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12226 | train |
v3 | Schema:
staff (alias: empl)(date, status, id, value)
items(status, salary, type, date)
Task: Find amount from staff where salary exceeds the average value from items for the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE salary > (
SELECT AVG(value) FROM items AS lne
WHERE lne.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_12227 | train |
v3 | Schema:
orders (alias: ord)(type, date, status, level)
tasks(salary, id, name, level)
Task: Retrieve code from orders with amount above the COUNT(salary) of tasks rows sharing the same code.
SQL: | SELECT code FROM orders AS ord
WHERE amount > (
SELECT COUNT(salary) FROM tasks AS tsk
WHERE tsk.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12228 | train |
v1 | Schema:
invoices (alias: inv)(type, amount, date, id)
products(level, code, amount, value)
Task: Select id from invoices where code exists in products for the same code.
SQL: | SELECT id FROM invoices AS inv
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12229 | train |
v2 | Schema:
sales (alias: sale)(code, value, status, type)
accounts(status, name, id, date)
Task: Find code from sales where a matching record exists in accounts with the same level.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12230 | train |
v1 | Schema:
departments (alias: dept)(type, code, value, id)
products(id, value, amount, code)
Task: Find salary from departments where code appears in products entries with matching id.
SQL: | SELECT salary FROM departments AS dept
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12231 | train |
v2 | Schema:
categories (alias: catg)(salary, status, id, code)
customers(code, status, value, name)
Task: Find amount from categories where a matching record exists in customers with the same code.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12232 | train |
v2 | Schema:
customers (alias: cust)(amount, salary, status, id)
invoices(code, id, amount, salary)
Task: Find name from customers where a matching record exists in invoices with the same status.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12233 | train |
v1 | Schema:
customers (alias: cust)(status, name, value, level)
categories(type, amount, value, name)
Task: Select name from customers where level exists in categories for the same type.
SQL: | SELECT name FROM customers AS cust
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12234 | train |
v2 | Schema:
products (alias: prod)(type, level, status, date)
departments(status, level, code, salary)
Task: Find amount from products where a matching record exists in departments with the same level.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = prod.level
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12235 | train |
v1 | Schema:
products (alias: prod)(type, salary, status, code)
staff(amount, level, date, code)
Task: Select salary from products where id exists in staff for the same level.
SQL: | SELECT salary FROM products AS prod
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.level = prod.level
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12236 | train |
v1 | Schema:
requests (alias: ordr)(id, type, level, date)
invoices(level, type, value, amount)
Task: Select salary from requests where type exists in invoices for the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12237 | train |
v1 | Schema:
staff (alias: empl)(status, salary, type, value)
shipments(id, name, date, amount)
Task: Select amount from staff where code exists in shipments for the same type.
SQL: | SELECT amount FROM staff AS empl
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_12238 | train |
v1 | Schema:
items (alias: lne)(value, status, type, salary)
schedules(type, name, date, level)
Task: Find code from items where code appears in schedules entries with matching code.
SQL: | SELECT code FROM items AS lne
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.code = lne.code
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12239 | train |
v3 | Schema:
categories (alias: catg)(date, type, name, id)
employees(status, amount, type, name)
Task: Retrieve id from categories with salary above the MIN(value) of employees rows sharing the same id.
SQL: | SELECT id FROM categories AS catg
WHERE salary > (
SELECT MIN(value) FROM employees AS emp
WHERE emp.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12240 | train |
v3 | Schema:
items (alias: lne)(date, status, salary, value)
schedules(code, status, amount, salary)
Task: Find amount from items where amount exceeds the total value from schedules for the same type.
SQL: | SELECT amount FROM items AS lne
WHERE amount > (
SELECT SUM(value) FROM schedules AS schd
WHERE schd.type = lne.type
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12241 | train |
v2 | Schema:
projects (alias: prj)(level, value, amount, type)
managers(status, id, code, type)
Task: Retrieve salary from projects that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_12242 | train |
v3 | Schema:
items (alias: lne)(salary, id, date, name)
schedules(code, type, status, level)
Task: Retrieve code from items with value above the SUM(salary) of schedules rows sharing the same level.
SQL: | SELECT code FROM items AS lne
WHERE value > (
SELECT SUM(salary) FROM schedules AS schd
WHERE schd.level = lne.level
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12243 | train |
v2 | Schema:
projects (alias: prj)(code, status, name, amount)
regions(amount, type, name, value)
Task: Retrieve id from projects that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_12244 | train |
v1 | Schema:
tasks (alias: tsk)(salary, name, value, status)
shipments(value, level, name, salary)
Task: Find name from tasks where code appears in shipments entries with matching code.
SQL: | SELECT name FROM tasks AS tsk
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_12245 | train |
v3 | Schema:
branches (alias: brc)(type, status, value, code)
orders(type, salary, amount, code)
Task: Find code from branches where salary exceeds the average amount from orders for the same type.
SQL: | SELECT code FROM branches AS brc
WHERE salary > (
SELECT AVG(amount) FROM orders AS ord
WHERE ord.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12246 | train |
v3 | Schema:
branches (alias: brc)(id, code, level, amount)
sales(status, amount, salary, code)
Task: Retrieve code from branches with salary above the MIN(amount) of sales rows sharing the same type.
SQL: | SELECT code FROM branches AS brc
WHERE salary > (
SELECT MIN(amount) FROM sales AS sale
WHERE sale.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12247 | train |
v1 | Schema:
branches (alias: brc)(code, id, name, amount)
items(type, level, status, name)
Task: Select amount from branches where level exists in items for the same level.
SQL: | SELECT amount FROM branches AS brc
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12248 | train |
v2 | Schema:
tasks (alias: tsk)(date, code, level, type)
orders(type, date, code, id)
Task: Find salary from tasks where a matching record exists in orders with the same id.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_12249 | train |
v3 | Schema:
orders (alias: ord)(status, value, salary, date)
requests(amount, salary, code, status)
Task: Find salary from orders where amount exceeds the maximum salary from requests for the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE amount > (
SELECT MAX(salary) FROM requests AS ordr
WHERE ordr.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12250 | train |
v2 | Schema:
branches (alias: brc)(code, id, type, salary)
projects(type, code, name, value)
Task: Find value from branches where a matching record exists in projects with the same id.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12251 | train |
v3 | Schema:
transactions (alias: txn)(id, amount, type, date)
branches(date, level, salary, amount)
Task: Retrieve code from transactions with value above the COUNT(value) of branches rows sharing the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE value > (
SELECT COUNT(value) FROM branches AS brc
WHERE brc.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12252 | train |
v1 | Schema:
managers (alias: mgr)(value, type, level, status)
tasks(value, amount, date, level)
Task: Find amount from managers where level appears in tasks entries with matching level.
SQL: | SELECT amount FROM managers AS mgr
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12253 | train |
v1 | Schema:
departments (alias: dept)(salary, date, name, status)
schedules(code, name, type, level)
Task: Select name from departments where id exists in schedules for the same status.
SQL: | SELECT name FROM departments AS dept
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12254 | train |
v3 | Schema:
invoices (alias: inv)(amount, name, date, salary)
managers(date, amount, name, id)
Task: Find amount from invoices where amount exceeds the total value from managers for the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE amount > (
SELECT SUM(value) FROM managers AS mgr
WHERE mgr.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12255 | train |
v3 | Schema:
employees (alias: emp)(status, level, date, value)
managers(amount, id, level, salary)
Task: Find id from employees where amount exceeds the maximum amount from managers for the same code.
SQL: | SELECT id FROM employees AS emp
WHERE amount > (
SELECT MAX(amount) FROM managers AS mgr
WHERE mgr.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12256 | train |
v2 | Schema:
invoices (alias: inv)(level, code, salary, type)
categories(date, type, code, value)
Task: Retrieve name from invoices that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12257 | train |
v3 | Schema:
projects (alias: prj)(id, salary, level, type)
regions(code, amount, salary, name)
Task: Find value from projects where amount exceeds the count of value from regions for the same id.
SQL: | SELECT value FROM projects AS prj
WHERE amount > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_12258 | train |
v3 | Schema:
categories (alias: catg)(value, amount, status, code)
items(id, salary, date, name)
Task: Retrieve amount from categories with value above the COUNT(amount) of items rows sharing the same type.
SQL: | SELECT amount FROM categories AS catg
WHERE value > (
SELECT COUNT(amount) FROM items AS lne
WHERE lne.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12259 | train |
v3 | Schema:
requests (alias: ordr)(code, type, status, value)
transactions(name, status, date, value)
Task: Retrieve value from requests with value above the MAX(value) of transactions rows sharing the same level.
SQL: | SELECT value FROM requests AS ordr
WHERE value > (
SELECT MAX(value) FROM transactions AS txn
WHERE txn.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12260 | train |
v3 | Schema:
sales (alias: sale)(id, status, level, name)
employees(id, salary, date, type)
Task: Find amount from sales where salary exceeds the maximum amount from employees for the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE salary > (
SELECT MAX(amount) FROM employees AS emp
WHERE emp.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12261 | train |
v3 | Schema:
schedules (alias: schd)(type, code, amount, value)
transactions(amount, date, salary, value)
Task: Find salary from schedules where salary exceeds the average salary from transactions for the same id.
SQL: | SELECT salary FROM schedules AS schd
WHERE salary > (
SELECT AVG(salary) FROM transactions AS txn
WHERE txn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12262 | train |
v2 | Schema:
categories (alias: catg)(status, id, date, amount)
employees(level, amount, value, id)
Task: Find value from categories where a matching record exists in employees with the same type.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12263 | train |
v2 | Schema:
categories (alias: catg)(code, status, level, date)
sales(name, date, level, code)
Task: Retrieve value from categories that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12264 | train |
v2 | Schema:
employees (alias: emp)(date, salary, amount, id)
shipments(salary, date, amount, name)
Task: Retrieve code from employees that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12265 | train |
v3 | Schema:
products (alias: prod)(id, code, value, type)
accounts(type, amount, code, salary)
Task: Find amount from products where value exceeds the minimum salary from accounts for the same id.
SQL: | SELECT amount FROM products AS prod
WHERE value > (
SELECT MIN(salary) FROM accounts AS acct
WHERE acct.id = prod.id
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12266 | train |
v1 | Schema:
branches (alias: brc)(id, salary, name, code)
regions(code, id, value, status)
Task: Retrieve name from branches whose status is found in regions rows where type matches the outer record.
SQL: | SELECT name FROM branches AS brc
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12267 | train |
v3 | Schema:
employees (alias: emp)(amount, name, salary, date)
departments(status, level, amount, code)
Task: Retrieve code from employees with value above the COUNT(amount) of departments rows sharing the same status.
SQL: | SELECT code FROM employees AS emp
WHERE value > (
SELECT COUNT(amount) FROM departments AS dept
WHERE dept.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12268 | train |
v2 | Schema:
transactions (alias: txn)(code, value, name, date)
schedules(id, status, code, amount)
Task: Retrieve id from transactions that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12269 | train |
v1 | Schema:
managers (alias: mgr)(name, type, amount, status)
products(status, date, salary, code)
Task: Select name from managers where code exists in products for the same code.
SQL: | SELECT name FROM managers AS mgr
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12270 | train |
v3 | Schema:
employees (alias: emp)(name, level, status, amount)
products(id, salary, value, amount)
Task: Retrieve code from employees with salary above the MAX(value) of products rows sharing the same level.
SQL: | SELECT code FROM employees AS emp
WHERE salary > (
SELECT MAX(value) FROM products AS prod
WHERE prod.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12271 | train |
v3 | Schema:
requests (alias: ordr)(salary, status, type, date)
transactions(amount, type, id, salary)
Task: Retrieve salary from requests with value above the MIN(value) of transactions rows sharing the same type.
SQL: | SELECT salary FROM requests AS ordr
WHERE value > (
SELECT MIN(value) FROM transactions AS txn
WHERE txn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12272 | train |
v2 | Schema:
sales (alias: sale)(level, id, amount, name)
tasks(name, level, status, salary)
Task: Retrieve code from sales that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12273 | train |
v3 | Schema:
tasks (alias: tsk)(value, name, code, salary)
categories(salary, code, type, amount)
Task: Retrieve amount from tasks with salary above the COUNT(salary) of categories rows sharing the same level.
SQL: | SELECT amount FROM tasks AS tsk
WHERE salary > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_12274 | train |
v1 | Schema:
staff (alias: empl)(value, status, amount, code)
sales(value, date, amount, status)
Task: Retrieve amount from staff whose status is found in sales rows where id matches the outer record.
SQL: | SELECT amount FROM staff AS empl
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_12275 | train |
v3 | Schema:
orders (alias: ord)(code, salary, value, date)
items(id, level, type, value)
Task: Retrieve id from orders with amount above the AVG(amount) of items rows sharing the same code.
SQL: | SELECT id FROM orders AS ord
WHERE amount > (
SELECT AVG(amount) FROM items AS lne
WHERE lne.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12276 | train |
v2 | Schema:
sales (alias: sale)(id, amount, type, salary)
managers(id, level, status, salary)
Task: Find name from sales where a matching record exists in managers with the same status.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12277 | train |
v1 | Schema:
orders (alias: ord)(name, type, amount, value)
regions(name, type, code, value)
Task: Retrieve code from orders whose status is found in regions rows where type matches the outer record.
SQL: | SELECT code FROM orders AS ord
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12278 | train |
v2 | Schema:
categories (alias: catg)(type, id, level, salary)
orders(code, status, amount, type)
Task: Retrieve name from categories that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12279 | train |
v1 | Schema:
tasks (alias: tsk)(value, code, name, status)
regions(id, amount, value, name)
Task: Find amount from tasks where type appears in regions entries with matching type.
SQL: | SELECT amount 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": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_12280 | train |
v1 | Schema:
tasks (alias: tsk)(status, name, id, amount)
requests(value, code, status, salary)
Task: Select salary from tasks where code exists in requests for the same code.
SQL: | SELECT salary FROM tasks AS tsk
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_12281 | train |
v2 | Schema:
invoices (alias: inv)(code, name, status, amount)
departments(name, status, amount, level)
Task: Find amount from invoices where a matching record exists in departments with the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12282 | train |
v3 | Schema:
requests (alias: ordr)(type, value, code, salary)
accounts(id, level, type, salary)
Task: Retrieve code from requests with salary above the SUM(salary) of accounts rows sharing the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE salary > (
SELECT SUM(salary) FROM accounts AS acct
WHERE acct.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12283 | train |
v3 | Schema:
customers (alias: cust)(type, code, level, id)
accounts(amount, salary, date, code)
Task: Retrieve name from customers with value above the COUNT(value) of accounts rows sharing the same level.
SQL: | SELECT name FROM customers AS cust
WHERE value > (
SELECT COUNT(value) FROM accounts AS acct
WHERE acct.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12284 | train |
v3 | Schema:
departments (alias: dept)(status, amount, salary, value)
products(name, value, code, id)
Task: Find salary from departments where value exceeds the maximum amount from products for the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE value > (
SELECT MAX(amount) FROM products AS prod
WHERE prod.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12285 | train |
v3 | Schema:
staff (alias: empl)(type, salary, value, code)
categories(name, code, date, value)
Task: Retrieve value from staff with salary above the MAX(value) of categories rows sharing the same code.
SQL: | SELECT value FROM staff AS empl
WHERE salary > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_12286 | train |
v1 | Schema:
branches (alias: brc)(salary, id, date, amount)
categories(code, name, type, salary)
Task: Select name from branches where code exists in categories for the same id.
SQL: | SELECT name FROM branches AS brc
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12287 | train |
v1 | Schema:
staff (alias: empl)(level, amount, type, date)
accounts(name, salary, value, level)
Task: Find code from staff where id appears in accounts entries with matching id.
SQL: | SELECT code FROM staff AS empl
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_12288 | train |
v3 | Schema:
managers (alias: mgr)(code, amount, level, date)
invoices(amount, code, date, id)
Task: Find salary from managers where amount exceeds the maximum value from invoices for the same id.
SQL: | SELECT salary FROM managers AS mgr
WHERE amount > (
SELECT MAX(value) FROM invoices AS inv
WHERE inv.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12289 | train |
v1 | Schema:
orders (alias: ord)(amount, date, type, salary)
managers(id, salary, status, name)
Task: Find salary from orders where id appears in managers entries with matching type.
SQL: | SELECT salary FROM orders AS ord
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12290 | train |
v2 | Schema:
accounts (alias: acct)(id, code, type, amount)
staff(code, salary, status, name)
Task: Retrieve amount from accounts that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12291 | train |
v2 | Schema:
tasks (alias: tsk)(id, amount, type, code)
products(level, code, value, id)
Task: Retrieve code from tasks that have at least one corresponding entry in products sharing the same status.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_12292 | train |
v1 | Schema:
employees (alias: emp)(amount, type, name, id)
staff(code, id, amount, name)
Task: Find amount from employees where level appears in staff entries with matching id.
SQL: | SELECT amount FROM employees AS emp
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12293 | train |
v2 | Schema:
projects (alias: prj)(name, type, level, id)
branches(value, id, salary, type)
Task: Retrieve code from projects that have at least one corresponding entry in branches sharing the same level.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_12294 | train |
v2 | Schema:
accounts (alias: acct)(amount, status, salary, id)
managers(status, name, value, salary)
Task: Find salary from accounts where a matching record exists in managers with the same level.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12295 | train |
v2 | Schema:
accounts (alias: acct)(level, salary, status, date)
projects(type, amount, value, date)
Task: Retrieve value from accounts that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12296 | train |
v3 | Schema:
departments (alias: dept)(date, id, status, amount)
customers(id, level, status, code)
Task: Retrieve code from departments with salary above the MIN(value) of customers rows sharing the same code.
SQL: | SELECT code FROM departments AS dept
WHERE salary > (
SELECT MIN(value) FROM customers AS cust
WHERE cust.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12297 | train |
v3 | Schema:
schedules (alias: schd)(name, type, value, date)
items(salary, level, id, status)
Task: Retrieve code from schedules with amount above the MAX(salary) of items rows sharing the same code.
SQL: | SELECT code FROM schedules AS schd
WHERE amount > (
SELECT MAX(salary) FROM items AS lne
WHERE lne.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12298 | train |
v1 | Schema:
orders (alias: ord)(id, date, type, salary)
requests(amount, date, id, value)
Task: Find amount from orders where id appears in requests entries with matching level.
SQL: | SELECT amount FROM orders AS ord
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12299 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.