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:
regions (alias: rgn)(code, name, type, amount)
requests(level, code, name, date)
Task: Retrieve id from regions whose type is found in requests rows where type matches the outer record.
SQL: | SELECT id FROM regions AS rgn
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_01100 | train |
v2 | Schema:
employees (alias: emp)(id, amount, level, code)
managers(value, id, level, amount)
Task: Find name from employees where a matching record exists in managers with the same level.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01101 | train |
v2 | Schema:
staff (alias: empl)(name, id, salary, status)
regions(code, value, level, salary)
Task: Retrieve salary from staff that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_01102 | train |
v1 | Schema:
regions (alias: rgn)(type, id, name, level)
shipments(date, value, name, level)
Task: Retrieve code from regions whose code is found in shipments rows where status matches the outer record.
SQL: | SELECT code FROM regions AS rgn
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_01103 | train |
v2 | Schema:
items (alias: lne)(name, type, amount, id)
departments(value, salary, type, code)
Task: Retrieve salary from items that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = lne.status
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01104 | train |
v2 | Schema:
items (alias: lne)(amount, status, name, type)
sales(amount, level, salary, code)
Task: Retrieve name from items that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = lne.code
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01105 | train |
v1 | Schema:
branches (alias: brc)(name, amount, type, date)
staff(value, name, date, status)
Task: Find salary from branches where type appears in staff entries with matching status.
SQL: | SELECT salary FROM branches AS brc
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01106 | train |
v2 | Schema:
regions (alias: rgn)(status, level, name, amount)
accounts(code, type, date, value)
Task: Retrieve value from regions that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_01107 | train |
v2 | Schema:
managers (alias: mgr)(level, date, type, value)
regions(code, level, amount, type)
Task: Retrieve code from managers that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01108 | train |
v2 | Schema:
projects (alias: prj)(type, salary, value, status)
products(status, salary, id, amount)
Task: Retrieve salary from projects that have at least one corresponding entry in products sharing the same code.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01109 | train |
v2 | Schema:
requests (alias: ordr)(salary, value, id, status)
accounts(name, value, status, type)
Task: Retrieve code from requests that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01110 | train |
v2 | Schema:
customers (alias: cust)(salary, code, level, amount)
transactions(salary, level, amount, date)
Task: Find name from customers where a matching record exists in transactions with the same id.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01111 | train |
v3 | Schema:
transactions (alias: txn)(salary, date, value, status)
accounts(amount, name, id, level)
Task: Find code from transactions where value exceeds the average salary from accounts for the same type.
SQL: | SELECT code FROM transactions AS txn
WHERE value > (
SELECT AVG(salary) FROM accounts AS acct
WHERE acct.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01112 | train |
v1 | Schema:
categories (alias: catg)(salary, name, status, type)
invoices(code, date, amount, id)
Task: Retrieve id from categories whose type is found in invoices rows where level matches the outer record.
SQL: | SELECT id FROM categories AS catg
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01113 | train |
v3 | Schema:
shipments (alias: shp)(type, status, salary, value)
branches(status, code, type, id)
Task: Retrieve salary from shipments with amount above the MIN(amount) of branches rows sharing the same status.
SQL: | SELECT salary FROM shipments AS shp
WHERE amount > (
SELECT MIN(amount) FROM branches AS brc
WHERE brc.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01114 | train |
v3 | Schema:
accounts (alias: acct)(salary, code, type, value)
tasks(level, value, type, name)
Task: Find id from accounts where amount exceeds the maximum value from tasks for the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE amount > (
SELECT MAX(value) FROM tasks AS tsk
WHERE tsk.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01115 | train |
v2 | Schema:
departments (alias: dept)(code, value, id, date)
items(value, date, amount, code)
Task: Find amount from departments where a matching record exists in items with the same code.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01116 | train |
v1 | Schema:
products (alias: prod)(date, id, code, status)
invoices(status, id, level, name)
Task: Retrieve amount from products whose level is found in invoices rows where level matches the outer record.
SQL: | SELECT amount FROM products AS prod
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.level = prod.level
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01117 | train |
v3 | Schema:
projects (alias: prj)(salary, level, status, amount)
shipments(value, code, id, level)
Task: Find code from projects where salary exceeds the maximum amount from shipments for the same id.
SQL: | SELECT code FROM projects AS prj
WHERE salary > (
SELECT MAX(amount) FROM shipments AS shp
WHERE shp.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01118 | train |
v2 | Schema:
managers (alias: mgr)(amount, date, id, level)
products(salary, name, value, code)
Task: Retrieve value from managers that have at least one corresponding entry in products sharing the same code.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01119 | train |
v1 | Schema:
customers (alias: cust)(salary, type, amount, value)
shipments(level, status, salary, name)
Task: Select value from customers where id exists in shipments for the same id.
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_01120 | train |
v3 | Schema:
invoices (alias: inv)(salary, name, date, code)
sales(date, level, type, salary)
Task: Find amount from invoices where amount exceeds the total amount from sales for the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE amount > (
SELECT SUM(amount) FROM sales AS sale
WHERE sale.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01121 | train |
v1 | Schema:
regions (alias: rgn)(code, level, name, date)
managers(name, code, level, type)
Task: Find value from regions where type appears in managers entries with matching status.
SQL: | SELECT value FROM regions AS rgn
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_01122 | train |
v3 | Schema:
regions (alias: rgn)(name, date, code, level)
staff(code, id, amount, date)
Task: Retrieve name from regions with amount above the SUM(value) of staff rows sharing the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE amount > (
SELECT SUM(value) FROM staff AS empl
WHERE empl.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_01123 | train |
v3 | Schema:
accounts (alias: acct)(name, value, id, salary)
categories(salary, name, date, amount)
Task: Retrieve value from accounts with salary above the COUNT(value) of categories rows sharing the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE salary > (
SELECT COUNT(value) FROM categories AS catg
WHERE catg.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01124 | train |
v1 | Schema:
requests (alias: ordr)(name, status, level, salary)
tasks(amount, id, type, salary)
Task: Find code from requests where code appears in tasks entries with matching code.
SQL: | SELECT code FROM requests AS ordr
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01125 | train |
v1 | Schema:
staff (alias: empl)(name, id, level, code)
sales(id, status, level, value)
Task: Select id from staff where level exists in sales for the same status.
SQL: | SELECT id FROM staff AS empl
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_01126 | train |
v1 | Schema:
projects (alias: prj)(id, date, salary, value)
transactions(id, level, name, value)
Task: Retrieve value from projects whose code is found in transactions rows where status matches the outer record.
SQL: | SELECT value FROM projects AS prj
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01127 | train |
v3 | Schema:
managers (alias: mgr)(type, code, id, level)
orders(code, id, status, type)
Task: Find amount from managers where salary exceeds the minimum salary from orders for the same level.
SQL: | SELECT amount FROM managers AS mgr
WHERE salary > (
SELECT MIN(salary) FROM orders AS ord
WHERE ord.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01128 | train |
v1 | Schema:
products (alias: prod)(level, salary, amount, date)
departments(status, name, level, id)
Task: Retrieve amount from products whose level is found in departments rows where id matches the outer record.
SQL: | SELECT amount FROM products AS prod
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.id = prod.id
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01129 | train |
v2 | Schema:
customers (alias: cust)(id, value, date, type)
employees(salary, id, type, code)
Task: Find salary from customers where a matching record exists in employees with the same id.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01130 | train |
v3 | Schema:
requests (alias: ordr)(value, salary, date, status)
invoices(level, id, date, amount)
Task: Find value from requests where amount exceeds the average value from invoices for the same id.
SQL: | SELECT value FROM requests AS ordr
WHERE amount > (
SELECT AVG(value) FROM invoices AS inv
WHERE inv.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01131 | train |
v1 | Schema:
orders (alias: ord)(level, name, date, code)
regions(salary, value, date, status)
Task: Find salary from orders where code appears in regions entries with matching level.
SQL: | SELECT salary FROM orders AS ord
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01132 | train |
v2 | Schema:
requests (alias: ordr)(status, date, code, type)
branches(value, level, amount, status)
Task: Find name from requests where a matching record exists in branches with the same id.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01133 | train |
v2 | Schema:
branches (alias: brc)(date, amount, id, type)
regions(value, date, type, amount)
Task: Retrieve code from branches that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01134 | train |
v1 | Schema:
employees (alias: emp)(name, level, value, status)
invoices(status, name, salary, id)
Task: Select id from employees where status exists in invoices for the same level.
SQL: | SELECT id FROM employees AS emp
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01135 | train |
v1 | Schema:
customers (alias: cust)(code, level, status, date)
projects(status, name, salary, value)
Task: Select salary from customers where id exists in projects for the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01136 | train |
v2 | Schema:
products (alias: prod)(salary, type, id, name)
items(name, value, level, date)
Task: Retrieve code from products that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = prod.type
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01137 | train |
v3 | Schema:
sales (alias: sale)(date, salary, status, code)
projects(name, amount, status, value)
Task: Retrieve value from sales with salary above the SUM(value) of projects rows sharing the same code.
SQL: | SELECT value FROM sales AS sale
WHERE salary > (
SELECT SUM(value) FROM projects AS prj
WHERE prj.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01138 | train |
v2 | Schema:
categories (alias: catg)(value, salary, name, type)
departments(status, id, type, name)
Task: Retrieve value from categories that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01139 | train |
v1 | Schema:
staff (alias: empl)(status, id, amount, salary)
managers(code, level, type, amount)
Task: Select value from staff where status exists in managers for the same id.
SQL: | SELECT value FROM staff AS empl
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_01140 | train |
v3 | Schema:
staff (alias: empl)(name, type, id, date)
schedules(type, value, amount, level)
Task: Retrieve value from staff with value above the MAX(value) of schedules rows sharing the same type.
SQL: | SELECT value FROM staff AS empl
WHERE value > (
SELECT MAX(value) FROM schedules AS schd
WHERE schd.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_01141 | train |
v1 | Schema:
regions (alias: rgn)(salary, name, date, type)
customers(value, code, date, name)
Task: Select value from regions where level exists in customers for the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_01142 | train |
v1 | Schema:
schedules (alias: schd)(name, amount, salary, type)
requests(name, level, type, date)
Task: Select id from schedules where level exists in requests for the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01143 | train |
v2 | Schema:
items (alias: lne)(code, amount, name, id)
customers(date, level, id, status)
Task: Retrieve amount from items that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = lne.level
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01144 | train |
v3 | Schema:
customers (alias: cust)(name, salary, status, code)
transactions(code, level, value, type)
Task: Retrieve amount from customers with salary above the AVG(amount) of transactions rows sharing the same id.
SQL: | SELECT amount FROM customers AS cust
WHERE salary > (
SELECT AVG(amount) FROM transactions AS txn
WHERE txn.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01145 | train |
v2 | Schema:
tasks (alias: tsk)(status, type, value, salary)
branches(type, id, value, level)
Task: Retrieve code from tasks that have at least one corresponding entry in branches sharing the same status.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_01146 | train |
v2 | Schema:
requests (alias: ordr)(type, name, status, date)
orders(value, type, amount, name)
Task: Retrieve code from requests that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01147 | train |
v3 | Schema:
transactions (alias: txn)(name, type, amount, code)
customers(type, level, value, status)
Task: Find code from transactions where value exceeds the count of value from customers for the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE value > (
SELECT COUNT(value) FROM customers AS cust
WHERE cust.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01148 | train |
v1 | Schema:
orders (alias: ord)(value, salary, code, status)
requests(status, level, date, name)
Task: Select code from orders where type exists in requests for the same level.
SQL: | SELECT code FROM orders AS ord
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01149 | train |
v3 | Schema:
staff (alias: empl)(status, date, amount, id)
shipments(code, level, type, status)
Task: Find value from staff where amount exceeds the maximum amount from shipments for the same id.
SQL: | SELECT value FROM staff AS empl
WHERE amount > (
SELECT MAX(amount) FROM shipments AS shp
WHERE shp.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_01150 | train |
v3 | Schema:
branches (alias: brc)(amount, salary, level, code)
invoices(value, status, level, salary)
Task: Retrieve salary from branches with amount above the MIN(amount) of invoices rows sharing the same type.
SQL: | SELECT salary FROM branches AS brc
WHERE amount > (
SELECT MIN(amount) FROM invoices AS inv
WHERE inv.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01151 | train |
v2 | Schema:
products (alias: prod)(type, salary, code, amount)
orders(id, code, type, salary)
Task: Retrieve id from products that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT id 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": "id",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01152 | train |
v2 | Schema:
departments (alias: dept)(amount, date, type, value)
requests(status, amount, level, code)
Task: Retrieve name from departments that have at least one corresponding entry in requests sharing the same id.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01153 | train |
v2 | Schema:
transactions (alias: txn)(value, level, id, salary)
tasks(value, status, type, code)
Task: Find name from transactions where a matching record exists in tasks with the same level.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01154 | train |
v1 | Schema:
shipments (alias: shp)(id, date, name, status)
schedules(code, name, salary, amount)
Task: Select salary from shipments where status exists in schedules for the same status.
SQL: | SELECT salary FROM shipments AS shp
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01155 | train |
v3 | Schema:
items (alias: lne)(value, id, level, salary)
branches(date, id, status, level)
Task: Find code from items where amount exceeds the maximum salary from branches for the same level.
SQL: | SELECT code FROM items AS lne
WHERE amount > (
SELECT MAX(salary) FROM branches AS brc
WHERE brc.level = lne.level
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01156 | train |
v3 | Schema:
items (alias: lne)(salary, id, date, level)
shipments(status, type, value, id)
Task: Find id from items where value exceeds the minimum salary from shipments for the same code.
SQL: | SELECT id FROM items AS lne
WHERE value > (
SELECT MIN(salary) FROM shipments AS shp
WHERE shp.code = lne.code
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01157 | train |
v2 | Schema:
branches (alias: brc)(status, code, amount, name)
transactions(name, date, value, id)
Task: Find name from branches where a matching record exists in transactions with the same status.
SQL: | SELECT name 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": "name",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01158 | train |
v1 | Schema:
requests (alias: ordr)(value, id, salary, status)
schedules(name, status, amount, type)
Task: Find salary from requests where code appears in schedules entries with matching level.
SQL: | SELECT salary FROM requests AS ordr
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01159 | train |
v2 | Schema:
shipments (alias: shp)(level, type, salary, date)
customers(amount, code, date, name)
Task: Retrieve salary from shipments that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01160 | train |
v2 | Schema:
employees (alias: emp)(id, status, value, name)
tasks(salary, value, id, name)
Task: Retrieve code from employees that have at least one corresponding entry in tasks sharing the same level.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01161 | train |
v2 | Schema:
shipments (alias: shp)(id, level, salary, status)
branches(name, id, code, level)
Task: Find name from shipments where a matching record exists in branches with the same level.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01162 | train |
v2 | Schema:
projects (alias: prj)(level, amount, date, value)
accounts(status, code, id, value)
Task: Find value from projects where a matching record exists in accounts with the same id.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01163 | train |
v1 | Schema:
employees (alias: emp)(status, date, amount, name)
shipments(value, level, code, type)
Task: Find salary from employees where status appears in shipments entries with matching code.
SQL: | SELECT salary FROM employees AS emp
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01164 | train |
v1 | Schema:
branches (alias: brc)(id, value, salary, amount)
managers(id, name, level, code)
Task: Select id from branches where type exists in managers for the same code.
SQL: | SELECT id FROM branches AS brc
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "managers",
"outer_alias": "brc",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01165 | train |
v1 | Schema:
accounts (alias: acct)(status, amount, code, name)
transactions(id, date, type, value)
Task: Retrieve salary from accounts whose level is found in transactions rows where level matches the outer record.
SQL: | SELECT salary FROM accounts AS acct
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01166 | train |
v1 | Schema:
categories (alias: catg)(id, name, amount, status)
shipments(value, status, salary, amount)
Task: Find value from categories where status appears in shipments entries with matching status.
SQL: | SELECT value FROM categories AS catg
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01167 | train |
v3 | Schema:
requests (alias: ordr)(value, id, level, type)
tasks(type, value, code, date)
Task: Retrieve id from requests with salary above the MIN(value) of tasks rows sharing the same code.
SQL: | SELECT id FROM requests AS ordr
WHERE salary > (
SELECT MIN(value) FROM tasks AS tsk
WHERE tsk.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01168 | train |
v2 | Schema:
managers (alias: mgr)(id, date, amount, value)
regions(salary, code, value, level)
Task: Retrieve code from managers that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01169 | train |
v1 | Schema:
customers (alias: cust)(value, name, salary, date)
employees(name, type, value, status)
Task: Retrieve id from customers whose level is found in employees rows where status matches the outer record.
SQL: | SELECT id FROM customers AS cust
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01170 | train |
v3 | Schema:
managers (alias: mgr)(type, code, status, id)
categories(status, date, type, name)
Task: Retrieve salary from managers with value above the AVG(amount) of categories rows sharing the same status.
SQL: | SELECT salary FROM managers AS mgr
WHERE value > (
SELECT AVG(amount) FROM categories AS catg
WHERE catg.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01171 | train |
v2 | Schema:
categories (alias: catg)(type, value, status, code)
orders(date, status, id, name)
Task: Find salary from categories where a matching record exists in orders with the same code.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01172 | train |
v2 | Schema:
requests (alias: ordr)(type, amount, id, code)
branches(salary, type, amount, name)
Task: Find salary from requests where a matching record exists in branches with the same code.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01173 | train |
v3 | Schema:
managers (alias: mgr)(salary, amount, value, id)
requests(salary, date, name, amount)
Task: Retrieve id from managers with value above the AVG(value) of requests rows sharing the same type.
SQL: | SELECT id FROM managers AS mgr
WHERE value > (
SELECT AVG(value) FROM requests AS ordr
WHERE ordr.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01174 | train |
v2 | Schema:
tasks (alias: tsk)(name, amount, status, type)
requests(value, type, date, id)
Task: Retrieve name from tasks that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT name 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": "name",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_01175 | train |
v3 | Schema:
products (alias: prod)(value, code, date, name)
tasks(value, code, name, salary)
Task: Find value from products where salary exceeds the average value from tasks for the same type.
SQL: | SELECT value FROM products AS prod
WHERE salary > (
SELECT AVG(value) FROM tasks AS tsk
WHERE tsk.type = prod.type
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01176 | train |
v3 | Schema:
branches (alias: brc)(value, amount, type, code)
shipments(code, level, salary, date)
Task: Find name from branches where amount exceeds the average amount from shipments for the same type.
SQL: | SELECT name FROM branches AS brc
WHERE amount > (
SELECT AVG(amount) FROM shipments AS shp
WHERE shp.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01177 | train |
v3 | Schema:
orders (alias: ord)(status, value, date, code)
branches(id, name, value, status)
Task: Find value from orders where amount exceeds the total value from branches for the same level.
SQL: | SELECT value FROM orders AS ord
WHERE amount > (
SELECT SUM(value) FROM branches AS brc
WHERE brc.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01178 | train |
v2 | Schema:
sales (alias: sale)(level, amount, value, name)
employees(name, status, id, value)
Task: Find name from sales where a matching record exists in employees with the same status.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01179 | train |
v3 | Schema:
categories (alias: catg)(type, date, value, id)
regions(amount, code, status, date)
Task: Find name from categories where salary exceeds the average amount from regions for the same status.
SQL: | SELECT name FROM categories AS catg
WHERE salary > (
SELECT AVG(amount) FROM regions AS rgn
WHERE rgn.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01180 | train |
v3 | Schema:
branches (alias: brc)(status, name, value, date)
projects(date, name, status, salary)
Task: Find code from branches where salary exceeds the total amount from projects for the same code.
SQL: | SELECT code FROM branches AS brc
WHERE salary > (
SELECT SUM(amount) FROM projects AS prj
WHERE prj.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01181 | train |
v2 | Schema:
accounts (alias: acct)(id, salary, code, type)
orders(type, value, salary, id)
Task: Find value from accounts where a matching record exists in orders with the same status.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01182 | train |
v2 | Schema:
transactions (alias: txn)(value, code, id, salary)
tasks(date, amount, name, salary)
Task: Find value from transactions where a matching record exists in tasks with the same type.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01183 | train |
v2 | Schema:
employees (alias: emp)(value, name, date, id)
branches(id, amount, date, type)
Task: Find name from employees where a matching record exists in branches with the same status.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01184 | train |
v2 | Schema:
shipments (alias: shp)(amount, id, name, code)
schedules(type, name, code, status)
Task: Retrieve amount from shipments that have at least one corresponding entry in schedules sharing the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01185 | train |
v1 | Schema:
tasks (alias: tsk)(code, status, date, type)
departments(type, value, amount, level)
Task: Select code from tasks where code exists in departments for the same type.
SQL: | SELECT code 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": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_01186 | train |
v1 | Schema:
regions (alias: rgn)(salary, name, code, status)
customers(id, type, value, code)
Task: Select code from regions where id exists in customers for the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_01187 | train |
v3 | Schema:
customers (alias: cust)(salary, date, name, value)
items(type, amount, code, date)
Task: Retrieve amount from customers with amount above the SUM(value) of items rows sharing the same id.
SQL: | SELECT amount FROM customers AS cust
WHERE amount > (
SELECT SUM(value) FROM items AS lne
WHERE lne.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01188 | train |
v1 | Schema:
requests (alias: ordr)(id, salary, value, status)
employees(id, status, value, name)
Task: Retrieve name from requests whose code is found in employees rows where code matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01189 | train |
v3 | Schema:
products (alias: prod)(type, date, level, name)
items(name, status, level, code)
Task: Retrieve id from products with value above the MIN(salary) of items rows sharing the same type.
SQL: | SELECT id FROM products AS prod
WHERE value > (
SELECT MIN(salary) FROM items AS lne
WHERE lne.type = prod.type
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01190 | train |
v2 | Schema:
categories (alias: catg)(amount, level, id, type)
employees(value, status, type, amount)
Task: Find salary from categories where a matching record exists in employees with the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01191 | train |
v3 | Schema:
customers (alias: cust)(level, date, status, name)
sales(status, value, code, level)
Task: Find salary from customers where salary exceeds the minimum value from sales for the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE salary > (
SELECT MIN(value) FROM sales AS sale
WHERE sale.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01192 | train |
v3 | Schema:
tasks (alias: tsk)(date, id, level, code)
branches(type, id, name, level)
Task: Retrieve name from tasks with amount above the MIN(value) of branches rows sharing the same status.
SQL: | SELECT name FROM tasks AS tsk
WHERE amount > (
SELECT MIN(value) FROM branches AS brc
WHERE brc.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_01193 | train |
v3 | Schema:
branches (alias: brc)(date, salary, level, amount)
tasks(code, salary, amount, date)
Task: Retrieve amount from branches with amount above the MAX(amount) of tasks rows sharing the same id.
SQL: | SELECT amount FROM branches AS brc
WHERE amount > (
SELECT MAX(amount) FROM tasks AS tsk
WHERE tsk.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01194 | train |
v3 | Schema:
categories (alias: catg)(date, level, amount, code)
schedules(name, code, salary, amount)
Task: Find amount from categories where salary exceeds the average value from schedules for the same status.
SQL: | SELECT amount FROM categories AS catg
WHERE salary > (
SELECT AVG(value) FROM schedules AS schd
WHERE schd.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01195 | train |
v3 | Schema:
categories (alias: catg)(value, amount, salary, code)
accounts(status, name, date, type)
Task: Find code from categories where value exceeds the total value from accounts for the same status.
SQL: | SELECT code FROM categories AS catg
WHERE value > (
SELECT SUM(value) FROM accounts AS acct
WHERE acct.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "code",
"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_01196 | train |
v2 | Schema:
tasks (alias: tsk)(date, status, id, type)
branches(code, amount, type, value)
Task: Retrieve amount from tasks that have at least one corresponding entry in branches sharing the same id.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_01197 | train |
v1 | Schema:
tasks (alias: tsk)(date, type, level, amount)
customers(name, amount, id, date)
Task: Select amount from tasks where code exists in customers for the same status.
SQL: | SELECT amount FROM tasks AS tsk
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "tsk",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_01198 | train |
v1 | Schema:
orders (alias: ord)(name, value, type, date)
projects(id, value, name, salary)
Task: Select value from orders where type exists in projects for the same type.
SQL: | SELECT value 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": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01199 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.