variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v1 | Schema:
shipments (alias: shp)(level, name, type, code)
tasks(type, date, amount, code)
Task: Select amount from shipments where type exists in tasks for the same code.
SQL: | SELECT amount FROM shipments AS shp
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07200 | train |
v1 | Schema:
invoices (alias: inv)(salary, status, date, amount)
employees(name, amount, status, type)
Task: Find salary from invoices where type appears in employees entries with matching level.
SQL: | SELECT salary FROM invoices AS inv
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07201 | train |
v1 | Schema:
orders (alias: ord)(id, date, type, name)
invoices(type, salary, status, level)
Task: Retrieve code from orders whose level is found in invoices rows where status matches the outer record.
SQL: | SELECT code FROM orders AS ord
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07202 | train |
v2 | Schema:
projects (alias: prj)(amount, date, salary, value)
employees(value, level, code, amount)
Task: Retrieve name from projects that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07203 | train |
v2 | Schema:
shipments (alias: shp)(code, type, status, name)
tasks(type, code, id, value)
Task: Retrieve name from shipments that have at least one corresponding entry in tasks sharing the same code.
SQL: | SELECT name 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": "name",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07204 | train |
v2 | Schema:
invoices (alias: inv)(name, salary, code, level)
managers(name, code, level, id)
Task: Find value from invoices where a matching record exists in managers with the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07205 | train |
v3 | Schema:
customers (alias: cust)(id, status, date, value)
products(date, type, value, status)
Task: Find value from customers where amount exceeds the minimum amount from products for the same level.
SQL: | SELECT value FROM customers AS cust
WHERE amount > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07206 | train |
v2 | Schema:
accounts (alias: acct)(amount, type, id, code)
regions(status, value, level, id)
Task: Find amount from accounts where a matching record exists in regions with the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07207 | train |
v1 | Schema:
branches (alias: brc)(type, level, code, status)
regions(status, name, code, amount)
Task: Select id from branches where level exists in regions for the same level.
SQL: | SELECT id FROM branches AS brc
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07208 | train |
v2 | Schema:
customers (alias: cust)(salary, type, name, value)
accounts(level, id, type, code)
Task: Find amount from customers where a matching record exists in accounts with the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07209 | train |
v1 | Schema:
orders (alias: ord)(name, amount, value, id)
invoices(amount, name, level, salary)
Task: Find name from orders where id appears in invoices entries with matching status.
SQL: | SELECT name FROM orders AS ord
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07210 | train |
v1 | Schema:
tasks (alias: tsk)(amount, code, salary, level)
sales(value, name, salary, type)
Task: Select amount from tasks where id exists in sales for the same level.
SQL: | SELECT amount FROM tasks AS tsk
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07211 | train |
v2 | Schema:
categories (alias: catg)(status, salary, name, type)
customers(date, amount, code, value)
Task: Retrieve name from categories that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07212 | train |
v1 | Schema:
branches (alias: brc)(salary, amount, code, level)
categories(status, type, code, value)
Task: Select value from branches where id exists in categories for the same level.
SQL: | SELECT value FROM branches AS brc
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07213 | train |
v1 | Schema:
requests (alias: ordr)(type, amount, salary, value)
shipments(id, name, code, value)
Task: Select amount from requests where id exists in shipments for the same level.
SQL: | SELECT amount FROM requests AS ordr
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07214 | train |
v1 | Schema:
departments (alias: dept)(amount, value, code, id)
requests(level, id, name, type)
Task: Find amount from departments where code appears in requests entries with matching type.
SQL: | SELECT amount FROM departments AS dept
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07215 | train |
v2 | Schema:
requests (alias: ordr)(value, salary, amount, id)
orders(salary, id, status, type)
Task: Retrieve salary from requests that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07216 | train |
v3 | Schema:
customers (alias: cust)(type, value, name, amount)
departments(id, code, status, value)
Task: Retrieve salary from customers with salary above the MAX(value) of departments rows sharing the same id.
SQL: | SELECT salary FROM customers AS cust
WHERE salary > (
SELECT MAX(value) FROM departments AS dept
WHERE dept.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07217 | train |
v2 | Schema:
categories (alias: catg)(amount, name, status, salary)
items(salary, code, type, amount)
Task: Retrieve code from categories that have at least one corresponding entry in items sharing the same code.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07218 | train |
v2 | Schema:
orders (alias: ord)(salary, value, level, amount)
projects(status, id, amount, date)
Task: Retrieve value from orders that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07219 | train |
v2 | Schema:
departments (alias: dept)(name, type, date, id)
sales(id, salary, code, value)
Task: Retrieve salary from departments that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07220 | train |
v3 | Schema:
customers (alias: cust)(type, level, amount, date)
categories(value, code, salary, name)
Task: Retrieve value from customers with salary above the COUNT(salary) of categories rows sharing the same level.
SQL: | SELECT value FROM customers AS cust
WHERE salary > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07221 | train |
v1 | Schema:
sales (alias: sale)(status, type, date, amount)
employees(type, salary, level, name)
Task: Select amount from sales where type exists in employees for the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE type IN (
SELECT type 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": "type",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07222 | train |
v3 | Schema:
customers (alias: cust)(value, code, date, status)
accounts(level, type, code, status)
Task: Retrieve salary from customers with amount above the MIN(value) of accounts rows sharing the same status.
SQL: | SELECT salary FROM customers AS cust
WHERE amount > (
SELECT MIN(value) FROM accounts AS acct
WHERE acct.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07223 | train |
v1 | Schema:
tasks (alias: tsk)(amount, value, name, type)
schedules(value, name, amount, code)
Task: Select code from tasks where level exists in schedules for the same code.
SQL: | SELECT code FROM tasks AS tsk
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07224 | train |
v1 | Schema:
products (alias: prod)(level, id, name, type)
invoices(status, date, code, id)
Task: Retrieve salary from products whose level is found in invoices rows where code matches the outer record.
SQL: | SELECT salary FROM products AS prod
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.code = prod.code
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07225 | train |
v1 | Schema:
tasks (alias: tsk)(salary, name, id, level)
departments(date, name, status, code)
Task: Select salary from tasks where code exists in departments for the same type.
SQL: | SELECT salary FROM tasks AS tsk
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "tsk",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07226 | train |
v3 | Schema:
items (alias: lne)(status, type, name, amount)
products(level, type, code, salary)
Task: Find name from items where value exceeds the total salary from products for the same level.
SQL: | SELECT name FROM items AS lne
WHERE value > (
SELECT SUM(salary) FROM products AS prod
WHERE prod.level = lne.level
); | {
"outer_table": "items",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "prod",
"proj_col": "name",
"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_07227 | train |
v2 | Schema:
staff (alias: empl)(name, type, amount, salary)
orders(code, status, amount, type)
Task: Find salary from staff where a matching record exists in orders with the same status.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07228 | train |
v2 | Schema:
categories (alias: catg)(status, type, salary, amount)
tasks(level, id, date, status)
Task: Find id from categories where a matching record exists in tasks with the same code.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07229 | train |
v3 | Schema:
sales (alias: sale)(amount, status, name, date)
managers(code, type, date, status)
Task: Find salary from sales where value exceeds the count of amount from managers for the same code.
SQL: | SELECT salary FROM sales AS sale
WHERE value > (
SELECT COUNT(amount) FROM managers AS mgr
WHERE mgr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07230 | train |
v2 | Schema:
accounts (alias: acct)(type, name, date, amount)
employees(date, code, value, status)
Task: Find salary from accounts where a matching record exists in employees with the same status.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07231 | train |
v2 | Schema:
regions (alias: rgn)(date, status, value, salary)
customers(amount, salary, status, id)
Task: Retrieve value from regions that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07232 | train |
v2 | Schema:
regions (alias: rgn)(name, type, value, level)
departments(amount, id, salary, type)
Task: Find name from regions where a matching record exists in departments with the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07233 | train |
v2 | Schema:
staff (alias: empl)(type, level, code, salary)
transactions(type, value, level, salary)
Task: Find name from staff where a matching record exists in transactions with the same id.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07234 | train |
v1 | Schema:
departments (alias: dept)(id, value, level, type)
sales(status, value, id, type)
Task: Select name from departments where type exists in sales for the same status.
SQL: | SELECT name FROM departments AS dept
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07235 | train |
v2 | Schema:
projects (alias: prj)(name, value, amount, level)
schedules(name, amount, code, status)
Task: Find value from projects where a matching record exists in schedules with the same code.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "schedules",
"outer_alias": "prj",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07236 | train |
v3 | Schema:
departments (alias: dept)(salary, amount, level, id)
transactions(amount, name, code, level)
Task: Find name from departments where value exceeds the minimum value from transactions for the same type.
SQL: | SELECT name FROM departments AS dept
WHERE value > (
SELECT MIN(value) FROM transactions AS txn
WHERE txn.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07237 | train |
v1 | Schema:
departments (alias: dept)(name, value, date, salary)
staff(date, id, type, level)
Task: Retrieve salary from departments whose status is found in staff rows where id matches the outer record.
SQL: | SELECT salary FROM departments AS dept
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07238 | train |
v1 | Schema:
branches (alias: brc)(type, value, level, name)
employees(level, status, type, salary)
Task: Retrieve salary from branches whose id is found in employees rows where id matches the outer record.
SQL: | SELECT salary FROM branches AS brc
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07239 | train |
v2 | Schema:
tasks (alias: tsk)(date, amount, value, level)
invoices(code, salary, type, id)
Task: Retrieve name from tasks that have at least one corresponding entry in invoices sharing the same id.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07240 | train |
v2 | Schema:
accounts (alias: acct)(code, value, name, type)
categories(name, value, status, code)
Task: Find name from accounts where a matching record exists in categories with the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07241 | train |
v1 | Schema:
schedules (alias: schd)(amount, salary, status, date)
branches(status, type, date, value)
Task: Retrieve code from schedules whose type is found in branches rows where status matches the outer record.
SQL: | SELECT code FROM schedules AS schd
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07242 | train |
v3 | Schema:
employees (alias: emp)(name, salary, id, level)
staff(salary, name, date, amount)
Task: Find value from employees where salary exceeds the maximum value from staff for the same level.
SQL: | SELECT value FROM employees AS emp
WHERE salary > (
SELECT MAX(value) FROM staff AS empl
WHERE empl.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "value",
"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_07243 | train |
v1 | Schema:
branches (alias: brc)(name, amount, value, type)
orders(status, value, type, amount)
Task: Retrieve amount from branches whose status is found in orders rows where status matches the outer record.
SQL: | SELECT amount FROM branches AS brc
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07244 | train |
v3 | Schema:
projects (alias: prj)(name, amount, code, salary)
shipments(level, salary, date, amount)
Task: Find value from projects where value exceeds the count of salary from shipments for the same type.
SQL: | SELECT value FROM projects AS prj
WHERE value > (
SELECT COUNT(salary) FROM shipments AS shp
WHERE shp.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07245 | train |
v2 | Schema:
branches (alias: brc)(level, type, status, date)
items(type, value, level, status)
Task: Retrieve value from branches that have at least one corresponding entry in items sharing the same code.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07246 | train |
v2 | Schema:
regions (alias: rgn)(type, name, date, value)
employees(type, level, amount, status)
Task: Find amount from regions where a matching record exists in employees with the same status.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07247 | train |
v1 | Schema:
staff (alias: empl)(type, value, level, salary)
transactions(name, level, status, type)
Task: Retrieve code from staff whose id is found in transactions rows where status matches the outer record.
SQL: | SELECT code FROM staff AS empl
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07248 | train |
v2 | Schema:
schedules (alias: schd)(value, code, id, date)
staff(value, id, status, salary)
Task: Find name from schedules where a matching record exists in staff with the same type.
SQL: | SELECT name 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": "name",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07249 | train |
v2 | Schema:
items (alias: lne)(salary, code, type, id)
transactions(value, name, status, type)
Task: Find code from items where a matching record exists in transactions with the same level.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07250 | train |
v1 | Schema:
customers (alias: cust)(status, type, date, level)
shipments(code, id, salary, level)
Task: Retrieve value from customers whose id is found in shipments rows where id matches the outer record.
SQL: | SELECT value FROM customers AS cust
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07251 | train |
v3 | Schema:
employees (alias: emp)(status, id, value, level)
departments(amount, status, salary, level)
Task: Retrieve value from employees with salary above the AVG(value) of departments rows sharing the same level.
SQL: | SELECT value FROM employees AS emp
WHERE salary > (
SELECT AVG(value) FROM departments AS dept
WHERE dept.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07252 | train |
v2 | Schema:
sales (alias: sale)(value, salary, amount, level)
customers(status, level, type, name)
Task: Retrieve salary from sales that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07253 | train |
v2 | Schema:
products (alias: prod)(code, salary, value, level)
sales(code, type, name, date)
Task: Find name from products where a matching record exists in sales with the same code.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = prod.code
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07254 | train |
v1 | Schema:
requests (alias: ordr)(value, id, salary, level)
sales(code, id, value, date)
Task: Retrieve salary from requests whose status is found in sales rows where level matches the outer record.
SQL: | SELECT salary FROM requests AS ordr
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07255 | train |
v1 | Schema:
transactions (alias: txn)(status, name, salary, value)
categories(amount, level, date, status)
Task: Select name from transactions where code exists in categories for the same level.
SQL: | SELECT name FROM transactions AS txn
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07256 | train |
v3 | Schema:
branches (alias: brc)(salary, level, id, value)
orders(name, id, date, level)
Task: Find salary from branches where amount exceeds the minimum salary from orders for the same code.
SQL: | SELECT salary FROM branches AS brc
WHERE amount > (
SELECT MIN(salary) FROM orders AS ord
WHERE ord.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07257 | train |
v1 | Schema:
schedules (alias: schd)(level, id, type, status)
categories(code, status, value, amount)
Task: Select name from schedules where status exists in categories for the same id.
SQL: | SELECT name FROM schedules AS schd
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07258 | train |
v1 | Schema:
regions (alias: rgn)(value, level, type, salary)
projects(date, status, value, code)
Task: Retrieve id from regions whose type is found in projects rows where status matches the outer record.
SQL: | SELECT id FROM regions AS rgn
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07259 | train |
v2 | Schema:
branches (alias: brc)(value, salary, code, status)
accounts(code, amount, level, value)
Task: Retrieve id from branches that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "accounts",
"outer_alias": "brc",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07260 | train |
v2 | Schema:
invoices (alias: inv)(name, id, date, amount)
departments(date, type, level, name)
Task: Find salary from invoices where a matching record exists in departments with the same level.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07261 | train |
v3 | Schema:
sales (alias: sale)(name, amount, salary, status)
projects(id, status, date, level)
Task: Find salary from sales where value exceeds the count of salary from projects for the same code.
SQL: | SELECT salary FROM sales AS sale
WHERE value > (
SELECT COUNT(salary) FROM projects AS prj
WHERE prj.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07262 | train |
v1 | Schema:
sales (alias: sale)(salary, type, level, status)
accounts(date, salary, id, level)
Task: Find id from sales where level appears in accounts entries with matching level.
SQL: | SELECT id FROM sales AS sale
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07263 | train |
v2 | Schema:
managers (alias: mgr)(date, name, type, salary)
invoices(type, code, value, status)
Task: Retrieve name from managers that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07264 | train |
v3 | Schema:
departments (alias: dept)(salary, value, amount, level)
categories(id, code, name, status)
Task: Find amount from departments where value exceeds the count of value from categories for the same level.
SQL: | SELECT amount FROM departments AS dept
WHERE value > (
SELECT COUNT(value) FROM categories AS catg
WHERE catg.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07265 | train |
v2 | Schema:
invoices (alias: inv)(name, level, value, date)
projects(date, level, salary, code)
Task: Retrieve value from invoices that have at least one corresponding entry in projects sharing the same id.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07266 | train |
v1 | Schema:
tasks (alias: tsk)(code, value, name, amount)
sales(level, type, code, date)
Task: Find amount from tasks where status appears in sales entries with matching level.
SQL: | SELECT amount FROM tasks AS tsk
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07267 | train |
v2 | Schema:
invoices (alias: inv)(level, code, salary, status)
employees(level, name, code, value)
Task: Retrieve name from invoices that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07268 | train |
v2 | Schema:
projects (alias: prj)(amount, salary, type, status)
tasks(type, value, name, status)
Task: Retrieve name from projects that have at least one corresponding entry in tasks sharing the same level.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "prj",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07269 | train |
v3 | Schema:
items (alias: lne)(code, salary, value, level)
tasks(salary, date, code, level)
Task: Retrieve name from items with salary above the MAX(value) of tasks rows sharing the same status.
SQL: | SELECT name FROM items AS lne
WHERE salary > (
SELECT MAX(value) FROM tasks AS tsk
WHERE tsk.status = lne.status
); | {
"outer_table": "items",
"inner_table": "tasks",
"outer_alias": "lne",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07270 | train |
v2 | Schema:
categories (alias: catg)(date, name, code, status)
regions(salary, status, value, date)
Task: Retrieve salary from categories that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07271 | train |
v2 | Schema:
products (alias: prod)(type, level, code, status)
orders(level, status, salary, date)
Task: Retrieve code from products that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = prod.type
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07272 | train |
v3 | Schema:
regions (alias: rgn)(id, date, value, type)
managers(level, amount, code, name)
Task: Find amount from regions where amount exceeds the maximum salary from managers for the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE amount > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07273 | train |
v1 | Schema:
customers (alias: cust)(code, value, amount, salary)
regions(name, amount, salary, level)
Task: Retrieve code from customers whose id is found in regions rows where status matches the outer record.
SQL: | SELECT code FROM customers AS cust
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07274 | train |
v3 | Schema:
sales (alias: sale)(date, id, salary, code)
requests(code, date, name, value)
Task: Find id from sales where salary exceeds the minimum amount from requests for the same id.
SQL: | SELECT id FROM sales AS sale
WHERE salary > (
SELECT MIN(amount) FROM requests AS ordr
WHERE ordr.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07275 | train |
v3 | Schema:
orders (alias: ord)(type, amount, salary, id)
products(code, name, salary, value)
Task: Find name from orders where value exceeds the total amount from products for the same id.
SQL: | SELECT name FROM orders AS ord
WHERE value > (
SELECT SUM(amount) FROM products AS prod
WHERE prod.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07276 | train |
v2 | Schema:
invoices (alias: inv)(salary, value, date, id)
schedules(status, name, value, amount)
Task: Find salary from invoices where a matching record exists in schedules with the same status.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07277 | train |
v3 | Schema:
branches (alias: brc)(level, salary, code, type)
orders(name, date, type, value)
Task: Find id from branches where salary exceeds the maximum salary from orders for the same status.
SQL: | SELECT id FROM branches AS brc
WHERE salary > (
SELECT MAX(salary) FROM orders AS ord
WHERE ord.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07278 | train |
v2 | Schema:
departments (alias: dept)(type, amount, id, name)
projects(date, code, id, name)
Task: Retrieve amount from departments that have at least one corresponding entry in projects sharing the same type.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07279 | train |
v3 | Schema:
categories (alias: catg)(date, status, salary, id)
staff(type, code, status, value)
Task: Find amount from categories where value exceeds the total value from staff for the same status.
SQL: | SELECT amount FROM categories AS catg
WHERE value > (
SELECT SUM(value) FROM staff AS empl
WHERE empl.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07280 | train |
v2 | Schema:
branches (alias: brc)(type, amount, status, level)
requests(status, amount, name, level)
Task: Find code from branches where a matching record exists in requests with the same type.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07281 | train |
v2 | Schema:
branches (alias: brc)(id, code, name, type)
departments(code, type, amount, id)
Task: Find id from branches where a matching record exists in departments with the same level.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "departments",
"outer_alias": "brc",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07282 | train |
v2 | Schema:
branches (alias: brc)(value, salary, amount, name)
transactions(value, id, date, amount)
Task: Retrieve salary from branches that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "transactions",
"outer_alias": "brc",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07283 | train |
v1 | Schema:
orders (alias: ord)(value, type, level, code)
products(level, value, salary, date)
Task: Retrieve amount from orders whose type is found in products rows where type matches the outer record.
SQL: | SELECT amount FROM orders AS ord
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07284 | train |
v1 | Schema:
accounts (alias: acct)(name, status, type, salary)
requests(id, date, code, status)
Task: Select code from accounts where status exists in requests for the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07285 | train |
v1 | Schema:
shipments (alias: shp)(status, amount, code, level)
employees(level, id, value, amount)
Task: Select amount from shipments where code exists in employees for the same type.
SQL: | SELECT amount FROM shipments AS shp
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07286 | train |
v1 | Schema:
requests (alias: ordr)(status, date, type, salary)
customers(date, name, status, id)
Task: Retrieve name from requests whose code is found in customers rows where code matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07287 | train |
v1 | Schema:
managers (alias: mgr)(value, salary, id, code)
employees(type, amount, status, salary)
Task: Retrieve code from managers whose id is found in employees rows where level matches the outer record.
SQL: | SELECT code FROM managers AS mgr
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07288 | train |
v3 | Schema:
managers (alias: mgr)(salary, value, date, id)
regions(salary, value, name, status)
Task: Find name from managers where salary exceeds the minimum salary from regions for the same code.
SQL: | SELECT name FROM managers AS mgr
WHERE salary > (
SELECT MIN(salary) FROM regions AS rgn
WHERE rgn.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07289 | train |
v1 | Schema:
customers (alias: cust)(type, level, status, value)
requests(value, name, date, level)
Task: Select code from customers where code exists in requests for the same code.
SQL: | SELECT code FROM customers AS cust
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07290 | train |
v2 | Schema:
requests (alias: ordr)(amount, code, value, type)
staff(amount, status, type, name)
Task: Find amount from requests where a matching record exists in staff with the same level.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07291 | train |
v2 | Schema:
staff (alias: empl)(name, id, amount, level)
projects(date, id, level, status)
Task: Retrieve value from staff that have at least one corresponding entry in projects sharing the same level.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07292 | train |
v1 | Schema:
tasks (alias: tsk)(value, date, code, amount)
customers(salary, status, id, value)
Task: Retrieve code from tasks whose id is found in customers rows where id matches the outer record.
SQL: | SELECT code FROM tasks AS tsk
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "tsk",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07293 | train |
v2 | Schema:
projects (alias: prj)(status, salary, level, type)
sales(date, name, level, value)
Task: Retrieve id from projects that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT id 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": "id",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07294 | train |
v2 | Schema:
requests (alias: ordr)(code, date, status, name)
products(type, status, amount, level)
Task: Find value from requests where a matching record exists in products with the same status.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07295 | train |
v2 | Schema:
customers (alias: cust)(level, value, type, id)
requests(level, type, status, date)
Task: Retrieve name from customers that have at least one corresponding entry in requests sharing the same id.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07296 | train |
v1 | Schema:
departments (alias: dept)(salary, id, value, type)
accounts(status, level, amount, date)
Task: Select name from departments where status exists in accounts for the same type.
SQL: | SELECT name FROM departments AS dept
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07297 | train |
v1 | Schema:
sales (alias: sale)(id, name, type, status)
categories(level, date, id, amount)
Task: Select amount from sales where level exists in categories for the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07298 | train |
v3 | Schema:
departments (alias: dept)(amount, level, code, value)
regions(status, name, code, level)
Task: Retrieve name from departments with amount above the COUNT(amount) of regions rows sharing the same type.
SQL: | SELECT name FROM departments AS dept
WHERE amount > (
SELECT COUNT(amount) FROM regions AS rgn
WHERE rgn.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07299 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.