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:
employees (alias: emp)(date, type, value, amount)
sales(code, name, date, value)
Task: Retrieve salary from employees whose id is found in sales rows where type matches the outer record.
SQL: | SELECT salary FROM employees AS emp
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09300 | train |
v1 | Schema:
transactions (alias: txn)(amount, date, type, value)
regions(name, code, id, amount)
Task: Retrieve salary from transactions whose status is found in regions rows where type matches the outer record.
SQL: | SELECT salary FROM transactions AS txn
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09301 | train |
v1 | Schema:
staff (alias: empl)(salary, code, amount, date)
requests(id, salary, date, status)
Task: Select code from staff where type exists in requests for the same level.
SQL: | SELECT code FROM staff AS empl
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_09302 | train |
v2 | Schema:
products (alias: prod)(status, value, type, salary)
staff(level, amount, value, date)
Task: Find name from products where a matching record exists in staff with the same level.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = prod.level
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09303 | train |
v3 | Schema:
departments (alias: dept)(value, code, status, date)
tasks(level, amount, name, code)
Task: Retrieve id from departments with value above the COUNT(value) of tasks rows sharing the same id.
SQL: | SELECT id FROM departments AS dept
WHERE value > (
SELECT COUNT(value) FROM tasks AS tsk
WHERE tsk.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09304 | train |
v3 | Schema:
shipments (alias: shp)(value, type, name, status)
categories(amount, level, value, code)
Task: Retrieve name from shipments with amount above the AVG(value) of categories rows sharing the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE amount > (
SELECT AVG(value) FROM categories AS catg
WHERE catg.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09305 | train |
v3 | Schema:
products (alias: prod)(salary, id, value, name)
staff(value, salary, code, name)
Task: Retrieve amount from products with value above the MIN(salary) of staff rows sharing the same code.
SQL: | SELECT amount FROM products AS prod
WHERE value > (
SELECT MIN(salary) FROM staff AS empl
WHERE empl.code = prod.code
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09306 | train |
v2 | Schema:
requests (alias: ordr)(name, level, salary, type)
tasks(status, amount, level, value)
Task: Retrieve value from requests that have at least one corresponding entry in tasks sharing the same code.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_09307 | train |
v1 | Schema:
orders (alias: ord)(value, date, code, id)
branches(value, amount, code, name)
Task: Find value from orders where code appears in branches entries with matching status.
SQL: | SELECT value FROM orders AS ord
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09308 | train |
v1 | Schema:
categories (alias: catg)(date, name, status, level)
products(amount, type, level, status)
Task: Find amount from categories where id appears in products entries with matching level.
SQL: | SELECT amount FROM categories AS catg
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09309 | train |
v3 | Schema:
requests (alias: ordr)(id, level, name, amount)
products(name, status, type, salary)
Task: Retrieve salary from requests with salary above the SUM(amount) of products rows sharing the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE salary > (
SELECT SUM(amount) FROM products AS prod
WHERE prod.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_09310 | train |
v2 | Schema:
orders (alias: ord)(id, amount, name, type)
tasks(amount, salary, id, value)
Task: Find name from orders where a matching record exists in tasks with the same code.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09311 | train |
v3 | Schema:
products (alias: prod)(salary, type, value, amount)
regions(name, salary, code, amount)
Task: Retrieve id from products with amount above the COUNT(salary) of regions rows sharing the same level.
SQL: | SELECT id FROM products AS prod
WHERE amount > (
SELECT COUNT(salary) FROM regions AS rgn
WHERE rgn.level = prod.level
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09312 | train |
v1 | Schema:
projects (alias: prj)(type, status, value, date)
shipments(id, type, value, salary)
Task: Retrieve code from projects whose id is found in shipments rows where type matches the outer record.
SQL: | SELECT code FROM projects AS prj
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_09313 | train |
v2 | Schema:
shipments (alias: shp)(value, id, salary, status)
categories(level, amount, status, value)
Task: Retrieve value from shipments that have at least one corresponding entry in categories sharing the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09314 | train |
v2 | Schema:
categories (alias: catg)(amount, level, date, value)
tasks(value, salary, date, amount)
Task: Find value from categories where a matching record exists in tasks with the same status.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09315 | train |
v2 | Schema:
departments (alias: dept)(value, id, name, salary)
orders(date, id, value, type)
Task: Find amount from departments where a matching record exists in orders with the same id.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09316 | train |
v1 | Schema:
regions (alias: rgn)(id, status, code, type)
categories(date, code, status, level)
Task: Select code from regions where status exists in categories for the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_09317 | train |
v2 | Schema:
shipments (alias: shp)(date, value, code, level)
sales(type, id, salary, name)
Task: Retrieve amount from shipments that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09318 | train |
v2 | Schema:
transactions (alias: txn)(amount, salary, date, id)
staff(name, level, type, salary)
Task: Retrieve value from transactions that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09319 | train |
v1 | Schema:
tasks (alias: tsk)(status, level, name, salary)
customers(date, code, value, status)
Task: Find code from tasks where status appears in customers entries with matching id.
SQL: | SELECT code FROM tasks AS tsk
WHERE status IN (
SELECT status 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": "status",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_09320 | train |
v1 | Schema:
items (alias: lne)(amount, salary, date, name)
invoices(amount, level, name, type)
Task: Retrieve salary from items whose type is found in invoices rows where id matches the outer record.
SQL: | SELECT salary FROM items AS lne
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.id = lne.id
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_09321 | train |
v2 | Schema:
invoices (alias: inv)(amount, date, type, code)
products(salary, level, code, type)
Task: Retrieve code from invoices that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09322 | train |
v1 | Schema:
products (alias: prod)(name, status, level, amount)
transactions(date, name, code, amount)
Task: Retrieve name from products whose id is found in transactions rows where id matches the outer record.
SQL: | SELECT name FROM products AS prod
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.id = prod.id
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09323 | train |
v1 | Schema:
invoices (alias: inv)(type, value, id, amount)
accounts(code, date, level, salary)
Task: Find name from invoices where code appears in accounts entries with matching status.
SQL: | SELECT name FROM invoices AS inv
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09324 | train |
v2 | Schema:
tasks (alias: tsk)(salary, amount, level, value)
projects(value, date, id, code)
Task: Retrieve id from tasks that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_09325 | train |
v1 | Schema:
shipments (alias: shp)(code, type, status, date)
branches(date, value, type, amount)
Task: Retrieve value from shipments whose code is found in branches rows where type matches the outer record.
SQL: | SELECT value FROM shipments AS shp
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09326 | train |
v3 | Schema:
transactions (alias: txn)(value, id, date, amount)
employees(code, name, date, value)
Task: Retrieve code from transactions with value above the MIN(amount) of employees rows sharing the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE value > (
SELECT MIN(amount) FROM employees AS emp
WHERE emp.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09327 | train |
v2 | Schema:
tasks (alias: tsk)(status, level, name, id)
requests(type, status, code, date)
Task: Find id from tasks where a matching record exists in requests with the same status.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_09328 | train |
v3 | Schema:
orders (alias: ord)(code, status, value, amount)
customers(name, amount, value, id)
Task: Retrieve value from orders with salary above the SUM(value) of customers rows sharing the same level.
SQL: | SELECT value FROM orders AS ord
WHERE salary > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09329 | train |
v3 | Schema:
accounts (alias: acct)(amount, code, date, status)
requests(date, level, value, amount)
Task: Retrieve salary from accounts with amount above the MAX(salary) of requests rows sharing the same id.
SQL: | SELECT salary FROM accounts AS acct
WHERE amount > (
SELECT MAX(salary) FROM requests AS ordr
WHERE ordr.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09330 | train |
v2 | Schema:
projects (alias: prj)(code, value, salary, name)
sales(value, id, amount, name)
Task: Find value from projects where a matching record exists in sales with the same level.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_09331 | train |
v2 | Schema:
schedules (alias: schd)(level, status, date, id)
employees(code, id, name, type)
Task: Find value from schedules where a matching record exists in employees with the same code.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09332 | train |
v2 | Schema:
shipments (alias: shp)(value, id, name, date)
projects(salary, date, id, status)
Task: Retrieve id from shipments that have at least one corresponding entry in projects sharing the same type.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09333 | train |
v1 | Schema:
orders (alias: ord)(salary, name, amount, type)
categories(name, amount, date, level)
Task: Select id from orders where type exists in categories for the same type.
SQL: | SELECT id FROM orders AS ord
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09334 | train |
v2 | Schema:
orders (alias: ord)(salary, date, id, level)
regions(status, type, date, amount)
Task: Find code from orders where a matching record exists in regions with the same status.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09335 | train |
v1 | Schema:
accounts (alias: acct)(name, level, value, id)
departments(amount, salary, level, code)
Task: Find code from accounts where type appears in departments entries with matching level.
SQL: | SELECT code FROM accounts AS acct
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09336 | train |
v1 | Schema:
invoices (alias: inv)(salary, id, name, level)
departments(name, level, salary, id)
Task: Select amount from invoices where type exists in departments for the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09337 | train |
v1 | Schema:
employees (alias: emp)(type, level, name, salary)
schedules(code, value, date, type)
Task: Find id from employees where level appears in schedules entries with matching type.
SQL: | SELECT id FROM employees AS emp
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09338 | train |
v2 | Schema:
items (alias: lne)(date, value, amount, name)
transactions(salary, id, amount, level)
Task: Find id from items where a matching record exists in transactions with the same status.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_09339 | train |
v1 | Schema:
shipments (alias: shp)(value, code, status, level)
projects(date, name, status, code)
Task: Retrieve name from shipments whose status is found in projects rows where type matches the outer record.
SQL: | SELECT name FROM shipments AS shp
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09340 | train |
v1 | Schema:
categories (alias: catg)(type, date, amount, status)
items(date, amount, salary, level)
Task: Find name from categories where level appears in items entries with matching id.
SQL: | SELECT name FROM categories AS catg
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09341 | train |
v1 | Schema:
employees (alias: emp)(level, amount, id, date)
sales(code, date, status, level)
Task: Find name from employees where id appears in sales entries with matching level.
SQL: | SELECT name FROM employees AS emp
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09342 | train |
v3 | Schema:
projects (alias: prj)(status, amount, value, level)
customers(level, status, amount, salary)
Task: Find salary from projects where salary exceeds the maximum value from customers for the same id.
SQL: | SELECT salary FROM projects AS prj
WHERE salary > (
SELECT MAX(value) FROM customers AS cust
WHERE cust.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "prj",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_09343 | train |
v3 | Schema:
departments (alias: dept)(value, level, name, status)
orders(status, level, amount, date)
Task: Find name from departments where amount exceeds the average salary from orders for the same type.
SQL: | SELECT name FROM departments AS dept
WHERE amount > (
SELECT AVG(salary) FROM orders AS ord
WHERE ord.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09344 | train |
v2 | Schema:
sales (alias: sale)(status, level, id, value)
branches(type, salary, code, amount)
Task: Retrieve code from sales that have at least one corresponding entry in branches sharing the same code.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "branches",
"outer_alias": "sale",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09345 | train |
v1 | Schema:
departments (alias: dept)(status, name, salary, type)
transactions(type, date, amount, code)
Task: Select id from departments where level exists in transactions for the same status.
SQL: | SELECT id FROM departments AS dept
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09346 | train |
v1 | Schema:
sales (alias: sale)(name, type, level, value)
schedules(amount, status, date, id)
Task: Retrieve value from sales whose status is found in schedules rows where type matches the outer record.
SQL: | SELECT value FROM sales AS sale
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09347 | train |
v3 | Schema:
requests (alias: ordr)(id, date, name, code)
departments(status, amount, id, date)
Task: Find salary from requests where salary exceeds the count of amount from departments for the same code.
SQL: | SELECT salary FROM requests AS ordr
WHERE salary > (
SELECT COUNT(amount) FROM departments AS dept
WHERE dept.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_09348 | train |
v3 | Schema:
sales (alias: sale)(salary, amount, status, level)
orders(id, type, value, amount)
Task: Find id from sales where amount exceeds the average amount from orders for the same level.
SQL: | SELECT id FROM sales AS sale
WHERE amount > (
SELECT AVG(amount) FROM orders AS ord
WHERE ord.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09349 | train |
v1 | Schema:
sales (alias: sale)(status, salary, amount, name)
categories(code, type, status, salary)
Task: Retrieve id from sales whose type is found in categories rows where id matches the outer record.
SQL: | SELECT id FROM sales AS sale
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09350 | train |
v2 | Schema:
customers (alias: cust)(code, salary, level, amount)
sales(type, value, date, id)
Task: Retrieve salary from customers that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09351 | train |
v1 | Schema:
branches (alias: brc)(date, level, status, salary)
tasks(code, amount, level, status)
Task: Retrieve name from branches whose type is found in tasks rows where status matches the outer record.
SQL: | SELECT name FROM branches AS brc
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_09352 | train |
v2 | Schema:
managers (alias: mgr)(id, amount, status, code)
staff(date, id, type, code)
Task: Find id from managers where a matching record exists in staff with the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09353 | train |
v2 | Schema:
requests (alias: ordr)(salary, id, date, level)
items(level, amount, value, code)
Task: Retrieve value from requests that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_09354 | train |
v2 | Schema:
invoices (alias: inv)(amount, salary, name, type)
categories(id, name, code, status)
Task: Find code from invoices where a matching record exists in categories with the same type.
SQL: | SELECT code 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": "code",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09355 | train |
v2 | Schema:
branches (alias: brc)(amount, level, code, id)
transactions(status, type, code, salary)
Task: Retrieve value from branches that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "transactions",
"outer_alias": "brc",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_09356 | train |
v3 | Schema:
customers (alias: cust)(amount, date, name, status)
employees(code, level, date, id)
Task: Find value from customers where amount exceeds the average amount from employees for the same type.
SQL: | SELECT value FROM customers AS cust
WHERE amount > (
SELECT AVG(amount) FROM employees AS emp
WHERE emp.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09357 | train |
v2 | Schema:
schedules (alias: schd)(level, amount, salary, code)
sales(status, id, amount, level)
Task: Retrieve name from schedules that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09358 | train |
v1 | Schema:
staff (alias: empl)(level, amount, date, value)
branches(value, id, type, salary)
Task: Retrieve code from staff whose code is found in branches rows where type matches the outer record.
SQL: | SELECT code FROM staff AS empl
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_09359 | train |
v1 | Schema:
transactions (alias: txn)(status, name, amount, code)
projects(id, status, date, value)
Task: Find name from transactions where status appears in projects entries with matching id.
SQL: | SELECT name FROM transactions AS txn
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09360 | train |
v2 | Schema:
sales (alias: sale)(salary, type, id, name)
invoices(id, level, date, amount)
Task: Retrieve name from sales that have at least one corresponding entry in invoices sharing the same id.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09361 | train |
v1 | Schema:
categories (alias: catg)(type, date, value, amount)
departments(date, amount, salary, status)
Task: Select salary from categories where code exists in departments for the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09362 | train |
v3 | Schema:
categories (alias: catg)(level, value, name, id)
accounts(id, date, status, amount)
Task: Find name from categories where amount exceeds the average value from accounts for the same type.
SQL: | SELECT name FROM categories AS catg
WHERE amount > (
SELECT AVG(value) FROM accounts AS acct
WHERE acct.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09363 | train |
v2 | Schema:
sales (alias: sale)(status, salary, name, id)
items(id, amount, value, status)
Task: Retrieve name from sales that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09364 | train |
v2 | Schema:
orders (alias: ord)(code, date, value, id)
managers(value, amount, id, name)
Task: Find id from orders where a matching record exists in managers with the same id.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09365 | train |
v3 | Schema:
categories (alias: catg)(date, code, name, id)
tasks(salary, value, status, id)
Task: Retrieve code from categories with value above the SUM(value) of tasks rows sharing the same type.
SQL: | SELECT code FROM categories AS catg
WHERE value > (
SELECT SUM(value) FROM tasks AS tsk
WHERE tsk.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09366 | train |
v3 | Schema:
managers (alias: mgr)(amount, code, value, id)
invoices(id, value, type, salary)
Task: Find id from managers where salary exceeds the maximum value from invoices for the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE salary > (
SELECT MAX(value) FROM invoices AS inv
WHERE inv.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09367 | train |
v3 | Schema:
customers (alias: cust)(value, code, level, amount)
branches(type, value, id, salary)
Task: Find code from customers where salary exceeds the maximum salary from branches for the same status.
SQL: | SELECT code FROM customers AS cust
WHERE salary > (
SELECT MAX(salary) FROM branches AS brc
WHERE brc.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "branches",
"outer_alias": "cust",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09368 | train |
v2 | Schema:
tasks (alias: tsk)(salary, amount, value, level)
shipments(salary, status, level, value)
Task: Find code from tasks where a matching record exists in shipments with the same id.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_09369 | train |
v1 | Schema:
accounts (alias: acct)(name, id, salary, code)
transactions(date, id, type, code)
Task: Select code from accounts where id exists in transactions for the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09370 | train |
v3 | Schema:
projects (alias: prj)(amount, type, status, code)
invoices(value, date, name, amount)
Task: Retrieve code from projects with value above the COUNT(amount) of invoices rows sharing the same id.
SQL: | SELECT code FROM projects AS prj
WHERE value > (
SELECT COUNT(amount) FROM invoices AS inv
WHERE inv.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_09371 | train |
v3 | Schema:
customers (alias: cust)(status, amount, type, name)
transactions(amount, type, status, date)
Task: Retrieve value from customers with value above the MAX(amount) of transactions rows sharing the same id.
SQL: | SELECT value FROM customers AS cust
WHERE value > (
SELECT MAX(amount) FROM transactions AS txn
WHERE txn.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09372 | train |
v2 | Schema:
sales (alias: sale)(type, date, name, level)
products(salary, code, status, name)
Task: Find name from sales where a matching record exists in products with the same id.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09373 | train |
v3 | Schema:
departments (alias: dept)(value, name, code, amount)
regions(id, level, status, salary)
Task: Find code from departments where value exceeds the count of salary from regions for the same code.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT COUNT(salary) FROM regions AS rgn
WHERE rgn.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09374 | train |
v2 | Schema:
shipments (alias: shp)(value, type, amount, name)
employees(code, salary, name, amount)
Task: Retrieve id from shipments that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_09375 | train |
v1 | Schema:
invoices (alias: inv)(date, id, level, status)
sales(name, code, status, type)
Task: Find salary from invoices where type appears in sales entries with matching code.
SQL: | SELECT salary FROM invoices AS inv
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09376 | train |
v3 | Schema:
branches (alias: brc)(value, level, name, id)
transactions(status, level, value, name)
Task: Find code from branches where value exceeds the average amount from transactions for the same code.
SQL: | SELECT code FROM branches AS brc
WHERE value > (
SELECT AVG(amount) FROM transactions AS txn
WHERE txn.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "transactions",
"outer_alias": "brc",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_09377 | train |
v3 | Schema:
invoices (alias: inv)(salary, code, date, level)
transactions(level, value, amount, date)
Task: Retrieve salary from invoices with amount above the SUM(value) of transactions rows sharing the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE amount > (
SELECT SUM(value) FROM transactions AS txn
WHERE txn.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09378 | train |
v2 | Schema:
customers (alias: cust)(type, code, name, value)
regions(level, code, status, amount)
Task: Retrieve salary from customers that have at least one corresponding entry in regions sharing the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09379 | train |
v2 | Schema:
accounts (alias: acct)(type, amount, level, status)
orders(id, level, value, amount)
Task: Retrieve salary from accounts that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09380 | train |
v3 | Schema:
accounts (alias: acct)(id, date, name, code)
requests(salary, type, name, date)
Task: Find value from accounts where salary exceeds the average value from requests for the same status.
SQL: | SELECT value FROM accounts AS acct
WHERE salary > (
SELECT AVG(value) FROM requests AS ordr
WHERE ordr.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09381 | train |
v2 | Schema:
accounts (alias: acct)(date, salary, code, id)
staff(salary, level, type, status)
Task: Retrieve code from accounts that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09382 | train |
v1 | Schema:
orders (alias: ord)(value, amount, date, status)
employees(level, type, id, value)
Task: Select salary from orders where level exists in employees for the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09383 | train |
v1 | Schema:
orders (alias: ord)(level, id, code, amount)
projects(salary, level, code, status)
Task: Retrieve amount from orders whose type is found in projects rows where type matches the outer record.
SQL: | SELECT amount FROM orders AS ord
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09384 | train |
v2 | Schema:
managers (alias: mgr)(code, date, id, value)
projects(date, name, id, value)
Task: Find name from managers where a matching record exists in projects with the same type.
SQL: | SELECT name 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": "name",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09385 | train |
v1 | Schema:
schedules (alias: schd)(name, date, id, value)
items(amount, salary, type, id)
Task: Retrieve salary from schedules whose type is found in items rows where level matches the outer record.
SQL: | SELECT salary FROM schedules AS schd
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_09386 | train |
v1 | Schema:
transactions (alias: txn)(code, type, value, name)
managers(type, status, level, name)
Task: Find value from transactions where type appears in managers entries with matching id.
SQL: | SELECT value FROM transactions AS txn
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09387 | train |
v3 | Schema:
branches (alias: brc)(value, level, type, status)
invoices(id, amount, name, code)
Task: Find salary from branches where value exceeds the average value from invoices for the same level.
SQL: | SELECT salary 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": "salary",
"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_09388 | train |
v1 | Schema:
branches (alias: brc)(type, salary, value, id)
requests(value, level, type, name)
Task: Find salary from branches where status appears in requests entries with matching level.
SQL: | SELECT salary FROM branches AS brc
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_09389 | train |
v2 | Schema:
products (alias: prod)(code, name, id, value)
accounts(id, code, status, type)
Task: Retrieve name from products that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = prod.level
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09390 | train |
v1 | Schema:
departments (alias: dept)(salary, id, level, name)
regions(level, id, name, value)
Task: Select value from departments where code exists in regions for the same level.
SQL: | SELECT value FROM departments AS dept
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09391 | train |
v2 | Schema:
transactions (alias: txn)(level, date, name, value)
requests(name, id, code, level)
Task: Find name from transactions where a matching record exists in requests with the same type.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09392 | train |
v2 | Schema:
products (alias: prod)(status, level, name, amount)
managers(code, date, type, name)
Task: Find code from products where a matching record exists in managers with the same status.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = prod.status
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09393 | train |
v2 | Schema:
items (alias: lne)(status, code, type, value)
tasks(value, date, level, name)
Task: Retrieve value from items that have at least one corresponding entry in tasks sharing the same code.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = lne.code
); | {
"outer_table": "items",
"inner_table": "tasks",
"outer_alias": "lne",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_09394 | train |
v3 | Schema:
tasks (alias: tsk)(amount, name, salary, code)
orders(amount, name, id, salary)
Task: Retrieve name from tasks with value above the AVG(amount) of orders rows sharing the same level.
SQL: | SELECT name FROM tasks AS tsk
WHERE value > (
SELECT AVG(amount) FROM orders AS ord
WHERE ord.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_09395 | train |
v3 | Schema:
tasks (alias: tsk)(amount, status, code, level)
staff(id, amount, name, salary)
Task: Find salary from tasks where value exceeds the average salary from staff for the same type.
SQL: | SELECT salary FROM tasks AS tsk
WHERE value > (
SELECT AVG(salary) FROM staff AS empl
WHERE empl.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "staff",
"outer_alias": "tsk",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_09396 | train |
v3 | Schema:
requests (alias: ordr)(level, salary, name, id)
invoices(type, value, name, date)
Task: Find salary from requests where salary exceeds the count of value from invoices for the same id.
SQL: | SELECT salary FROM requests AS ordr
WHERE salary > (
SELECT COUNT(value) FROM invoices AS inv
WHERE inv.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_09397 | train |
v2 | Schema:
employees (alias: emp)(id, salary, code, amount)
staff(date, salary, amount, code)
Task: Retrieve amount from employees that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09398 | train |
v1 | Schema:
managers (alias: mgr)(id, type, level, code)
orders(level, name, amount, id)
Task: Select code from managers where level exists in orders for the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_09399 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.